about summary refs log tree commit diff
path: root/pkgs/development/interpreters/spidermonkey
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-29 21:55:39 +0100
committerAlyssa Ross <hi@alyssa.is>2024-02-01 15:36:20 +0100
commitb33fd42c30f33774765990a9866ce8809f9fe810 (patch)
treefdd82c3f8b580fcbb58a97da487edc1917a24878 /pkgs/development/interpreters/spidermonkey
parentea81a2fe63fec576f9ea6862b078cdb31f609fd8 (diff)
pkgsMusl.spidermonkey: fix build on x86_64-linux
rustc 1.73.0 introduced a new x86_64-unikraft-linux-musl target.  This
triple is a bit of a lie — the kernel in this case is unikraft, which
isn't Linux, it just tries to be compatible with it.  But this
User-Agent-like string of a triple now exists, and with it comes some
fallout.

Spidermonkey asks rustc for the list of supported targets, then picks
the one that best matches the GNU triple it's building for, which in
the native case config.guess will say is x86_64-pc-linux-musl.  Prior
to rustc 1.73.0, all was well, because there was only one x86_64 musl
triple, but now there are two: x86_64-unknown-linux-musl, and
x86_64-unikraft-linux-musl, and neither of those are obviously closer
than the other to x86_64-pc-linux-musl to Spidermonkey's build system.
As a result, it can't decide which target to pass to rustc, and bails
out.

We can fix this by telling Spidermonkey what platform it should be
building for, rather than letting it guess, which previously we did
only when cross compiling.  This approach is already used in the
Firefox derivation (which is why it was not affected by the rustc
update), so it's been well tested already.

Closes: https://github.com/NixOS/nixpkgs/pull/266560
Closes: https://github.com/NixOS/nixpkgs/pull/282923
Diffstat (limited to 'pkgs/development/interpreters/spidermonkey')
-rw-r--r--pkgs/development/interpreters/spidermonkey/common.nix1
1 files changed, 0 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/spidermonkey/common.nix b/pkgs/development/interpreters/spidermonkey/common.nix
index ff9bb39e0a294..46af4ec26bbe5 100644
--- a/pkgs/development/interpreters/spidermonkey/common.nix
+++ b/pkgs/development/interpreters/spidermonkey/common.nix
@@ -125,7 +125,6 @@ stdenv.mkDerivation (finalAttrs: rec {
     "--disable-jemalloc"
     "--disable-strip"
     "--disable-tests"
-  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # Spidermonkey seems to use different host/build terminology for cross
     # compilation here.
     "--host=${stdenv.buildPlatform.config}"