Skip to content

pypy3{8,9}: fix sitePackages#217558

Merged
mweinelt merged 1 commit intoNixOS:masterfrom
winterqt:pypy3-fix-site-packages
Feb 26, 2023
Merged

pypy3{8,9}: fix sitePackages#217558
mweinelt merged 1 commit intoNixOS:masterfrom
winterqt:pypy3-fix-site-packages

Conversation

@winterqt
Copy link
Member

@winterqt winterqt commented Feb 21, 2023

Description of changes

When PyPy introduced Python 3.8 support with version 7.3.6, they also migrated to using CPython's directory layout 0:

The 3.8 package now uses the same layout as CPython, and many of the
PyPy-specific changes to sysconfig, distutils.sysconfig, and distutils.commands.install.py have been removed. The stdlib now is located in <base>/lib/pypy3.8 on posix systems...

When we upgraded past this version and added Python 3.8 support 1, the sitePackages value was never updated, leading bootstrapped-pip to fail to build, because wheel was trying to be located in $out/site-packages, when it was actually installed to $out/lib/pypy3.8/site-packages.

Fixes #150818.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 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
  • Fits CONTRIBUTING.md.

@winterqt winterqt requested a review from FRidh as a code owner February 21, 2023 20:18
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Feb 21, 2023
@ofborg ofborg bot requested a review from andersk February 21, 2023 20:46
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 21, 2023
@winterqt
Copy link
Member Author

@ofborg build pypy38Packages.pip pypy39Packages.pip

@pennae
Copy link
Contributor

pennae commented Feb 25, 2023

tested successfully on x86_64-linux

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

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

Great work fixing this!

Copy link
Member

Choose a reason for hiding this comment

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

should this if .... maybe be moved into the passthru.sitePackages?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that's possible in this context/how sitePackages is used throughout the tree?

When PyPy introduced Python 3.8 support with version 7.3.6, they also
migrated to using CPython's directory layout [0]:

> The 3.8 package now uses the same layout as CPython, and many of the
PyPy-specific changes to `sysconfig`, `distutils.sysconfig`, and
`distutils.commands.install.py` have been removed. The stdlib now is
located in `<base>/lib/pypy3.8` on `posix` systems...

When we upgraded past this version and added Python 3.8 support [1], the
`sitePackages` value was never updated, leading `bootstrapped-pip` to fail
to build, because wheel was trying to be located in `$out/site-packages`,
when it was actually installed to `$out/lib/pypy3.8/site-packages`.

[0]: https://www.pypy.org/posts/2021/10/pypy-v736-release.html
[1]: eec28b8
@winterqt winterqt force-pushed the pypy3-fix-site-packages branch from d011a4a to e4dd2b8 Compare February 25, 2023 18:44
@mweinelt mweinelt merged commit 6e78ac9 into NixOS:master Feb 26, 2023
@github-actions
Copy link
Contributor

Backport failed for release-22.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-22.11
git worktree add -d .worktree/backport-217558-to-release-22.11 origin/release-22.11
cd .worktree/backport-217558-to-release-22.11
git checkout -b backport-217558-to-release-22.11
ancref=$(git merge-base 4ef8ffa6c19935a8e2dc60ed01c882cf574352f1 e4dd2b8ca0269c0d283f4f74ccfe9bec082b3563)
git cherry-pick -x $ancref..e4dd2b8ca0269c0d283f4f74ccfe9bec082b3563

@FRidh FRidh mentioned this pull request Jun 28, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pypy3Packages.bootstrapped-pip fails to build

4 participants