Skip to content

Commit

Permalink
pkgsMusl.spidermonkey: fix build on x86_64-linux
Browse files Browse the repository at this point in the history
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: #266560
Closes: #282923
  • Loading branch information
alyssais committed Feb 1, 2024
1 parent ea81a2f commit b33fd42
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkgs/development/interpreters/spidermonkey/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit b33fd42

Please sign in to comment.