-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: Add version check for mac sdk version #17956
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
This specifically lists the macOS SDK version (currently 10.11) needed to build the osx backend. It also turns on compiler warnings for when code uses features newer than the minimum version (and makes warnings errors for this file).
You could do this only if, e.g., |
But this would mean any Mac user trying to build would have failures unless they set the variable. |
Fundamentally, the problem we have right now is we have merged API calls that only work on macOS >= 10.11, but by default many places (including python.org) are targeting macOS 10.9. |
I am maintaining the matplotlib port on MacPorts - with the version update to 3.3.0 we see indeed all builds for macOS < 10.11 fail because of the recent changes:
Instead of requiring macOS 10.11 or above and documenting that (as seems the proposition of this PR), can backwards-compatibility be restored/introduced for earlier versions (it worked fine with matplotlib v3.2.2). |
@reneeotten The >=10.11 APIs were added in #16710 to fix a real limitation in the OSX backend. What's the argument for supporting 10.9 (seven years old) vs. 10.11 (5 years old), when the latter still supports systems 12 years old at this point? One potential option here is to add the |
Don't unconditionally use the newer properties, but check the available version. This allows us to continue to target 10.9 by default and eliminate any hard-coded deployment version.
Ok, so on the basis of:
I've gone ahead and eliminated the hard-coded version check, and instead surrounded those properties with a guard for macOS 10.11. This gives us back the flexibility of the what the deployment target is. The effect will be that on versions < 10.11, we don't use those properties; I assume then that things won't work quite as well, but won't be completely busted. |
thanks for the response @dopplershift!
I do see your point, however MacPorts just tries to support older OSes as much as possible. I was kind of surprised about the breakage, especially since it wasn't documented anywhere (at least I think so). I will add your patch and see how that goes on older versions of macOS. Even if that has the effect that the scaling of the messagebox isn't perfect, I'd think being able to compile/use the |
We have other deprecated constants that flags warnings in CI. Unfortunately, the deprecations occur in the same version when the new names are introduced, and we can't rely on those being available yet.
@reneeotten We had no idea, the APIs snuck in and for some reason by default the compilers don't warn about it. IMO I think we'll be leaving support for the older OSes for now since just guarding the access looks sufficient. |
the patch doesn't seem to work... now it still fails on macOS 10.11 with:
and below macOS 10.11 with:
|
@reneeotten At the risk of asking a very obvious question, are you sure you patched it in the right place? The line number do not quite match up.
reads to me like clang is saying that this is invalid syntax? It seems to be building on our CI as well.. |
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.
Anyone can merge once we are confident that this patch actually builds everywhere.
@tacaswell Yes, I am sure. The line numbers are different compared to what is shown in this PR since that originates from the current
The CI seems to be using [edit: see the comment by @ryandesign about the patch suggested here that I committed to MacPorts. I am definitely out of my comfort zone with this, but I'll probably try the suggestion he made and see if that works.] |
macOS always uses |
So based on the links from @reneeotten, it looks like you just can't use old compilers (XCode < 9) and have access to |
@reneeotten are you happy enough to patch the code out of existence on the older systems? |
thanks @tacaswell and @dopplershift - I have patched out the code for older systems already and that seems to do the trick. So yes, for now we're all good. I suppose that at some point if/when there are more changes in the |
All looks good so I'll merge this. Have opened #18066 as it seems like we are missing minimum supported OSX version documentation. |
…956-on-v3.3.x Backport PR #17956 on branch v3.3.x (ENH: Add version check for mac sdk version)
PR Summary
This specifically lists the macOS SDK version (currently 10.11) needed to build the osx backend. It also turns on compiler warnings for when code uses features newer than the minimum version (and makes warnings errors for this file).
This should hopefully help CI catch when we start using API's past our minimum desired version. It's currently set to 10.9 specifically to see it now fail.
Questions:
MACOS_DEPLOYMENT_TARGET
. The problem right now is that most places (default Python builds, etc.) are using 10.9, so this has to be set somewhere for things to build properly out of the box.PR Checklist