-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 --host_macos_minimum_os flag #13001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related change previously: #9403.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable, but I'm surprised the problem described in the linked issue hasn't been more widespread. I think I'd like @trybka to take a look at it too just to make sure this is the right way to tackle it.
I think this is fine? I'm not sure I entirely understand the usecase, though I can understand usecases where it might help. This also feels like maybe not ideal, but until we have widespread execution platforms, I don't see a better alternative. |
The cache sharing would be based on different Xcode versions, not OS versions. I'm not entirely sure what targeting a newer-than-current OS version does, since it's clearly "working" as is, but it's less than ideal imo, and we should be able to target our actual minimum OS. Maybe it could affect deprecation warnings for example? |
Did a bit more digging here. So it looks like it will happily create a binary for the SDK version you specify, and run it on an older version, but the downside is you get none of the protections around API usage, so there's the big risk. You won't find out until runtime on an older OS that your tools are actually incompatible in some way depending on what API they use. |
I spent some more time thinking about this because something about it still didn't feel quite right. Some random thoughts:
The original issue mentioned the use case being a |
I don't think you could ever jump to just 1 value for this given that in either case of going higher or lower you could fail the build depending on the warnings / errors that were introduced with different deployment targets. Definitely open the other suggestions here, having folks create their own transitions to solve this case is a super high barrier of entry to solve this bug so I think we should land some solution |
e91a1ad
to
3e84019
Compare
@gregestren @katre Could this be done without a flag? It seems very similar to the Android case. |
Given that this is adding a host version of an existing flag, I think it makes sense. The new Starlark flag we've added for Android's minimum SDK version is only possible because that affects the NDK, which is really a |
@allevato @trybka Can one of you please do a review and actually approve. |
OK. I'll do the merge. |
Damm. It must have gone stale and tests don't pass any more. Keith: can you look into that? |
3e84019
to
8916c4e
Compare
Should be green shortly @aiuto |
Can this be imported now? 🙏 Thanks! |
Sigh. I am trying to merge this, but it fails, and I don't know how to fix the newly added test. |
This flag makes sure we set the minimum macOS version when compiling host tools. Otherwise you can end up not sharing caches across different OS versions. Fixes bazelbuild#12988
Hrm, I thought that was the one I fixed last time, testing locally again |
8916c4e
to
444789c
Compare
@aiuto which build did that failure come from? I don't see that locally anymore, did that include my more recent force push? (rebased to have CI run again for good measure) This is what im testing with locally:
|
Oh,... silly me. I may have to re-sync. I'll check later tonight.
…On Mon, Oct 4, 2021 at 5:29 PM Keith Smiley ***@***.***> wrote:
@aiuto <https://github.com/aiuto> which build did that failure come from?
I don't see that locally anymore, did that include my more recent force
push?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13001 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHAJX4CQ3IESXRMSEEDUFIMFPANCNFSM4XPJNMJQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The flag was introduced in #13001 but not usable internally, because the host flag was not saved when doing a transition. Host flags should be saved, like in: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java#L1212 PiperOrigin-RevId: 435091962
The flag was introduced in bazelbuild#13001 but not usable internally, because the host flag was not saved when doing a transition. Host flags should be saved, like in: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java#L1212 PiperOrigin-RevId: 435091962 (cherry picked from commit b8a2ee2)
…#15068) The flag was introduced in #13001 but not usable internally, because the host flag was not saved when doing a transition. Host flags should be saved, like in: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java#L1212 PiperOrigin-RevId: 435091962 (cherry picked from commit b8a2ee2) Co-authored-by: waltl <waltl@google.com>
This flag makes sure we set the minimum macOS version when compiling
host tools. Otherwise you can end up not sharing caches across
different OS versions.
Fixes #12988