Skip to content

mkPythonPackage, mkPythonApplication: handle passthru with stdenv.mkDerivation instead of lib.extendDerivation#347130

Merged
natsukium merged 1 commit intoNixOS:masterfrom
ShamrockLee:build-python-passthru
Oct 14, 2024
Merged

mkPythonPackage, mkPythonApplication: handle passthru with stdenv.mkDerivation instead of lib.extendDerivation#347130
natsukium merged 1 commit intoNixOS:masterfrom
ShamrockLee:build-python-passthru

Conversation

@ShamrockLee
Copy link
Contributor

The passthru specification of buildPythonPackage and buildPythonApplication was initially implemented via lib.extendDerivation instead of passing to stdenv.mkDerivation. In b9138b7 (as part of #271597), passthru is also passed down to mkDerivation, but the effect of lib.extendDerivation still shadows the passthru attributes from the result derivation returned by mkDerivation.

This PR simplifies the implementation and only passes passthru to mkDerivation but not to lib.extendDerivation. This change keeps the evaluation result unchanged but simplifies the code a bit.

Things done

  • Built on platform(s)
    • x86_64-linux (no rebuild)
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • 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.

@ShamrockLee ShamrockLee requested a review from natsukium as a code owner October 7, 2024 17:02
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Oct 7, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4655

@ShamrockLee
Copy link
Contributor Author

Result of nixpkgs-review pr 347130 run on x86_64-linux 1

@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 Oct 7, 2024
Copy link
Member

@natsukium natsukium left a comment

Choose a reason for hiding this comment

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

The issue was helpful in understanding why we should avoid using extendDerivation. Thanks for addressing this.

@natsukium natsukium merged commit 0a77110 into NixOS:master Oct 14, 2024
@ShamrockLee ShamrockLee deleted the build-python-passthru branch January 19, 2025 21:26
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: 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.

3 participants