configureScript interpolates python.interpreter, which resolves to the
hostPlatform interpreter. When cross-compiling, that binary cannot be executed
on the build platform:
/nix/store/...-python3-aarch64-unknown-linux-musl-3.13.14/bin/python3.13:
cannot execute binary file: Exec format error
python is also listed in nativeBuildInputs, where splicing substitutes the
buildPackages variant. The previous python.executable was a bare basename, so
it resolved to that build-platform interpreter through PATH.
Use python.pythonOnBuildForHost.interpreter, which refers to the same
derivation that nativeBuildInputs puts on PATH. For native builds the value is
unchanged.
nodejs.nix currently creates configureScript with writeScript. This produces an
executable text file without a shebang, which configurePhase then runs as
$configureScript.
The wrapper only invokes configure.py through Python, so call configure.py
through python.interpreter directly instead. This avoids the shebang-less
wrapper path and stops relying on python.executable being resolved through
PATH.
Based on upstream's support list, only supported BE platforms are s390x-linux and ppc64-aix.
We don't have support for AIX in lib, and I don't know what the exact triplet for that would be, so it's not included here.
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
http-parser has been unmaintained for a long time, and is marked to only
be enabled with nodejs versions older than 11.4, which was released back
in 2018, and the 11.x series was made EOL around that same time.
Therefore, there is absolutely no need to keep this around.