-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
natalie: fix build on Xcode 8.1 (Swift 3.0.1) #6406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
By the way, I grepped the code base and only found one occurrence of |
This is probably fine, but I'm wondering whether we should delete CC, or just turn it into the full path since this will now ignore a user's --cc=, right? |
I doubt you can compile a Swift project with any flavor of GCC. What else is there other than clang which is the default? |
I don't really oppose the idea of turning it into a full path. |
I guess maybe if someone wants to use the llvm clang for instance? |
I never used
Maybe it's just confusingly worded. |
Yes, remember we were talking about coming up with some special name for the llvm clang? Presumably we'd want to honor that selection ... |
I have to say though if this affects all swift projects now it seems like it belongs in superenv or something |
If affects |
Oh, actually I was building swiftgen (with the Swift 2.3 patch) just now, and it wasn't affected. So definitely not all Swift projects are broken. But a case can still be made about solving this in superenv. |
By the way, I tried ENV["CC"] = `which #{ENV["CC"]}` just now, which sets |
Isn't it ENV.cc? |
Okay sure, I can't tell the difference between ENV.cc and ENV["CC"] except when assigning. Anyway, ENV.cc is also a name that needs to be resolved. And when it resolves to a symlink it doesn't work, due to the fixme: // Check that it's valid in the file system.
// FIXME: We should also check that it resolves to an executable file
// (it could be a symlink to such as file).
guard localFileSystem.exists(swiftCompiler) else {
throw Error.invalidToolchain(problem: "could not find `swiftc` at expected path \(swiftCompiler.asString)")
} Of course we could further resolve symlinks... |
And why is using the shim as the full path wrong? |
Because I forgot to chomp, and was misled by a sloppy reading of the FIXME. ENV["CC"] = `which #{ENV.cc}`.chomp is fine. |
3a9b327
to
b0e6860
Compare
cool. I think you can use the |
In Swift 3.0.1 Swift Pacakge Manager now interprets CC as either an absolute path or a path relative to pwd (see swiftlang/swift-package-manager@be54a9f line 47-50). Our CC is usually just 'clang', which is interpreted as buildpath/clang and leads to an invalid toolchain error. Sample logs: https://gist.github.com/c8541f621bc2cc1028638391c7b50269.
b0e6860
to
9b1a01b
Compare
Whoo handy. |
@BrewTestBot test this please |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?In Swift 3.0.1 Swift Pacakge Manager now interprets
CC
as either anabsolute path or a path relative to pwd (see swiftlang/swift-package-manager@be54a9f line 47-50).
Our
CC
is usually justclang
, which is interpreted asbuildpath/clang
and leads to an invalid toolchain error. Sample logs: https://gist.github.com/c8541f621bc2cc1028638391c7b50269.Kind of funny that I discovered the bug while setting out to fix natalie on Sierra (for #5488), not knowing that it was already updated, just not ticked off.