From bf61b8c8fb677cd0414090d627afc27eeb944ed1 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Fri, 5 Jul 2024 19:40:13 +0300 Subject: [PATCH] lib.systems: Fix setting rust.platform.os for wasm32-unknown-unknown Previously we would fallback to using `kernel` as the `os` which would result in using the wrong `os` value (`none`) when actually we want `unknown`. This seems to be a special case for wasm32-unknown-unknown and wasm64-unknown-unknown so I extended the if statement to support it. --- lib/systems/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 074239b3fb6f..0b8aeda208e3 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -323,6 +323,7 @@ let os = /**/ if rust ? platform then rust.platform.os or "none" else if final.isDarwin then "macos" + else if final.isWasm && !final.isWasi then "unknown" # Needed for {wasm32,wasm64}-unknown-unknown. else final.parsed.kernel.name; # https://doc.rust-lang.org/reference/conditional-compilation.html#target_family