Something odd after upgrading to swiftc 6.0

I updated Xcode and I had to agree to the new terms of service to complete the upgrade from Swift 5.10 to 6.0.
Then this happened:

% swiftc a.swift
clang: error: no such file or directory: '35758'
clang: error: no input files
% swiftc --version
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0

I tried compiling again and it worked fine, but what is or was this mysterious 35758 directory? And why would an input file be deemed "no input files"?

Well, that’s weird. I’m not seeing this myself:

% xcode-select -p
/Applications/Xcode.app/Contents/Developer
% swiftc --version
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx14.0
% cat a.swift 
func main() {
    print("Hello Cruel World!")
}

main()
% swiftc a.swift
% ./a
Hello Cruel World!

I’m running the Swift 6 from Xcode 16.0 on macOS 14.6.1.

I’ve seen weird issues like this caused by the environmental setup. I recommend that you create a new user account (in System Settings > Users & Groups) and run the above test from there. That’ll tell you whether this is tied to the state in your home directory or not.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

1 Like

OK I created a new account. I don't see the issue when compiling in that one.

I don't see the issue when compiling in that one.

Cool. That confirms that there’s something in your home directory that’s ‘breaking’ your developer tools. That’s kinda vague, but it’s a start.

As a next step, I recommend that you temporarily disable all the startup scripts for your shell. If you’re using macOS’s default zsh shell, that means:

  • ~/.zshenv
  • ~/.zprofile
  • ~/.zshrc
  • ~/.zlogin
  • ~/.zlogout

That’ll tell you whether a custom shell configuration option is causing the issue. For example, in one case I saw on DevForums the developer had set an environment variable that was causing an issue reminiscent of this.

Share and Enjoy

Quinn “The Eskimo!” @ DTS @ Apple

1 Like