Skip to content

Conversation

geofft
Copy link
Collaborator

@geofft geofft commented Aug 30, 2025

Closes #749.

@geofft geofft added platform:darwin Specific to the macOS platform python:3.13 build:debug labels Aug 30, 2025
@geofft geofft force-pushed the headerpad branch 2 times, most recently from f2e48e1 to efb67dd Compare August 31, 2025 19:40
@geofft geofft added platform:linux Specific to the Linux platform arch:x86_64 arch:aarch64 labels Aug 31, 2025
@geofft geofft marked this pull request as ready for review August 31, 2025 20:27
@geofft
Copy link
Collaborator Author

geofft commented Aug 31, 2025

Failing tests from previous run, as expected on x86_64 only:

Error: errors found
  error: python/install/lib/python3.13/lib-dynload/_ctypes_test.cpython-313d-darwin.so: Insufficient headerpad between end of load commands 0x648 and beginning of code 0x650
  error: python/install/lib/python3.13/lib-dynload/_tkinter.cpython-313d-darwin.so: Insufficient headerpad between end of load commands 0x658 and beginning of code 0x660

@geofft geofft requested review from zanieb and indygreg August 31, 2025 20:40
Copy link
Collaborator

@indygreg indygreg left a comment

Choose a reason for hiding this comment

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

This looks good.

What's also surprising about this is that usually segments are aligned on 4k or 16k boundaries. i.e. there's usually a significant gap between load commands and the next data.

And load commands are usually nowhere close to 4k in size.

Again, I'm surprised there isn't a sufficient gap for the code signature load command.

But surprised or not, having a static check to ensure existence of a gap keeps us honest and is necessary.

@geofft geofft merged commit 1b4757c into astral-sh:main Sep 2, 2025
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to code sign _tkinter library on x86 Mac version due to insufficient headerpad
2 participants