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

Passing arch to the nix install script and adjusting brew libs + use macos-14 to build if needed #277

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jmarrec
Copy link

@jmarrec jmarrec commented May 29, 2024

The commit descriptions provide more info.

@jmarrec jmarrec requested a review from a team as a code owner May 29, 2024 05:46
I cannot **link** to the resulting python dylib otherwise.
@mayeut
Copy link
Contributor

mayeut commented Jun 1, 2024

@jmarrec, why the change from always using universal2 installers on arm64 ?

Comment on lines -183 to +205
if (($this.Version -ge $PkgVersion) -or ($this.Architecture -eq "arm64")) {
if (($this.Version -ge $PkgVersion) -and ($this.Architecture -eq "x64")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm64 always uses the universal2 installer.
most of the changes here are not required if this stays the same.

@jmarrec
Copy link
Author

jmarrec commented Jun 1, 2024

I cannot properly link a c++ executable to it if using the universal installer.
Libpython.dylib reports mach-o x64

@mayeut
Copy link
Contributor

mayeut commented Jun 1, 2024

that seems like a different issue. universal2 installer provides dual arch (x86_64 & arm64). Do you have a repro for this ?

@jmarrec
Copy link
Author

jmarrec commented Jun 10, 2024

Not that simple to provide a MCVE, but I've experienced it in a (large) project that uses CMake and CPack for packaging, and which redistributes the python dylib.

Linking is ok, the issue is when executing it. It refuses to launch it due to code signature I think.

codesign --verify --deep --verbose Python
Python: invalid Info.plist (plist or signature have been modified)
In architecture: arm64

@jmarrec
Copy link
Author

jmarrec commented Jun 10, 2024

@mayeut here is a MCVE repro: https://github.com/jmarrec/test-Github-Actions/actions/runs/9446808318/job/26017370106

It's not impossible that this could be the issue: https://stackoverflow.com/questions/58997650/trying-to-codesign-a-mac-osx-app-but-when-i-check-it-i-get-pharo-app-invalid

The SO post mentions that codesign behaves differently when you have a library/exe that starts with an uppercase, and the resolved python library is Python in this case. And I think that lib is codesigned to begin with, while when you force build it isn't.

Anyways, the program links, but can't be executed.

https://github.com/jmarrec/test-Github-Actions/actions/runs/9446808318/job/26017370106#step:7:15

And the relevant build warning at https://github.com/jmarrec/test-Github-Actions/actions/runs/9446808318/job/26017246804#step:6:2196


And here is a run with my fork for setup-python, which uses my fork of python-versions where I force build the python package on mac

https://github.com/jmarrec/test-Github-Actions/actions/runs/9446912815

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 this pull request may close these issues.

2 participants