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 <adam@westernsemico.com>
Change-Id: I941fd8d6f3db4e249901772fd79321ad88cd9cc6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7107
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Adam Joseph 2022-10-27 15:06:32 -07:00 committed by clbot
parent 4d83fd84b4
commit 2502c0abef

View file

@ -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}")