Skip to content
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

Conda should use newer (the newest?) OSX SDK for building #67

Closed
rggjan opened this issue Dec 10, 2019 · 20 comments · Fixed by #106
Closed

Conda should use newer (the newest?) OSX SDK for building #67

rggjan opened this issue Dec 10, 2019 · 20 comments · Fixed by #106

Comments

@rggjan
Copy link

rggjan commented Dec 10, 2019

Please see the discussion here:
conda-forge/pyside2-feedstock#46 (comment)

Conda-forge currently builds against the OSX SDK 10.9. This causes issues for example with Qt + Pyside2, which requires both Qt and python to be built with OSX SDK 10.14 or 10.15.

I understand that Conda-forge builds against SDK 10.9 to be backwards compatible to that version of OSX. However, this is also possible with building against the newest SDK (10.15), and the setting the deployment target to a lower OSX version, like 10.9.

Here again the details:

Where did you read this? That's not how how SDKs work. You build with 10.12 and it will run on 10.14, not the other way around.

See on developer.apple.com:

It works both ways on OSX.

In the example of the link I posted, they build with base SDK 10.6 and run on 10.4 and newer. If the code doesn't use any of the newer API's (not existing in 10.6) this works out of the box. If the code wants to use new 10.5 or 10.6 API's on supported operating systems, the code must first check the OS version before using the API's. Which I guess Qt does, when they say on their official docs that compiling against the 10.14 SDK and then running on 10.12 works fine...

So Apple recommends always using the newest SDK, and then setting the Deployment target to the lowest OSX version you want to support...

@CJ-Wright
Copy link
Member

@scopatz
Copy link
Member

scopatz commented Dec 10, 2019

Yep, I believe that this is a duplicate

@isuruf
Copy link
Member

isuruf commented Dec 10, 2019

It's not. conda-forge/conda-forge.github.io#891 is about packages with a requirement on newer MACOSX_DEPLOYMENT_TARGET (like 10.12). This issue is about packages with a requirement of a newer SDK, but with the same lower MACOSX_DEPLOYMENT_TARGET (like 10.9) that uses weak linking.

@scopatz
Copy link
Member

scopatz commented Dec 10, 2019

In that case it seems like it should be moved to the conda-forge/conda-forge.github.io repo

@isuruf
Copy link
Member

isuruf commented Dec 10, 2019

This is where the code lives, but I'm fine with either.

@scopatz
Copy link
Member

scopatz commented Dec 10, 2019

Oh ok, nm

@rggjan
Copy link
Author

rggjan commented Feb 10, 2020

Is there any timeline on this issue? Any way I can help?

@isuruf
Copy link
Member

isuruf commented Mar 9, 2020

@rggjan, it looks like we can't enable this globally, but we can have an option to enable per feedstock. Issue is that most autotools based packages would check whether functions exist and using a newer SDK would make them available even if they are weak symbols. (For eg: clock_gettime is in 10.12, but autotools detects it even if target is set to 10.9 if the SDK is 10.12 or higher)

@rggjan
Copy link
Author

rggjan commented Mar 9, 2020

I see, thanks. That makes sense.

Would it be possible to enable it for the python feedstock? As this would fix the original issue of PySide2/Qt being broken?

Should I create a separate issue for this?

@isuruf
Copy link
Member

isuruf commented Mar 9, 2020

I suggest changing the logic at https://github.com/conda-forge/conda-forge-ci-setup-feedstock/blob/master/recipe/run_conda_forge_build_setup_osx#L9-L27 to use 10.15 as the SDK if there's a variable like WITH_LATEST_OSX_SDK instead of using MACOSX_DEPLOYMENT_TARGET for the SDK version. Then we can have that variable enabled in the python-feedstock.

@rggjan
Copy link
Author

rggjan commented Mar 12, 2020

Sounds like a good plan! However, it should be in addition to MACOSX_DEPLOYMENT_TARGET, I think. We might want to use the latest sdk, but still set MACOSX_DEPLOYMENT_TARGET to 10.9, for example, if we want the built executable to be able to run on OSX 10.9...

@rggjan
Copy link
Author

rggjan commented May 4, 2020

Any updates on this? Or is there at least a way to do the same as in bioconda/bioconda-recipes#21180 and use a newer SDK for python to fix conda-forge/pyside2-feedstock#46?

@isuruf
Copy link
Member

isuruf commented May 8, 2020

@rggjan, see my comment at #67 (comment). PRs are welcome.

psavery added a commit to psavery/conda-forge-ci-setup-feedstock that referenced this issue Jun 22, 2020
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](https://doc.qt.io/qt-5/macos.html),
and using an older version of the OSX SDK to build Python, for instance,
[is causing some bugs when used with PySide2](conda-forge#67).

Since Apple supports having an older deployment target while building
with a new SDK, default to the new SDK.

Signed-off-by: Patrick Avery <[email protected]>
@rggjan
Copy link
Author

rggjan commented Jul 27, 2020

Thanks a lot @psavery @isuruf!

What needs to happen to rebuild python 3.7 on OSX with these changes, so PySide2 actually works on OSX? (conda-forge/pyside2-feedstock#46)

(Sorry, I'm not very familiar with the conda CI / building pipeline)

@cjh1
Copy link
Contributor

cjh1 commented Jul 27, 2020

@rggjan I think we need to raise an issue with python-feedstock, to see if they are prepared to accept setting WITH_LATEST_OSX_SDK.

@psavery
Copy link
Contributor

psavery commented Jul 27, 2020

@rggjan I put up an issue for it on the python feedstock. It is conda-forge/python-feedstock#365

@rggjan
Copy link
Author

rggjan commented Jul 27, 2020

Perfect, thanks @psavery!

Would it make sense to do this for qt and/or PySide2 as well?

@cjh1
Copy link
Contributor

cjh1 commented Jul 27, 2020

I think PySide2 is already be build with a newer SDK.

@rggjan
Copy link
Author

rggjan commented Jul 28, 2020

@cjh1 How do you know?

@cjh1
Copy link
Contributor

cjh1 commented Jul 28, 2020

@rggjan May be not, I thought this one had been merged, but apparently is was closed. In our testing we only needed to rebuild python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants