diff options
| author | Alyssa Ross <hi@alyssa.is> | 2023-11-17 20:21:33 +0100 |
|---|---|---|
| committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2023-11-24 11:22:00 +0000 |
| commit | 032a41d172cbca4511daf980c3808830a8664d1f (patch) | |
| tree | f17de14d20ad1c2150e9ed33001b60d8d34610cd | |
| parent | lib.systems.elaborate: fix passing `rust` (diff) | |
| download | nixpkgs-032a41d172cbca4511daf980c3808830a8664d1f.tar.gz | |
rustc-wasm32: fix targetPlatform
The previous version stopped working when we started elaborating Rust
metadata. Here, I've made it a bit nicer by actually setting
targetPlatform to an elaborated system. Setting the config to wasi to
get elaborate to understand it is a bit of a hack, but I think it's
less of a hack than what we had before.
The only actual difference this makes to the rustc-wasm32 derivation
compared to the previous working version, is that now crt-static is
set. This is probably the right thing anyway.
Fixes: e3e57b8f1885 ("lib.systems: elaborate Rust metadata")
(cherry picked from commit a578479a42a5d2033cc9fa77f236545f9bec5873)
| -rw-r--r-- | pkgs/top-level/all-packages.nix | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e13eb7086edf..0ffb457f28f9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16937,13 +16937,10 @@ with pkgs; # https://github.com/NixOS/nixpkgs/issues/89426 rustc-wasm32 = (rustc.override { stdenv = stdenv.override { - targetPlatform = stdenv.targetPlatform // { - parsed = { - cpu.name = "wasm32"; - vendor.name = "unknown"; - kernel.name = "unknown"; - abi.name = "unknown"; - }; + targetPlatform = lib.systems.elaborate { + # lib.systems.elaborate won't recognize "unknown" as the last component. + config = "wasm32-unknown-wasi"; + rust.config = "wasm32-unknown-unknown"; }; }; }).overrideAttrs (old: { |
