From 87a8ef2b19e1e342264ce6983e591293f5bc577d Mon Sep 17 00:00:00 2001 From: Tao_eternal Date: Wed, 2 Feb 2022 22:09:25 +0800 Subject: [PATCH] rustup: Explicitly set toolchain host (#3269) * the host should be set to gnu compared to rustup-msvc, we should ensure the host to be `gnu` with this. * fix for 32bit user fix for 32bit user * Update rustup.json * clear pre-install move into install * also set for rustup-msvc * Update rustup.json * Apply suggestions from code review Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> --- bucket/rustup-msvc.json | 3 ++- bucket/rustup.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bucket/rustup-msvc.json b/bucket/rustup-msvc.json index e4d6b9e56a..f73a14a094 100644 --- a/bucket/rustup-msvc.json +++ b/bucket/rustup-msvc.json @@ -18,7 +18,8 @@ "script": [ "[Environment]::SetEnvironmentVariable('CARGO_HOME', \"$persist_dir\\.cargo\", 'Process')", "[Environment]::SetEnvironmentVariable('RUSTUP_HOME', \"$persist_dir\\.rustup\", 'Process')", - "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args '-y --no-modify-path' | Out-Null" + "$host_arch = if ($architecture -eq '64bit') {'x86_64'} else {'i686'}", + "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args \"-y --no-modify-path --default-host $host_arch-pc-windows-msvc\" | Out-Null" ] }, "env_add_path": ".cargo\\bin", diff --git a/bucket/rustup.json b/bucket/rustup.json index e4e388add0..1584613df5 100644 --- a/bucket/rustup.json +++ b/bucket/rustup.json @@ -18,7 +18,8 @@ "script": [ "[Environment]::SetEnvironmentVariable('CARGO_HOME', \"$persist_dir\\.cargo\", 'Process')", "[Environment]::SetEnvironmentVariable('RUSTUP_HOME', \"$persist_dir\\.rustup\", 'Process')", - "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args '-y --no-modify-path' | Out-Null" + "$host_arch = if ($architecture -eq '64bit') {'x86_64'} else {'i686'}", + "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args \"-y --no-modify-path --default-host $host_arch-pc-windows-gnu\" | Out-Null" ] }, "env_add_path": ".cargo\\bin",