Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: don't use keep for hooks, so they will be spliced #228139

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Artturin
Copy link
Member

@Artturin Artturin commented Apr 25, 2023

See #211340 for prerequisite

wrapPython for some reason has to be not spliced because 'substitutions.pythonHost = python;' causes

error: output '/nix/store/li07bad6s9brxx7cf8j408631nca39ka-python3.10-chardet-5.1.0-aarch64-unknown-linux-gnu' is not allowed to refer to the following paths:
         /nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10

ericson said in #104201 (comment) that the reason they were in keep was to not splice them but before the commit which broke hook splicing (33d12e5) everything appeared to be working correctly when cross-compiling

Description of changes

experimenting with hook splicing fix @amjoseph-nixpkgs

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.

@Artturin Artturin requested a review from a user April 25, 2023 13:42
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Apr 25, 2023
@Artturin Artturin force-pushed the pythoncrossimprov branch 3 times, most recently from 26007de to ac0cf11 Compare July 24, 2023 20:41
@ofborg ofborg bot added 10.rebuild-linux: 1-10 10.rebuild-linux: 1 and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Jul 24, 2023
@Artturin Artturin marked this pull request as ready for review July 24, 2023 21:06
@Artturin Artturin added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jul 24, 2023
@Artturin
Copy link
Member Author

@Ericson2314 maybe made them not splice to work around #211340
image

$ nix build ".#pkgsCross.aarch64-multiplatform.itstool"
error:
       … while calling the 'derivationStrict' builtin

         at <nix/derivation-internal.nix>:9:12:

            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'itstool-aarch64-unknown-linux-gnu-2.0.6'
         whose name attribute is located at /home/artturin/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:300:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'itstool-aarch64-unknown-linux-gnu-2.0.6'

         at /home/artturin/nixgits/my-nixpkgs/pkgs/stdenv/generic/make-derivation.nix:344:7:

          343|       depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
          344|       nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
             |       ^
          345|       depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: makeWrapper/makeShellWrapper must be in nativeBuildInputs

@Artturin Artturin marked this pull request as draft July 25, 2023 02:13
Artturin added a commit to Artturin/nixpkgs that referenced this pull request Jul 26, 2023
`lib.extends hooks pythonPackagesFun` includes python which we want to
splice

what this fixes:
```
nix-repl> lib.elemAt pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs 0
«derivation /nix/store/39dkb51rciw6zwg0c2c44gpmpjapddxc-python3-aarch64-unknown-linux-gnu-3.10.12.drv»
```
to
```
nix-repl> lib.elemAt pkgsCross.aarch64-multiplatform.python3Packages.xpybutil.nativeBuildInputs 0
«derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»
```

Before NixOS#194205 The keep python used to work by accident because self was passed from
__splicedPackages https://github.com/NixOS/nixpkgs/pull/196052/files#diff-44ce3495c4f983ce64dd47c86a9d3e77bad210b2709c098a3806998dcd9b000bR213
But now it does not work because overrideAttrs is used on python in
python-packages-base.nix

Preferably we would [ splice the hooks too ](NixOS#228139) but we cannot do that until [Package sets within derivations (i.e. python3.pkgs) are not spliced](NixOS#211340) is fixed, because people often use `python3.pkgs.wrapPython` in `nativeBuildInputs` (it's correct but python3.pkgs should be python3Packages to get splicing.
@ghost
Copy link

ghost commented Jul 26, 2023

Let me be totally honest here, I'm trying to remove setup hooks from nixpkgs -- starting from the cc-wrapper and binutils-wrapper which is where this whole mess begins. #238069 is the first steps towards that.

The main reason why setup hooks exist is that there are pieces of data that get stuffed into $out/nix-support instead of in Nix attrsets. Once that happens, you can't branch/select/switch on those values at eval time (without IFD of course). When these values are used to compute other values, you get an "avalanche" of logic that gets forced out of the Nix eval language and into hideous gross piles of bash.

It turns out that 99% of this stuff is actually knowable at Eval time. But you have to stop the avalanche before it starts.

That is my mission.

With all that said, @Artturin I appreciate your heroic efforts to tame the bash-monster, and we need these efforts. I just wanted to explain why it's really hard for me to motivate myself to get a deep enough understanding of problems with this stuff on one hand when I'm putting a lot of effort into being able to get rid of it on the other.

It's also starting to look like I'm probably the only even-semi-qualified reviewer for a lot of this stuff. I will give it a try. Please keep pestering me.

I'm going to cherry-pick this into my local tree and rebuild my 100%-cross platforms (aarch64 and mips) overnight to see what breaks.

@FRidh
Copy link
Member

FRidh commented Jul 26, 2023

It turns out that 99% of this stuff is actually knowable at Eval time. But you have to stop the avalanche before it starts.

This is interesting. I've been wanting this as well, however, a big worry is that eval time increases.

E.g., with Python we still use propagated-build-inputs. We can get rid of that in two ways, either writing a custom file linking runtime deps, or keeping track of deps in eval only and writing references out when building an env.

@ghost
Copy link

ghost commented Jul 26, 2023

Addendum: the kicker starts with this commit, which isn't part of the PR I linked (but goes immediately on top of it). This commit does not eval, but it's sort of the first milestone I've been working towards:

keeping track of deps in eval only and writing references out when building an env

You definitely want to do this.

I've been wanting this as well, however, a big worry is that eval time increases.

Why would it though? The evaluator still has to instantiate all ancestral dependencies either way. So the number of derivations instantiated is the same either way; the only difference is whether the list is passed as lines in nix-support/propagated-build-inputs or as a Nix list.

It might make sense to "keep track of deps" using an attrset rather than a list though, since unioning n-many one-element attrsets is O(nlog n) (cppnix implements this by merging pre-sorted lists) but concatenating n-many one-element lists is O(n^2). Nevermind. In the truly, truly pathological case they're both O(n^2). However we can use the fact that attrsets are implemented as sorted lists (with binary search) to build better data structures; it just isn't automatic.

@ghost
Copy link

ghost commented Jul 26, 2023

This breaks eval for claws-mail (which I haven't actually used in over a year) but everything else was fine. Builds underway; I'll check back in the morning.

Built on:

  • aarch64-linux laptop packageset (cross from x86_64-linux)
  • mips64el-linux router packageset (cross from x86_64-linux)
    • abi=64 (stuff that uses rust, golang, and boost-context)
    • abi=n32 (everything else)

Edit: got up to firefox, chromium and qutebrowser (all three still building but I expect they will succeed) with only four failures. I'll diagnose those in the morning.

@ghost
Copy link

ghost commented Jul 26, 2023

Hrm, so my biggest concern is that #227902 no longer works in the presence of this PR. Also (and independently), qtwebengine no longer cross-compiles.

I'm digging to find out why.

Other fails are:

python-frozenlist
error: builder for '/nix/store/ci6hmcv0niclbd3vqrhr1zg19x9gq25b-python3.10-frozenlist-1.3.3-aarch64-unknown-linux-gnu.drv' failed with exit code 1;
       last 10 log lines:
       > patching sources
       > updateAutotoolsGnuConfigScriptsPhase
       > updateAutotoolsGnuConfigScriptsPhase
       > configuring
       > no configure script, doing nothing
       > building
       > Executing setuptoolsBuildPhase
       > /nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/bin/.cython-wrapped: /nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/bin/cython: line 3: syntax error near unexpected token `lambda'
       > /nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/bin/.cython-wrapped: /nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/bin/cython: line 3: `import sys;import site;import functools;sys.argv[0] = '/nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/bin/cython';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/g8m639c6973656mlg2xaiqh3b88grkbs-python3.10-cython-0.29.34/lib/python3.10/site-packages','/nix/store/ci5b14j87px5h2j83244qrdxzy9c89lc-python3-3.10.12/lib/python3.10/site-packages'], site._init_pathinfo());'
       > /nix/store/giycz6b15x39q4ffaabcjaimv3p57pis-stdenv-linux/setup: line 144: pop_var_context: head of shell_variables not a function context
aiosignal
error: 1 dependencies of derivation '/nix/store/h0s4w0dymgg3sq2qymk9xk1qfjdalj0h-python3.10-aiosignal-1.3.1-aarch64-unknown-linux-gnu.drv' failed to build
error: build of '/nix/store/wxibxw134xjkgrqxyak7llqialpm8m5a-python3.10-webencodings-0.5.1.drv' on 'ssh://[email protected]' failed: builder for '/nix/store/wxibxw134xjkgrqxyak7llqialpm8m5a-python3.10-webencodings-0.5.1.drv' failed with exit code 2
error: builder for '/nix/store/wxibxw134xjkgrqxyak7llqialpm8m5a-python3.10-webencodings-0.5.1.drv' failed with exit code 1;
       last 10 log lines:
       > patching script interpreter paths in /nix/store/7158a4001i2spia03v71jx88nkaavnkl-python3.10-webencodings-0.5.1
       > stripping (with command strip and flags -S -p) in  /nix/store/7158a4001i2spia03v71jx88nkaavnkl-python3.10-webencodings-0.5.1/lib
       > shrinking RPATHs of ELF executables and libraries in /nix/store/4qnpss02qlvap8ifwhk0s90nnn8y3s2l-python3.10-webencodings-0.5.1-dist
       > checking for references to /build/ in /nix/store/4qnpss02qlvap8ifwhk0s90nnn8y3s2l-python3.10-webencodings-0.5.1-dist...
       > patching script interpreter paths in /nix/store/4qnpss02qlvap8ifwhk0s90nnn8y3s2l-python3.10-webencodings-0.5.1-dist
       > Executing pythonRemoveTestsDir
       > Finished executing pythonRemoveTestsDir
       > running install tests
       > /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/.py.test-wrapped: /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/py.test: line 3: syntax error near unexpected token `lambda'
       > /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/.py.test-wrapped: /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/py.test: line 3: `import sys;import site;import functools;sys.argv[0] = '/nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/py.test';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/lib/python3.10/site-packages','/nix/store/fb1wnff0hgr0spxg3nrqyyrav748djcy-python3.10-attrs-22.2.0/lib/python3.10/site-packages','/nix/store/ci5b14j87px5h2j83244qrdxzy9c89lc-python3-3.10.12/lib/python3.10/site-packages','/nix/store/fmh8m17gz5sv22924wzyscmq6sjnvi0m-python3.10-iniconfig-2.0.0/lib/python3.10/site-packages','/nix/store/gfikmbv231cw767abgwym6bilpw2zqh4-python3.10-packaging-23.0/lib/python3.10/site-packages','/nix/store/yswzkw3s0qrycx66hr9265m4m6z8fja2-python3.10-pluggy-1.0.0/lib/python3.10/site-packages','/nix/store/yab91szh63mkj5mdf6xzp2x95fdl8sz8-python3.10-py-1.11.0/lib/python3.10/site-packages','/nix/store/j46b4k3z06djd451x4arkwy6b408vpyf-python3.10-tomli-2.0.1/lib/python3.10/site-packages','/nix/store/4q783kasfnf7b22rlhka87bjqqghwaxs-python3.10-exceptiongroup-1.1.0/lib/python3.10/site-packages'], site._init_pathinfo());'
python-flaky
error: build of '/nix/store/h3k4r2dbpb7jvl37b2yndv9jsc4agdam-python3.10-flaky-3.7.0.drv' on 'ssh://[email protected]' failed: builder for '/nix/store/h3k4r2dbpb7jvl37b2yndv9jsc4agdam-python3.10-flaky-3.7.0.drv' failed with exit code 2
error: builder for '/nix/store/h3k4r2dbpb7jvl37b2yndv9jsc4agdam-python3.10-flaky-3.7.0.drv' failed with exit code 1;
       last 10 log lines:
       > patching script interpreter paths in /nix/store/gz768x9yvp10n8lk4hd50zggz9dybi7h-python3.10-flaky-3.7.0
       > stripping (with command strip and flags -S -p) in  /nix/store/gz768x9yvp10n8lk4hd50zggz9dybi7h-python3.10-flaky-3.7.0/lib
       > shrinking RPATHs of ELF executables and libraries in /nix/store/jlqmcqkr120m45hd2q9f8kwnvkpjl8ay-python3.10-flaky-3.7.0-dist
       > checking for references to /build/ in /nix/store/jlqmcqkr120m45hd2q9f8kwnvkpjl8ay-python3.10-flaky-3.7.0-dist...
       > patching script interpreter paths in /nix/store/jlqmcqkr120m45hd2q9f8kwnvkpjl8ay-python3.10-flaky-3.7.0-dist
       > Executing pythonRemoveTestsDir
       > Finished executing pythonRemoveTestsDir
       > running install tests
       > /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/.pytest-wrapped: /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/pytest: line 3: syntax error near unexpected token `lambda'
       > /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/.pytest-wrapped: /nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/pytest: line 3: `import sys;import site;import functools;sys.argv[0] = '/nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/bin/pytest';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/nlhs8d6nrdzk4kqv173gzj0igb0j7ikk-python3.10-pytest-7.2.1/lib/python3.10/site-packages','/nix/store/fb1wnff0hgr0spxg3nrqyyrav748djcy-python3.10-attrs-22.2.0/lib/python3.10/site-packages','/nix/store/ci5b14j87px5h2j83244qrdxzy9c89lc-python3-3.10.12/lib/python3.10/site-packages','/nix/store/fmh8m17gz5sv22924wzyscmq6sjnvi0m-python3.10-iniconfig-2.0.0/lib/python3.10/site-packages','/nix/store/gfikmbv231cw767abgwym6bilpw2zqh4-python3.10-packaging-23.0/lib/python3.10/site-packages','/nix/store/yswzkw3s0qrycx66hr9265m4m6z8fja2-python3.10-pluggy-1.0.0/lib/python3.10/site-packages','/nix/store/yab91szh63mkj5mdf6xzp2x95fdl8sz8-python3.10-py-1.11.0/lib/python3.10/site-packages','/nix/store/j46b4k3z06djd451x4arkwy6b408vpyf-python3.10-tomli-2.0.1/lib/python3.10/site-packages','/nix/store/4q783kasfnf7b22rlhka87bjqqghwaxs-python3.10-exceptiongroup-1.1.0/lib/python3.10/site-packages'], site._init_pathinfo());'
       For full logs, run 'nix log /nix/store/h3k4r2dbpb7jvl37b2yndv9jsc4agdam-python3.10-flaky-3.7.0.drv'.
python3-cryptography
error: builder for '/nix/store/k9wrb5z6gnj5xiymdjs6pzwlkq746ss7-python3.10-cryptography-40.0.1-aarch64-unknown-linux-gnu.drv' failed with exit code 1;
       last 10 log lines:
       >     Python: 3.10.12
       >     platform: Linux-5.15.82-x86_64-with-glibc2.37
       >     pip: 23.0.1
       >     setuptools: 67.4.0.post0
       >     setuptools_rust: 1.5.2
       >     rustc: 1.70.0 (90c541806 2023-05-31) (built from a source tarball)
       >     =============================DEBUG ASSISTANCE=============================
       >
       > error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --target x86_64-unknown-linux-gnu --release -v --features 'pyo3/abi3-py36 pyo3/extension-module' -- --crate-type cdylib` failed with code 101
       > /nix/store/giycz6b15x39q4ffaabcjaimv3p57pis-stdenv-linux/setup: line 1596: pop_var_context: head of shell_variables not a function context
       For full logs, run 'nix log /nix/store/k9wrb5z6gnj5xiymdjs6pzwlkq746ss7-python3.10-cryptography-40.0.1-aarch64-unknown-linux-gnu.drv'.

@Artturin
Copy link
Member Author

useful
nix-diff $(nix eval --raw "nixpkgs/$(git merge-base staging HEAD)#pkgsCross.aarch64-multiplatform.python3Packages.frozenlist.drvPath") $(nix eval --raw ".#pkgsCross.aarch64-multiplatform.python3Packages.frozenlist.drvPath")

@Artturin
Copy link
Member Author

python3Packages.cryptography cross will be fixed by #212795, so not a regression

the other 3 build on #245475 so i'm going to merge that pr

@wegank wegank added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 2.status: merge conflict This PR has merge conflicts with the target branch labels Mar 19, 2024
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 4, 2024
as far as i can see there should be no reason to not splice the hooks

wrapPython for some reason has to be not spliced because 'substitutions.pythonHost = python;' causes
```
error: output '/nix/store/li07bad6s9brxx7cf8j408631nca39ka-python3.10-chardet-5.1.0-aarch64-unknown-linux-gnu' is not allowed to refer to the following paths:
         /nix/store/fdqpyj613dr0v1l1lrzqhzay7sk4xg87-python3-3.10.10
```

ericson said in NixOS#104201 (comment) that the reason they were in keep was to not splice them but before the commit which broke hook splicing (33d12e5) everything appeared to be working correctly when cross-compiling

we also somehow get a correctly spliced python in nativeBuildInputs for free
Using __spliced is the easiest (maybe only) way to get the correct python here.

wrapPython goes in nativeBuildInputs.

By adding `substitutions.python1 = python;` to wrap-python.nix we can
see that hostHost contains a python for aarch64 but not hostTarget for
some reason.

```
nix-repl> p = lib.elemAt pkgsCross.aarch64-multiplatform.__splicedPackages.python3Packages.chardet.nativeBuildInputs 1
nix-repl> p.python1.__spliced
{ buildBuild = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; buildHost = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; buildTarget = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; hostHost = «derivation /nix/store/39dkb51rciw6zwg0c2c44gpmpjapddxc-python3-aarch64-unknown-linux-gnu-3.10.12.drv»; hostTarget = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; }

```
For whatever reason after 1 year `targetTarget` now contains cross
python while in the previous commit (commit msg from it)

By adding `substitutions.python1 = python;` to wrap-python.nix we can
see that hostHost contains a python for aarch64 but not hostTarget for
some reason.

```
nix-repl> p = lib.elemAt pkgsCross.aarch64-multiplatform.__splicedPackages.python3Packages.chardet.nativeBuildInputs 1
nix-repl> p.python1.__spliced
{ buildBuild = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; buildHost = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; buildTarget = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; hostHost = «derivation /nix/store/39dkb51rciw6zwg0c2c44gpmpjapddxc-python3-aarch64-unknown-linux-gnu-3.10.12.drv»; hostTarget = «derivation /nix/store/21ldw2dp26xvv9iyxn9x77a8yh4waqz5-python3-3.10.12.drv»; }

```

NOW

nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.python3Packages.wrapPython.python1.__spliced
{
  buildBuild = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  buildHost = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  buildTarget = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  hostHost = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  hostTarget = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  targetTarget = «derivation /nix/store/iqjs63kixgafzs41jkc8m8gizvjwl1lh-python3-aarch64-unknown-linux-gnu-3.12.5.drv»;
}

note that previously there wasn't even a `targetTarget`
fixes

```
python3.12-packaging> /nix/store/wk4c4cjrrssz3vrq3pxh04wmzd3d93y6-python-runtime-deps-check-hook.sh/nix-support/setup-hook: line 11: /nix/store/vc4xlrlswjpwfjcd1f018ykpdd3rla8i-python3-aarch64-unknown-linux-gnu-3.12.5/bin/python3.12: cannot execute binary file: Exec format error
```

`.override` discards splicing
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 15, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 1 labels Sep 15, 2024
@Artturin Artturin mentioned this pull request Sep 15, 2024
13 tasks
`wrap-python.nix`

```
passthru = {
  python1 = python;
};
```

```
nix-repl> p = lib.elemAt pkgsCross.aarch64-multiplatform.flashfocus.nativeBuildInputs 1

nix-repl> p.python1.__spliced
{
  buildBuild = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  buildHost = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  buildTarget = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
  hostHost = «derivation /nix/store/iqjs63kixgafzs41jkc8m8gizvjwl1lh-python3-aarch64-unknown-linux-gnu-3.12.5.drv»;
  hostTarget = «derivation /nix/store/5k1b6g2qgy2a7kiis6snyidzryz6bljl-python3-3.12.5.drv»;
}

```
doesn't work

`pkgsCross.aarch64-multiplatform.flashfocus`

```
> /nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/bin/.pyproject-build-wrapped: /nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/bin/pyproject-build: line 3: syntax error near unexpected token `lambda'
       > /nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/bin/.pyproject-build-wrapped: /nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/bin/pyproject-build: line 3: `import sys;import site;import functools;sys.argv[0] = '/nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/bin/pyproject-build';functools.reduce(lambda k, p: site.addsitedir(p, k), ['/nix/store/lxmqqrafnjnjkdplvsk2yy6fx5f5g00z-python3.12-build-1.2.1/lib/python3.12/site-packages','/nix/store/gmldyqksmb8m3q55r89plzl69i2hpn1z-python3.12-packaging-24.1/lib/python3.12/site-packages','/nix/store/h3i0acpmr8mrjx07519xxmidv8mpax4y-python3-3.12.5/lib/python3.12/site-packages','/nix/store/85r0faqh44wfff7250qxad4iif2kng05-python3.12-pyproject-hooks-1.0.0/lib/python3.12/site-packages'], site._init_pathinfo());'
       For full logs, run 'nix log /nix/store/dcygh555yx6sqzqrlnnd0xdq1bflycsk-python3.12-setuptools-72.1.0.drv'.
error: builder for '/nix/store/4mzla40czanjwsg3swqgviyzc342j1mq-python3.12-typing-extensions-4.12.2.drv' failed with exit code 2;
```
@Artturin
Copy link
Member Author

Artturin commented Sep 15, 2024

Yeah idk what's going on, doesn't work

hostHost not always correct, maybe the conditional needs tweaking

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: python 10.rebuild-darwin: 11-100 10.rebuild-linux: 101-500 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants