Skip to content

Commit

Permalink
lib.systems: fix rustTarget for WASI
Browse files Browse the repository at this point in the history
The corresponding Rust target name is "wasm32-wasi", not
"wasm32-unknown-wasi".
  • Loading branch information
oxalica committed Sep 30, 2024
1 parent 04efabb commit f84a72f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/systems/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,14 @@ let
}.${cpu.name} or cpu.name;
vendor_ = final.rust.platform.vendor;
# TODO: deprecate args.rustc in favour of args.rust after 23.05 is EOL.
in args.rust.rustcTarget or args.rustc.config
or "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}";
in
args.rust.rustcTarget or
args.rustc.config or (
# Rust uses `wasm32-wasi` rather than `wasm32-unknown-wasi`.
if final.isWasi
then "${cpu_}-wasi"
else "${cpu_}-${vendor_}-${kernel.name}${optionalString (abi.name != "unknown") "-${abi.name}"}"
);

# The name of the rust target if it is standard, or the json file
# containing the custom target spec.
Expand Down

0 comments on commit f84a72f

Please sign in to comment.