Skip to content

python3.pkgs.setuptools-rust: adjust setupHook inclusion condition#480005

Merged
Aleksanaa merged 1 commit intoNixOS:stagingfrom
doronbehar:pkg/bcrypt--uboot
Jan 16, 2026
Merged

python3.pkgs.setuptools-rust: adjust setupHook inclusion condition#480005
Aleksanaa merged 1 commit intoNixOS:stagingfrom
doronbehar:pkg/bcrypt--uboot

Conversation

@doronbehar
Copy link
Contributor

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci 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. 6.topic: python Python is a high-level, general-purpose programming language. labels Jan 14, 2026
@doronbehar
Copy link
Contributor Author

BTW I'm surprised there are no rebuilds triggered. There are many packages that use setupttols-rust in their build-system...

@doronbehar
Copy link
Contributor Author

Aish I see this change breaks stage 3 cross compilation.. E.g:

nix build -Lf. pkgsCross.armv7l-hf-multiplatform.python3.pkgs.libcst

I'm putting this in draft.

@doronbehar doronbehar marked this pull request as draft January 14, 2026 11:36
@doronbehar doronbehar changed the title python3.pkgs.setuptools-rust: always set a correct setupHook python3.pkgs.setuptools-rust: adjust setupHook inclusion condition Jan 14, 2026
@doronbehar doronbehar marked this pull request as ready for review January 14, 2026 11:50
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 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: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. and removed 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 14, 2026
Commit e656303 (PR NixOS#467817) made
`setuptools-rust` work automatically in cross compilation scenarios by
replacing `setuptoolsRustBuildHook` with `setuptools-rust.setupHook`.
However it broke builds such as:

```sh
nix build -Lf. pkgsCross.armv7l-hf-multiplatform.buildPackages.python3.pkgs.cryptography
```

As reported here:

NixOS#467817 (comment)

This adjustment fixes the above build, while also maintaining the
following working:

```sh
nix build -Lf. pkgsCross.armv7l-hf-multiplatform.python3.pkgs.libcst
```
@doronbehar doronbehar changed the base branch from master to staging January 14, 2026 17:08
@nixpkgs-ci nixpkgs-ci bot closed this Jan 14, 2026
@nixpkgs-ci nixpkgs-ci bot reopened this Jan 14, 2026
@doronbehar
Copy link
Contributor Author

Now everything should be working. Waiting for your review @DavHau & @Aleksanaa .

@ElvishJerricco
Copy link
Contributor

This fixes #480467 though I can't say I understand why; whenever I see references to targetPlatform I suspect something is not quite right :P

(In particular for my use case, cross-compiled image.repart images rely on buildPackages.black at build time, which exhibits the bug)

@Aleksanaa Aleksanaa added this pull request to the merge queue Jan 16, 2026
Merged via the queue into NixOS:staging with commit 74c5b59 Jan 16, 2026
38 of 41 checks passed
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Jan 20, 2026
bcrypt was failing so backport

NixOS/nixpkgs#480005 until it lands in mainline

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
brianmcgillion added a commit to brianmcgillion/ghaf that referenced this pull request Jan 20, 2026
bcrypt was failing so backport

NixOS/nixpkgs#480005 until it lands in mainline

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
brianmcgillion added a commit to tiiuae/ghaf that referenced this pull request Jan 20, 2026
bcrypt was failing so backport

NixOS/nixpkgs#480005 until it lands in mainline

Signed-off-by: Brian McGillion <bmg.avoin@gmail.com>
@uninsane
Copy link
Contributor

This fixes #480467 though I can't say I understand why;

#476822 is the "real" issue here. e.g., the other fix for #480467 was to just axe the custom splicing logic from python packages and let lib.mkScopeWithSplicing do its job:

diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 13ede05bf2b7..ec88d1e72703 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -171,10 +171,9 @@ let
         attr:
         let
           python = attr.override (
-            inputs'
-            // {
+           {
               self = python;
-              __splices = splices;
             }
           );
         in

doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Jan 23, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
@doronbehar
Copy link
Contributor Author

#476822 is the "real" issue here.

Thanks for the link ! @alois31 should be aware that this PR should work-around the substantial issue presented there. And damn you are right @uninsane - what you suggested seems right and it fixes the issue too, while not even triggering any rebuilds! See:

This PR should be reverted if the above is accepted.

doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Jan 25, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Jan 25, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
@doronbehar
Copy link
Contributor Author

@Aleksanaa & @ElvishJerricco , I'd like to merge the PR that reverts this:

Before this PR reaches staging-next and master. I'm 99% sure #482866 is a more proper solution solution, and it targets master because it doesn't trigger too many rebuilds.

doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Jan 29, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Feb 2, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Feb 9, 2026
Fixes NixOS#476822 and NixOS#480467 . If merged, NixOS#480005 should be reverted (on
branch `staging`).

Co-Authored-By: Colin <colin@uninsane.org>
@doronbehar doronbehar deleted the pkg/bcrypt--uboot branch February 10, 2026 08:09
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: 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants