Skip to content

python3.pkgs.pypaBuildHook: fix conflicts via propagated inputs#254547

Merged
Lassulus merged 1 commit intoNixOS:stagingfrom
DavHau:fix-pyproject-build
Sep 15, 2023
Merged

python3.pkgs.pypaBuildHook: fix conflicts via propagated inputs#254547
Lassulus merged 1 commit intoNixOS:stagingfrom
DavHau:fix-pyproject-build

Conversation

@DavHau
Copy link
Member

@DavHau DavHau commented Sep 11, 2023

Description of changes

This modifies the pypaBuildHook to not propagate its own python dependencies into the build environment. This prevents package conflicts in downstream projects whenever a package is built against other versions of the dependencies of the hook.

This problem was likely introduced by #248866

Done:

  • modify pypa-build-hook.sh to call pyproject-build via an absolute path. This removes the need of putting the dependencies inside the hook's propagatedBuildInputs
  • remove the hook's dependencies from propagatedBuildInputs
  • add a passthru test to the hook testing for the fix

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.11 Release Notes (or backporting 23.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.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Sep 11, 2023
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 8.has: clean-up This PR removes packages or removes other cruft labels Sep 11, 2023
@ofborg ofborg bot requested review from fabaff, mweinelt and tjni September 11, 2023 13:11
@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 Sep 11, 2023
@DavHau DavHau force-pushed the fix-pyproject-build branch from ff22f11 to 00cbe60 Compare September 12, 2023 18:22
This modifies the pypaBuildHook to not propagate its own python dependencies into the build environment. This prevents package conflicts.

- modify pypa-build-hook.sh to call pyproject-build via an absolute path. This removes the need of putting the dependencies inside the hook's propagatedBuildInputs
- remove the hook's dependencies from propagatedBuildInputs
- add a passthru test to the hook testing for the fix
@DavHau DavHau force-pushed the fix-pyproject-build branch from 00cbe60 to c57e6b6 Compare September 12, 2023 19:04
@Mic92
Copy link
Member

Mic92 commented Sep 13, 2023

cc @figsoda

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

I didn't deeply think about this but it does look good

@delroth delroth added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Sep 14, 2023
@Lassulus Lassulus merged commit 67b2f14 into NixOS:staging Sep 15, 2023
@DavHau DavHau deleted the fix-pyproject-build branch September 15, 2023 19:41
DavHau added a commit to DavHau/nixpkgs that referenced this pull request Jan 8, 2024
A follow up on NixOS#254547

As of now the hook still propagated `wheel` into the build environment which lead to a collision error as soon as any other version of wheel gets introduced as a dependency.

This makes the nixpkgs python infra more suitable for use with dynamic dependency versions like generated by 2nix tools.
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. 8.has: clean-up This PR removes packages or removes other cruft 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. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments