-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Add permit_weak_imports directive #741
Conversation
669b598
to
e15e47f
Compare
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for new versions of Xcode to ensure that e.g. building on 10.11 against the 10.12 SDK doesn't result in a situation where autotools thinks symbols exist that don't actually exist on the current platform. Further discussion in golang/go#16770 revealed that some packages require weak imports to build normally.
e15e47f
to
9c7f24b
Compare
Reading golang/go#16770 (comment) I'm not sure this is the right solution. I think we should strip Alternatively, we only apply CC @achivetta for thoughts on this. |
@MikeMcQuaid Yeah, my SDKROOT bug currently affects
I'm not thrilled with this |
@ilovezfs to be more explicit: does that bug also only affect e.g. using the OS X 10.X+1 SDK on OS X 10.X? If so, it feels like we do want to start special-casing that situation (which we previously decided to not do). |
Yes. |
Yeh, I think we may want various options that apply only to that case, then, rather than fixing it on a formula-by-formula basis. |
@MikeMcQuaid set |
I think the relevant comment in the Go discussion is:
We don't care whether our go executable can run on 10.6 but we do care about whether the go we build can produce executables that run on 10.6; the suggestion is that go needs to use the minimum deployment target flag to achieve that. I might not have expected this was the case because go can cross-compile to darwin on systems without an Apple SDK available? but I also know nothing about go internals. |
@tdsmith In that case I think it makes sense to just set this flag for 10.11 using the 10.12 SDK (i.e. Xcode 8) and have a general block/method for handling the other various quirks that need set in this situation (although this can be punted to another PR). |
To be more explicit: I'm definitely 👎 on disabling this on a formula-by-formula basis and we can consider just disabling this flag on OS X 10.12 entirely for now if what I've described is too much work to do in the near future. |
I think removing Whilst we don't build our Go-using formulae to run as far back as 10.6, I think it'd be the wrong thing to do to make anyone who wants to develop backwards-compatible executables with |
Just for expectation-setting, I don't have any immediate plans to work on a different approach; I just thought this sounded like a chance to play with ENV internals. :) I'm not really compelled by the idea that build failures against future SDKs are upstream bugs but I think that's probably a separate discussion vs. this PR. |
I don't have a strong opinion on the right approach here; my goal was just to make sure you had the tools to solve the broken packages before macOS GM'ed. But let me see if I can sort out the various cases. There are three versions at play here:
Okay, so a few thoughts on how to proceed:
Hope that helps! (Also, CC @jeremyhu in case he has other thoughts.) |
@achivetta Thanks, that's really helpful. There is a way to do this but only on a single compiler invocation e.g. if you pass |
aside: |
@MikeMcQuaid The problem with a per-compiler-invocation approach is that you need the |
Ideally and if we could auto-detect if a formula properly supports compiling against a macOS SDK and can properly deal with the situation that OS/deployment version < SDK version, we could consider turning off some of the adjustments made by our |
Thanks everyone. Think it's worth 🚢ing this as-is for now and we'll rethink later if we need to start whitelisting too many formulae. |
Issue Homebrew/homebrew-core#3727 suggested we set -no_weak_imports for new versions of Xcode to ensure that e.g. building on 10.11 against the 10.12 SDK doesn't result in a situation where autotools thinks symbols exist that don't actually exist on the current platform.
Further discussion in golang/go#16770 revealed that some packages require weak imports to build normally.
This PR allows formulas to opt out of -no_weak_imports.