Skip to content

building: macOS: strip the signature off the collected Python shared library#5451

Merged
htgoebel merged 4 commits intopyinstaller:developfrom
rokm:macos-strip-signature
Jan 11, 2021
Merged

building: macOS: strip the signature off the collected Python shared library#5451
htgoebel merged 4 commits intopyinstaller:developfrom
rokm:macos-strip-signature

Conversation

@rokm
Copy link
Copy Markdown
Member

@rokm rokm commented Jan 5, 2021

Recent version of python on macOS have their Python shared library signed due to Gatekeeper requirements. Due to partial collection of content from the Python.framework, the copy of Python shared library that we bundle with frozen application ends up with its signature invalidated, and refuses to load regardless of Gatekeeper settings.

Manually stripping the (now invalid) signature using codesign --remove-signature fixes the problem, but can be performed
only with onedir builds. Therefore, we now attempt to detect the signature and automatically strip it away in order to accomodate
both onefile and onedir builds.

Fixes #5062.
Fixes #5272.
Fixes #5434.

rokm added 2 commits January 5, 2021 14:36
…library

Recent version of python on macOS have their Python shared library
signed due to Gatekeeper requirements. Due to partial collection of
content from the Python.framework, the copy of Python shared library
that we bundle with frozen application ends up with its signature
invalidated, and refuses to load regardless of Gatekeeper settings.

Manually stripping the (now invalid) signature using `codesign
--remove-signature` fixes the problem, but can be performed
only with `onedir` builds. Therefore, we now attempt to detect the
signature and automatically strip it away in order to accomodate
both `onefile` and `onedir` builds.
@rokm rokm marked this pull request as ready for review January 6, 2021 18:14
Copy link
Copy Markdown
Member

@htgoebel htgoebel left a comment

Choose a reason for hiding this comment

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

Thanks. Good catch

Comment thread PyInstaller/depend/dylib.py Outdated
Comment thread news/5451.feature.rst
Comment thread PyInstaller/depend/dylib.py Outdated
@rokm rokm requested a review from htgoebel January 8, 2021 16:11
@htgoebel
Copy link
Copy Markdown
Member

@rokm May I ask you to also clean up the commits when applying the requested reviews. Thiy would make miy live easier and avoid ugliy commits like 862a28e or 0334e09. Thanks.

(Yes, this might require to leave this limit, proprietary github platform.)

@htgoebel htgoebel merged commit de511a1 into pyinstaller:develop Jan 11, 2021
@htgoebel htgoebel added this to the PyInstaller 4.2 milestone Jan 11, 2021
@rokm
Copy link
Copy Markdown
Member Author

rokm commented Jan 11, 2021

@rokm May I ask you to also clean up the commits when applying the requested reviews. Thiy would make miy live easier and avoid ugliy commits like 862a28e or 0334e09. Thanks.

Sure, will do from now on.

It seemed that the policy was to squash all commits from a PR into a single one before merging it, so I've been leaving them as is. And I've been trying to avoid re-triggering CI for minor thins, such as news fragments and minor changes. But I agree that it looks ugly in commit history if merged directly.

(Yes, this might require to leave this limit, proprietary github platform.)

Oh, that's not a problem at all - I prefer local (interactive) rebases on command-line, anyway :-)

@htgoebel
Copy link
Copy Markdown
Member

to avoid re-triggering CI for minor things

I agree on this.

Looks like I've been to harsh, sorry. Yes, most times we squash, I just forgot this time. So it's my fault. sorry.

@rokm rokm deleted the macos-strip-signature branch January 28, 2021 17:54
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

3 participants