From 9ff71f97c885dd46c25dd5927ea24f3bcfd9e9bb Mon Sep 17 00:00:00 2001 From: Artturin Date: Tue, 11 Oct 2022 20:44:47 +0300 Subject: [PATCH] python-setup-hook: use buildPackages.callPackage to not change hashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this is just a hook so its safe without this change: we build a python3 for buildHost twice instead of only once while the result of the build is the same ``` nix-repl> pkgsCross.aarch64-multiplatform.python3.pythonForBuild «derivation /nix/store/5sx1ng86lxzggi33rchvq0z16ywkg11b-python3-3.10.7.drv» nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.python3 «derivation /nix/store/c5rlaqdfymd3j5v41rh98pjcv3dx3sh7-python3-3.10.7.drv» ``` ``` $ nix-diff $(getOutForDrv "/nix/store/5sx1ng86lxzggi33rchvq0z16ywkg11b-python3-3.10.7.drv") $(getOutForDrv "/nix/store/c5rlaqdfymd3j5v41rh98pjcv3dx3sh7-python3-3.10.7.drv") --environment - /nix/store/3fkwg2pypsxhydgwb9m7f1v5pcgfns6p-python3-3.10.7:{out} + /nix/store/wyhbl43ycqn43d08v5fqj1j6ynf7nz73-python3-3.10.7:{out} • The input derivation named `python-setup-hook.sh` differs - /nix/store/slvn39rh0l53c9czaf3g6a4awcj63j5r-python-setup-hook.sh.drv:{out} + /nix/store/bcjff6dn4gp7pf0knnja9ax4qrll78d5-python-setup-hook.sh.drv:{out} • The set of input source names do not match: - cross-file.conf • The input derivation named `stdenv-linux` differs - /nix/store/rsxsipgabvny0mc286j3vfpgaaaixdyz-stdenv-linux.drv:{out} + /nix/store/46ywpk0p6r22y502gi21xxghminy9lbj-stdenv-linux.drv:{out} • The set of input derivation names do not match: - hook + acl-2.3.1 + attr-2.5.1 + binutils-2.39 + binutils-wrapper-2.39 + ed-1.18 + expand-response-params + gcc-11.3.0 + gcc-wrapper-11.3.0 + glibc-2.35-163 + gmp-with-cxx-stage4-6.2.1 + libidn2-2.3.2 + libunistring-1.0 + linux-headers-5.19 + pcre-8.45 + zlib-1.2.12 • The set of input derivations named `bzip2-1.0.8` do not match • The set of input derivations named `xz-5.2.6` do not match • The environments do not match: + allowedRequisites=... defaultNativeBuildInputs='' ... '' • The environments do not match: cmakeFlags='' -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_HOST_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_PROCESSOR=x86_64 '' configureFlags='' --build=x86_64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu '' mesonFlags='' --cross-file=/nix/store/0d6bflf42rgrrxhp10visp67scqncd4g-cross-file.conf '' stdenv='' /nix/store/6ji09gqw12pnp3ylw3rrsd65f9vhhx89-stdenv-linux/nix/store/ykjm8yzjcwg2xpf640zh6jql5s8yimkp-stdenv-linux '' • The environments do not match: setupHook='' /nix/store/x6rrxsai11kl9gq29ipv0jn455admav3-python-setup-hook.sh/nix/store/h7z4wvlf7n23ir86nngjn9rpk1ygc7di-python-setup-hook.sh '' ``` --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7f75ae2d08e8..cc178cfc73e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15588,7 +15588,7 @@ with pkgs; update-python-libraries = callPackage ../development/interpreters/python/update-python-libraries { }; # Should eventually be moved inside Python interpreters. - python-setup-hook = callPackage ../development/interpreters/python/setup-hook.nix { }; + python-setup-hook = buildPackages.callPackage ../development/interpreters/python/setup-hook.nix { }; pythonDocs = recurseIntoAttrs (callPackage ../development/interpreters/python/cpython/docs {});