Compiler won't `import Foundation` since swift 6.2 (via swiftly)

  • 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;

I've stripped down to a bare-bones project — zero dependency on external project/module — but since swift 6.2 I can't seem to import Foundation:

error: no such module 'Foundation'

  1. Is Foundation no-longer[1] part of the Swift Toolchain?
  2. I've reached the limit of my knowledge; what else could I do to troubleshoot this problem?!

  1. This used to work in early version of the toolchain installed by swiftly. ↩︎

I believe I have found a fix: Is VS Code integration broken on Mac now? How to debug? Wrong 'No such module' errors - #4 by Sean.Batson

Apparently, asking VSCode to swift: Clean Build Folder and swift: Reset Package Dependencies is not enough… I had to manually delete the .build folder before anything worked again. :person_facepalming:t2:

Having invisible data is great when processes dealing with such data work great; Otherwise, what's the point of having it invisible if people need to babysit it?!?!

I'll just make a habit to never do the above commands ever… and manually nuke the folder instead… :anger_symbol::anger_symbol::anger_symbol:

I understand when temporary intermediate files reside in a hidden folder, but I always wondered why the resulting executable is also buried there.