-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Use latest Mac OS X SDK #371
Conversation
Set WITH_LATEST_OSX_SDK so that the latest SDK is used.
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
@conda-forge-admin, please rerender |
…da-forge-pinning 2020.07.30.14.05.10
It seems like the rerender wiped out my changes? |
This change breaks the ability to run the built python on old installs of macOS. |
@mingwandroid I don't think is does, it doesn't change the deployment target which is still set to 10.9. My understanding is the Mac SDK are designed so you can still target older version of the OS. |
@mingwandroid Apple set up the SDKs so you can build with a newer one and specify an older runtime target. See here. |
I have been developing Apple cross compiler tool chains for about 8 years now. That stuff plain does not work for anything non-trivial. |
@mingwandroid You have run into specific problems with python? We have used it with non-trivial Qt applications. If this is not an approach that will work, is there a way that we could build two versions, one using the latest SDK and upload it will a label? Our application it pretty much broken on the Mac without using the latest SDK, it looks like others are also running into these issues. We are just looking for a decent solution. |
If you make a Python that links to a newer SDK that calls functions from that newer macOS SDKs APIs then that Python (or at least those APIs) will crash or not work on older versions of macOS. If you make a python that links to a newer SDK but does not call any of those functions then you may as well compile it against the oldest SDK that you can to guarantee compatibility with older macOS. I'm very aware that Qt project (via chromium) use new macOS SDKs and APIs and yes, our Qt libraries are built against those, out of necessity. A pyqt then built against that and loaded by such an old-SDK python will work just fine on your more modern macOS systems. We could make a new Python but please, show me what it would fix. The issue you linked to is orthogonal to this issue, it's about Qt, and yes, I agree, there is a need to use new SDKs there. |
A variant against new SDKs can for sure be created and it's not a huge effort, but if we then need to rebuild all compiled extension modules against this new-SDK-python then it is a problem. But please, present me with tangiable facts, reprodicuble failures and test-cases and I will look into this more. |
@mingwandroid A lot of this is documented already in the issues that are cross-referenced in #365. The main issue is that GUI elements do not update properly. You have to resize the application window or make the application lose focus in order for them to update. However, compiling python with a newer OS X SDK makes the issues go away. Here's one example I just tried that illustrates it. First, make a fresh conda environment and run this code: conda install -c conda-forge python=3.8 pyside2 Then, run this test.py script linked in one of the cross-referenced issues (note, they used pip there, but we are not using pip here), pasted below.
When you click the But then if you resize the window or make the window lose focus, it then updates: If we compile python on the machine using code like this (the machine has SDK 10.15 installed on it):
The issue goes away. |
Great, thanks for this. I'll study it carefully when I get Qt 5.15.0 packages built and a few other work bits. If a new python variant does fix this that's great, but I'd like to see if there is an easier way. |
@mingwandroid Thanks for taking a look at this. |
@mingwandroid I looked at this extensively, and this is the only way I found it can be fixed. It makes The reason is that OSX (or more specifically I've been investigating and trying to find a fix to make See also: |
Great. Thanks for all the references. As soon as I get a new conda build release done and a few other tasks I will lobby to give this my full attention. In general macOS needs some love! I'm on my phone, traveling so haven't looked at them yet. I'm not sure why dark mode needs to depend on the os version or if it's a good reason to bifurcate things here. The signals slots issue is serious though for sure. Do you think a test could be added to the pyqt recipe at conda-forge that captures this failure? |
Thanks @mingwandroid! The dark mode was mainly meant as an example. It's another thing that doesn't work currently due to the same problem, but I agree that it is much less severe. Looking at the pyqt OSX build, I don't see |
Maybe .. it could just be an oversight though. Qt apps should support the |
Hi! This is the friendly automated conda-forge-linting service. I was trying to look for recipes to lint for you, but it appears we have a merge conflict. Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug. |
Here is the list of symbols for the package: symbols.txt |
Is that |
@isuruf That is just the python executable. |
@mingwandroid just wanted to quickly check what the status is? |
On macOS Big Sur, Qt doesn't work at all anymore. See here: It seems that linking against this old, unsupported SDK breaks something to do with layer-backed and surface-backed views. So installing python from conda and running any PyQt/PySide2/... application now crashes on the newest mac OS. This PR would fix this issue as well, based on my testing. As written in the linked bug report:
|
@rggjan, so long as people with older OSes can still run things then fine. Different organizations and endeavours recommend different things for their own reasons.
I want those people who cannot afford new Apple hardware to continue to be able to perform data-science tasks within the Anaconda ecosystem. That is all. |
And I should say, this has always been a core feature of Anaconda, the ability to depend on it to continue running on your hardware for a reasonably long time. |
@mingwandroid Thanks for the comment. I don't want to start an old argument... I basically just wanted to let you know that:
|
@rggjan, I've been using this option lately in other packages and I'm open to do this. I checked and it looks like the autoconf script thinks |
You cannot just say "I don't want to start an old argument" then proceed to make argumentative points. You cannot break everybody else just so that your stuff works. As @isuruf said, we need to take care of these matters for our users. We cannot be so reckless. |
@mingwandroid, I don't see that as an argumentative point. Those 2 are facts and I'd like to add the 3rd point that this PR at its current state would break older macos version |
Sure thanks @isuruf, hopefully we can satisfy everyone's needs here. That is the end goal of course! |
@rggjan, if you'd be able to work on the option outlined by @isuruf, that'd be helpful because it seems to be a non-controversial solution to the immediate issue at hand which could probably be deployed right away (as opposed to figuring out first what newer restrictions we want to impose on the users' systems). (@mingwandroid, BTW we discussed when/why/how changing targeted minimum macOS versions in the last conda-forge/core meetings. If you're interested and schedule permits, I'd like to (voice) chat with you about this a bit. Please let me know if that'd be possible for you.) |
@mbargull Sure, ping me on gitter and we'll set something up. |
@rggjan, good news. cpython master now supports building using a newer SDK than the deployment target. See https://patch-diff.githubusercontent.com/raw/python/cpython/pull/22855.patch |
@cjh1, @rggjan, @mingwandroid, PTAL at gh-412 from @isuruf which addresses this (for the upcoming 3.9.1 December release). |
Well sounds fine if it works! |
Done in gh-412. |
How can we verify this worked? For me, PySide2 still crashes with
built 5 days ago. Also, looking at the binary with
and not the expected
|
Oh, I get it... this was for python 3.9.1 only. The necessary patches seem to be included in |
Are they? Can you give a reference? IIUC, upstream the patches have been ported to the 3.9 branch and are planned to be backported to 3.8 as well, though I couldn't see any reference to 3.7. |
Here: It says:
and bpo-41100 is also included in 3.7.9: But I'm not 100% sure... as you say, it doesn't seem to be explicitly mentioned... |
Ah, I see what you mean. Yes, all those changes reference bpo-41100. However, the ones that have been included in 3.7 earlier this year are only some of those that landed into 3.9.1 now and exclude the backwards compatibility patches. |
Oh I see, thanks for digging into this! |
Set WITH_LATEST_OSX_SDK so that the latest SDK is used.
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)Fixes #365
Some projects require newer versions of the OSX SDK to be used, even though the deployment target may be older. Qt is one of those cases, and using an older version of the OSX SDK to build Python, for instance,
is causing some bugs when used with PySide2.
The ability to do this was added recently in conda-forge/conda-forge-ci-setup-feedstock#106. This PR enables that functionality.