From 2502c0abefdf4c9ff0f2158cdd9d5e3f94d12ce6 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Thu, 27 Oct 2022 15:06:32 -0700 Subject: fix(tvix/eval): correct wasm32-unknown-unknown to wasm32-none Rustc uses wasm32-unknown-unknown, which is rejected by config.sub, for wasm-in-the-browser environments. Rustc should be using wasm32-unknown-none, which config.sub accepts. Hopefully the rustc people will change their triple before stabilising this triple. In the meantime, we fix it here in order to unbreak tvixbolt. https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/wasm32_unknown_unknown/index.html Signed-off-by: Adam Joseph Change-Id: I941fd8d6f3db4e249901772fd79321ad88cd9cc6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7107 Reviewed-by: tazjin Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/systems.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tvix/eval') diff --git a/tvix/eval/src/systems.rs b/tvix/eval/src/systems.rs index e06bf57e78..cfdbe2eed5 100644 --- a/tvix/eval/src/systems.rs +++ b/tvix/eval/src/systems.rs @@ -25,6 +25,17 @@ pub fn llvm_triple_to_nix_double(llvm_triple: &str) -> String { [_vendor, kernel, _environment] if is_second_coordinate(kernel) => kernel, [_vendor, kernel] if is_second_coordinate(kernel) => kernel, [kernel, _environment] if is_second_coordinate(kernel) => kernel, + + // Rustc uses wasm32-unknown-unknown, which is rejected by + // config.sub, for wasm-in-the-browser environments. Rustc + // should be using wasm32-unknown-none, which config.sub + // accepts. Hopefully the rustc people will change their + // triple before stabilising this triple. In the meantime, + // we fix it here in order to unbreak tvixbolt. + // + // https://doc.rust-lang.org/beta/nightly-rustc/rustc_target/spec/wasm32_unknown_unknown/index.html + ["unknown", "unknown"] if cpu == "wasm32" => "none", + _ => panic!("unrecognized triple {llvm_triple}"), }; format!("{cpu}-{os}") -- cgit 1.4.1