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

python3Packages.cffi: fix tests on FreeBSD #329076

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from

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.

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.

@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
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.

6 participants