Skip to content

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

Closed
jmarrec wants to merge 5 commits into
actions:mainfrom
jmarrec:passing_arch
Closed

jmarrec wants to merge 5 commits into
actions:mainfrom
jmarrec:passing_arch

Conversation

@jmarrec

@jmarrec jmarrec commented May 29, 2024 •

Copy link
Copy Markdown

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

mayeut commented Jun 1, 2024

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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

jmarrec commented Jun 1, 2024

Copy link
Copy Markdown
Author

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

@mayeut

mayeut commented Jun 1, 2024

Copy link
Copy Markdown
Contributor

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

@jmarrec

jmarrec commented Jun 10, 2024

Copy link
Copy Markdown
Author

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

jmarrec commented Jun 10, 2024

Copy link
Copy Markdown
Author

@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

@v-priya-kinthali

Copy link
Copy Markdown
Contributor

Hello @jmarrec👋,
Thank you for your contribution! We’re closing this PR since the changes proposed here are already covered and merged via PRs #274, #317 and #324.

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.

3 participants