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.
This commit is contained in:
Ilan Joselevich 2024-07-05 19:40:13 +03:00
parent 1eb5e94d66
commit bf61b8c8fb
No known key found for this signature in database

View File

@ -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