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

python312Packages.cffi: remove unnecessary Darwin patch (attempt 2) #382404

Merged
merged 5 commits into from
Feb 17, 2025

Conversation

reckenrode
Copy link
Contributor

This PR updates the build of darwin.libffi to more closely match the way the system library is built, which should allow the Python cffi patch to be dropped.

Pinging @emilazy who worked on the previous attempt to drop it and @patryk4815 who reported #380786 (which is now closed, but that issue prompted the work on this PR). It would be good to know whether (the previous version of?) unicorn still exhibits the reported issue.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

This header contains availability annotations for libffi functions,
which some packages (such as Python’s) check to determine whether they
are building against Apple’s libffi fork.
@reckenrode
Copy link
Contributor Author

reckenrode commented Feb 15, 2025

I dropped the commit to build libffi-trampolines.dylib using an unwrapped clang. It doesn’t seem to matter.

I also checked the segments on the libffi-trampolines.dylib shipped with macOS 12.6, which predates ld-prime. It has the same ones that ld64 produces in this derivation.

Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

Looks great! Feel free to merge if you verified the python3Packages.cffi build.

Comment on lines +69 to +71
# Make sure Apple’s header with availability annotations is installed in place of the generated one.
# Use `macCatalyst` instead of `iosmac` to avoid errors due to invalid availability annotations.
substitute darwin/include/ffi.h "$dev/include/ffi.h" --replace-fail iosmac macCatalyst
Copy link
Member

Choose a reason for hiding this comment

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

By the way, is this an internal SDK difference or a bootstrap tools thing or what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The header that Apple ships uses macCatalyst, but the one in the source release uses iosmac. I assume they do some sort of post-processing when they build the SDK.

@reckenrode reckenrode merged commit d9ea73f into NixOS:staging Feb 17, 2025
27 checks passed
@reckenrode reckenrode deleted the push-ronxxroxsumq branch February 17, 2025 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants