diff --git a/.changes/cli.rs-fix-windows-x86.md b/.changes/cli.rs-fix-windows-x86.md new file mode 100644 index 000000000..e4c4833aa --- /dev/null +++ b/.changes/cli.rs-fix-windows-x86.md @@ -0,0 +1,5 @@ +--- +"cli.rs": patch +--- + +Fix `build` command when executed on a 32-bit Windows machine when pulling from the `binary-releases` repo. diff --git a/examples/api/src-tauri/Cargo.lock b/examples/api/src-tauri/Cargo.lock index 78e0f1d2d..11d1a0076 100644 --- a/examples/api/src-tauri/Cargo.lock +++ b/examples/api/src-tauri/Cargo.lock @@ -345,9 +345,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-rc.0" +version = "3.0.0-rc.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b70f999da60e6619a29b131739d2211ed4d4301f40372e94a8081422e9d6c7" +checksum = "967965e82fc46fee1a88147a7a977a66d615ed5f83eb95b18577b342c08f90ff" dependencies = [ "atty", "bitflags", @@ -1821,9 +1821,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "open" diff --git a/tooling/cli.rs/src/build.rs b/tooling/cli.rs/src/build.rs index 8992130a6..afa25bfdb 100644 --- a/tooling/cli.rs/src/build.rs +++ b/tooling/cli.rs/src/build.rs @@ -174,22 +174,17 @@ pub fn command(options: Options) -> Result<()> { // move merge modules to the out dir so the bundler can load it #[cfg(windows)] { - let arch = if let Some(t) = &options.target { - if t.starts_with("x86_64") { - "x86_64" - } else if t.starts_with('i') { - "x86" - } else if t.starts_with("arm") { - "arm" - } else if t.starts_with("aarch64") { - "aarch64" - } else { - panic!("Unexpected target triple {}", t) - } - } else if cfg!(target_arch = "x86") { - "x86" - } else { + let target = options.target.clone().unwrap_or_else(|| std::env::consts::ARCH.into()); + let arch = if target.starts_with("x86_64") { "x86_64" + } else if target.starts_with('i') || target.starts_with("x86") { + "x86" + } else if target.starts_with("arm") { + "arm" + } else if target.starts_with("aarch64") { + "aarch64" + } else { + panic!("Unexpected target architecture {}", target.split("_").next().unwrap()) }; let (filename, vcruntime_msm) = if arch == "x86" { let _ = std::fs::remove_file(out_dir.join("Microsoft_VC142_CRT_x64.msm"));