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

python: improve ABI name detection #210035

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Conversation

minijackson
Copy link
Member

Description of changes

This makes pkgsCross.ppc64.python3Packages.pip work again.

We somewhat recently changed the PPC64 arch to be powerpc64-unknown-linux-gnuabielfv2 with this ABI name as a way to differentiate between the ELFv1 and ELFv1 variant of PowerPC64. Python doesn't support this ABI name (which is expected), so I went and changed the mapping between nixpkgs' ABI names and Python's ABI names.

This basically use the ABI name as-is, if it is supported by Python, and will fallback to the "gnu" ABI if it is not supported.

This targets master as this shouldn't cause rebuilds for Tier 1, Tier 2, or Tier 3 architectures.

Pinging @NixOS/exotic-platform-maintainers and @FRidh

Things done
  • Tested platforms (by building python3Packages.pip:
    • x86_64-linux (cache hit)
    • pkgsCross.ppc64
    • pkgsCross.ppc64-musl
    • pkgsCross.raspberryPi
    • pkgsCross.aarch64-multiplatform
    • pkgsCross.gnu32
  • 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
    • Nothing to be built.
  • Tested basic functionality of all binary files (usually in ./result/bin/)
    • pip --version works for gnu32 cross
  • 23.05 Release Notes (or backporting 22.11 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@minijackson minijackson requested a review from FRidh as a code owner January 10, 2023 12:58
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jan 10, 2023
@sternenseemann
Copy link
Member

cc @amjoseph-nixpkgs

@FRidh
Copy link
Member

FRidh commented Jan 15, 2023

cc @pjjw

Copy link
Contributor

@pjjw pjjw left a comment

Choose a reason for hiding this comment

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

nice! thanks for doing a more complete sol'n.

@minijackson
Copy link
Member Author

Would it be also possible to backport this PR? I'd like to keep using stable for work, but I can't for the life of me figure out how to override the cross-compiled python, but not the native one.

@FRidh FRidh merged commit 2b43490 into NixOS:master Jan 19, 2023
@FRidh
Copy link
Member

FRidh commented Jan 19, 2023

With the backport label added a new PR targeting stable will be automatically opened.

@github-actions
Copy link
Contributor

Successfully created backport PR #211589 for release-22.11.

@minijackson minijackson deleted the fix-python-abi-name branch January 19, 2023 14:21
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

@lopsided98
Copy link
Contributor

This breaks in the case of musl on armv7l, because parsed.abi.name is musleabihf, which needs to be mapped to gnueabihf.

@ghost
Copy link

ghost commented Jul 2, 2023

musleabihf, which needs to be mapped to gnueabihf.

Seriously? Python calls all Linux platforms -gnu even if they don't use the GNU C Library?

I mean given the state of the Python ecosystem I'm willing to believe this, but it just sounds so totally crazy that I wanted to double-check. Is there some documentation of this weirdness somewhere?

@lopsided98
Copy link
Contributor

The only "documentation" I know of is the configure script: https://github.com/python/cpython/blob/e488e300f5c01289c10906c2e53a8e43d6de32d8/configure.ac#L724

@r-burns
Copy link
Contributor

r-burns commented Jul 2, 2023

There is some discussion about it in this thread: python/cpython#87278

@pjjw
Copy link
Contributor

pjjw commented Jul 2, 2023

yeah, looks like the "real" fix is stuck here: python/cpython#96001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants