Skip to content

python3Packages.cffi: fix tests on FreeBSD#329076

Merged
mweinelt merged 2 commits intoNixOS:stagingfrom
rhelmot:freebsd-cffi
Nov 18, 2024
Merged

python3Packages.cffi: fix tests on FreeBSD#329076
mweinelt merged 2 commits intoNixOS:stagingfrom
rhelmot:freebsd-cffi

Conversation

@rhelmot
Copy link
Contributor

@rhelmot rhelmot commented Jul 22, 2024

Description of changes

Followup to #328776, depends on #328943. See both for context.

I don't believe either of these changes are worth submitting upstream. One is modifying the existing patch to do what it claims to do and not just scoped to darwin, and one is just disabling a test. It's kind of a miracle that this is all it takes to pass tests, seeing as there are various comments to the effect of assuming that "anything that's not darwin or win32 must be linux and act exactly like linux". FreeBSD's libdl (the subject of the skipped test) claims to support dlopen, but it actually only has a stub, and if you want the real dlopen you have to link against libc, but you actually need the symbol from the dynamic loader? It's a bit of a mess and I want out of here.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • x86_64-freebsd
  • 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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jul 22, 2024
@rhelmot rhelmot added the 6.topic: bsd Running or building packages on BSD label Jul 22, 2024
@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Jul 22, 2024
@ofborg ofborg bot requested review from mweinelt and natsukium July 22, 2024 07:25
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 22, 2024
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

The first part, about the clang issue, should go in the commit message.

The second part, about the disabled test, should be a code comment.

@rhelmot rhelmot requested a review from Ericson2314 August 16, 2024 22:06
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 1, 2024
@rhelmot rhelmot force-pushed the freebsd-cffi branch 2 times, most recently from 16316b4 to 706ab52 Compare November 17, 2024 21:19
Copy link
Member

@mweinelt mweinelt left a comment

Choose a reason for hiding this comment

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

Please send this upstream.

@Ericson2314
Copy link
Member

I don't believe either of these changes are worth submitting upstream.

What @rhelmot wrote on this subject. Keep in mind we are modifying an existing not-upstreamed patch?

@Ericson2314
Copy link
Member

There is still a PR description that should be a commit message, however.

@rhelmot
Copy link
Contributor Author

rhelmot commented Nov 17, 2024

omg @Ericson2314 I am so sorry, I rebased the old version of the patch before I addressed your original review comments. They should be fixed now.

@mweinelt
Copy link
Member

@reckenrode @tjni @abathur Please upstream the patches that we currently have on cffi.

I'm not at all happy to keep them for years and maintain them downstream.

@reckenrode
Copy link
Contributor

darwin-use-libffi-closures.diff is a workaround for the old SDK on x86_64-darwin. It can be dropped for 25.05 since the default will be newer than 10.15.

clang-pointer-substraction-warning.diff can probably be dropped. Upstream addressed the issue in python-cffi/cffi#78.

@mweinelt
Copy link
Member

Okay, then we are back to reporting this issue and a potential patch upstream, before we choose to pick it downstream.

@rhelmot rhelmot force-pushed the freebsd-cffi branch 2 times, most recently from 69cea1f to b523436 Compare November 17, 2024 23:33
@emilazy
Copy link
Member

emilazy commented Nov 17, 2024

The patch isn’t actually specific to old SDK versions, it’s specific to using upstream libffi on macOS rather than Apple’s fork. Options include depending on darwin.libffi to just use the real thing, setting the -DFFI_AVAILABLE_APPLE compile flag, or just removing the condition upstream since https://groups.google.com/g/python-cffi/c/xU0Usa8dvhk seems lukewarm on that.

@emilazy
Copy link
Member

emilazy commented Nov 17, 2024

FWIW the postPatch stuff is obsolete.

@mweinelt mweinelt removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 18, 2024
@mweinelt mweinelt merged commit 7220e35 into NixOS:staging Nov 18, 2024
@mweinelt
Copy link
Member

Eval failures are unrelated.

@Ericson2314 Ericson2314 deleted the freebsd-cffi branch November 18, 2024 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: bsd Running or building packages on BSD 6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants