diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 40125c429781d49..e25c057d34368f9 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -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.