"Unsupported runtime" error and yet I'm in Darwin/macOS

  • Updated to macOS v26;
  • Updated VSCode;
  • Updated Swift extension (swiftlang.swift-vscode) to 2.11.20250806;
  • Updated the Swift toolchain: swiftly install latest; swiftly uninstall 6.1.3
  • Swift: Clear Build Folder;
  • Swift: Reset package dependencies;
  • Rebooted computer for good measure;

The only external dependency I have in this project is swift-log .

Compiling now throws errors claiming “Unsupported runtime”. It leads to a section on code testing the environment: Logging.swift:29

 #if canImport(WASILibc)
// No locking on WASILibc
#elseif canImport(Darwin)
import Darwin
#elseif os(Windows)
import WinSDK
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Android)
import Android
#elseif canImport(Musl)
import Musl
#else
#error("Unsupported runtime")  // <<<
#endif

What I don’t understand is if I run this in the REPL (in the terminal and within VSCode) and get the expected result: canImport(Darwin) is true… so why would compiling my project throw this error?

Logging is also complaining that Darwin has no stderr members which sounds wrong…

This was working with earlier versions of Swift (say 6.1.x)…… so what’s happening here?

I've found a fix for my problems and I've explained it here: Compiler won't `import Foundation` since swift 6.2 (via swiftly)

Short answer (in case the links breaks in the future): never trust swift: Clean Build Folder to actually do what it says; You should always delete .build manually to ensure that stuff that should be deleted actually gets deleted.