macOS: robustify macOS assembly pipeline #6188
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two changes that make our assembly pipeline on macOS a bit more robust to bogus behavior of the
codesign
utility on 10.13 High Sierra (which is EOL at this point, but apparently still popular enough), and fix #6167.I think we can live without signature removal when modifying the headers of collected binaries regardless of macOS version, as forced re-sign should take care of invalidated signatures. If this was not the case, we'd probably be seeing issue reports on earlier versions of PyInstaller where users had to do re-signing themselves. So by skipping signature removal we avoid one call to
codesign
and one file resizing (which can be problematic on 10.13).The revised segment and section size computation is more direct, and allows us to compensate for oddities with 10.13 codesign when removing signature from bootloader executable. It is also more consistent with slice size adjustment that we do for fat binaries at the end of that function.