From 2d393cc2cfed9ab9e3c8853a0a6f1c2052381f04 Mon Sep 17 00:00:00 2001 From: comp500 Date: Fri, 20 Jan 2023 06:21:29 +0000 Subject: [PATCH] rust, rustup: Use MSVC by default (#4224) --- bucket/rust-gnu.json | 40 ++++++++++++++++++++++++++++++++ bucket/rust-msvc.json | 8 +++++++ bucket/rust.json | 29 +++++++++++++++++------ bucket/rustup-gnu.json | 51 +++++++++++++++++++++++++++++++++++++++++ bucket/rustup-msvc.json | 5 ++-- bucket/rustup.json | 24 ++++++++++++------- 6 files changed, 140 insertions(+), 17 deletions(-) create mode 100644 bucket/rust-gnu.json create mode 100644 bucket/rustup-gnu.json diff --git a/bucket/rust-gnu.json b/bucket/rust-gnu.json new file mode 100644 index 0000000000..5931f9cd18 --- /dev/null +++ b/bucket/rust-gnu.json @@ -0,0 +1,40 @@ +{ + "version": "1.66.1", + "description": "A language empowering everyone to build reliable and efficient software. (GNU toolchain)", + "homepage": "https://www.rust-lang.org", + "license": "MIT|Apache-2.0", + "notes": "Use the rustup package instead for easier management of multiple toolchains, including beta/nightly releases.", + "architecture": { + "64bit": { + "url": "https://static.rust-lang.org/dist/rust-1.66.1-x86_64-pc-windows-gnu.msi", + "hash": "3535f1ed1582847d62dbcfb2a99d58ecce463bbbd1728283f4e01d8ef00ac225" + }, + "32bit": { + "url": "https://static.rust-lang.org/dist/rust-1.66.1-i686-pc-windows-gnu.msi", + "hash": "0622d2b7843b8af85077d50c0a587ad0b5ba09d69131a7ed6947dee7d42f3fcc" + } + }, + "extract_dir": "Rust", + "bin": [ + "bin\\rustc.exe", + "bin\\rustdoc.exe", + "bin\\cargo.exe" + ], + "checkver": { + "url": "https://www.rust-lang.org/", + "regex": "Version ([\\d.]+)" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://static.rust-lang.org/dist/rust-$version-x86_64-pc-windows-gnu.msi" + }, + "32bit": { + "url": "https://static.rust-lang.org/dist/rust-$version-i686-pc-windows-gnu.msi" + } + }, + "hash": { + "url": "$url.sha256" + } + } +} diff --git a/bucket/rust-msvc.json b/bucket/rust-msvc.json index d675b4976c..9787154a0d 100644 --- a/bucket/rust-msvc.json +++ b/bucket/rust-msvc.json @@ -3,6 +3,14 @@ "description": "A language empowering everyone to build reliable and efficient software. (MSVC toolchain)", "homepage": "https://www.rust-lang.org", "license": "MIT|Apache-2.0", + "notes": [ + "Use the rustup package instead for easier management of multiple toolchains, including beta/nightly releases.", + "According to https://doc.rust-lang.org/book/ch01-01-installation.html#installing-rustup-on-windows", + "Microsoft C++ Build Tools is needed and can be downloaded here: https://visualstudio.microsoft.com/visual-cpp-build-tools/", + "When installing build tools, these two components should be selected:", + "- MSVC - VS C++ x64/x86 build tools", + "- Windows SDK" + ], "architecture": { "64bit": { "url": "https://static.rust-lang.org/dist/rust-1.66.1-x86_64-pc-windows-msvc.msi", diff --git a/bucket/rust.json b/bucket/rust.json index b58eae6220..9787154a0d 100644 --- a/bucket/rust.json +++ b/bucket/rust.json @@ -1,16 +1,28 @@ { "version": "1.66.1", - "description": "A language empowering everyone to build reliable and efficient software. (GNU toolchain)", + "description": "A language empowering everyone to build reliable and efficient software. (MSVC toolchain)", "homepage": "https://www.rust-lang.org", "license": "MIT|Apache-2.0", + "notes": [ + "Use the rustup package instead for easier management of multiple toolchains, including beta/nightly releases.", + "According to https://doc.rust-lang.org/book/ch01-01-installation.html#installing-rustup-on-windows", + "Microsoft C++ Build Tools is needed and can be downloaded here: https://visualstudio.microsoft.com/visual-cpp-build-tools/", + "When installing build tools, these two components should be selected:", + "- MSVC - VS C++ x64/x86 build tools", + "- Windows SDK" + ], "architecture": { "64bit": { - "url": "https://static.rust-lang.org/dist/rust-1.66.1-x86_64-pc-windows-gnu.msi", - "hash": "3535f1ed1582847d62dbcfb2a99d58ecce463bbbd1728283f4e01d8ef00ac225" + "url": "https://static.rust-lang.org/dist/rust-1.66.1-x86_64-pc-windows-msvc.msi", + "hash": "847cb9fd3e3b62386cbd62be3fec0ab95b367637557437e9481e30d2ec38245b" }, "32bit": { - "url": "https://static.rust-lang.org/dist/rust-1.66.1-i686-pc-windows-gnu.msi", - "hash": "0622d2b7843b8af85077d50c0a587ad0b5ba09d69131a7ed6947dee7d42f3fcc" + "url": "https://static.rust-lang.org/dist/rust-1.66.1-i686-pc-windows-msvc.msi", + "hash": "f940015b31570bb2ab48c9839f64d65f2fc87b3d5fc6e806147554ee074c8cb8" + }, + "arm64": { + "url": "https://static.rust-lang.org/dist/rust-1.66.1-aarch64-pc-windows-msvc.msi", + "hash": "6512b7254efd3abc68915aeffbac57011fad6dfb3b4659eeca9bed6aff675443" } }, "extract_dir": "Rust", @@ -26,10 +38,13 @@ "autoupdate": { "architecture": { "64bit": { - "url": "https://static.rust-lang.org/dist/rust-$version-x86_64-pc-windows-gnu.msi" + "url": "https://static.rust-lang.org/dist/rust-$version-x86_64-pc-windows-msvc.msi" }, "32bit": { - "url": "https://static.rust-lang.org/dist/rust-$version-i686-pc-windows-gnu.msi" + "url": "https://static.rust-lang.org/dist/rust-$version-i686-pc-windows-msvc.msi" + }, + "arm64": { + "url": "https://static.rust-lang.org/dist/rust-$version-aarch64-pc-windows-msvc.msi" } }, "hash": { diff --git a/bucket/rustup-gnu.json b/bucket/rustup-gnu.json new file mode 100644 index 0000000000..011b099a12 --- /dev/null +++ b/bucket/rustup-gnu.json @@ -0,0 +1,51 @@ +{ + "version": "1.25.1", + "description": "Manage multiple rust installations with ease", + "homepage": "https://rustup.rs", + "license": "MIT|Apache-2.0", + "notes": "This package defaults to using the GCC toolchain on install/update; use \"rustup set default-host\" to configure it", + "architecture": { + "64bit": { + "url": "https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-pc-windows-msvc/rustup-init.exe", + "hash": "2220ddb49fea0e0945b1b5913e33d66bd223a67f19fd1c116be0318de7ed9d9c" + }, + "32bit": { + "url": "https://static.rust-lang.org/rustup/archive/1.25.1/i686-pc-windows-msvc/rustup-init.exe", + "hash": "79442f66a969a504febda49ee9158a90ad9e94913209ccdca3c22ef86d635c31" + } + }, + "installer": { + "script": [ + "[Environment]::SetEnvironmentVariable('CARGO_HOME', \"$persist_dir\\.cargo\", 'Process')", + "[Environment]::SetEnvironmentVariable('RUSTUP_HOME', \"$persist_dir\\.rustup\", 'Process')", + "$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", + "env_set": { + "CARGO_HOME": "$persist_dir\\.cargo", + "RUSTUP_HOME": "$persist_dir\\.rustup" + }, + "persist": [ + ".cargo", + ".rustup" + ], + "checkver": { + "url": "https://raw.githubusercontent.com/rust-lang-nursery/rustup.rs/master/Cargo.toml", + "regex": "version = \"([\\d.]+)\"" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://static.rust-lang.org/rustup/archive/$version/x86_64-pc-windows-msvc/rustup-init.exe" + }, + "32bit": { + "url": "https://static.rust-lang.org/rustup/archive/$version/i686-pc-windows-msvc/rustup-init.exe" + } + }, + "hash": { + "url": "$url.sha256" + } + } +} diff --git a/bucket/rustup-msvc.json b/bucket/rustup-msvc.json index 3eddc3f120..8ab93b5642 100644 --- a/bucket/rustup-msvc.json +++ b/bucket/rustup-msvc.json @@ -4,6 +4,8 @@ "homepage": "https://rustup.rs", "license": "MIT|Apache-2.0", "notes": [ + "This package defaults to using the MSVC toolchain in new installs; use \"rustup set default-host\" to configure it", + "(now equivalent to the rustup package)", "According to https://doc.rust-lang.org/book/ch01-01-installation.html#installing-rustup-on-windows", "Microsoft C++ Build Tools is needed and can be downloaded here: https://visualstudio.microsoft.com/visual-cpp-build-tools/", "When installing build tools, these two components should be selected:", @@ -24,8 +26,7 @@ "script": [ "[Environment]::SetEnvironmentVariable('CARGO_HOME', \"$persist_dir\\.cargo\", 'Process')", "[Environment]::SetEnvironmentVariable('RUSTUP_HOME', \"$persist_dir\\.rustup\", 'Process')", - "$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" + "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args @('-y', '--no-modify-path') | Out-Null" ] }, "env_add_path": ".cargo\\bin", diff --git a/bucket/rustup.json b/bucket/rustup.json index ff226db1f5..7dec4e8f27 100644 --- a/bucket/rustup.json +++ b/bucket/rustup.json @@ -3,22 +3,30 @@ "description": "Manage multiple rust installations with ease", "homepage": "https://rustup.rs", "license": "MIT|Apache-2.0", + "notes": [ + "This package defaults to using the MSVC toolchain in new installs; use \"rustup set default-host\" to configure it", + "(existing installs may be using the GNU toolchain by default)", + "According to https://doc.rust-lang.org/book/ch01-01-installation.html#installing-rustup-on-windows", + "Microsoft C++ Build Tools is needed and can be downloaded here: https://visualstudio.microsoft.com/visual-cpp-build-tools/", + "When installing build tools, these two components should be selected:", + "- MSVC - VS C++ x64/x86 build tools", + "- Windows SDK" + ], "architecture": { "64bit": { - "url": "https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-pc-windows-gnu/rustup-init.exe", - "hash": "f7367ca97f4b0e4d1f34181bcb68599099134c608bcf10257b4f64e6770395a6" + "url": "https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-pc-windows-msvc/rustup-init.exe", + "hash": "2220ddb49fea0e0945b1b5913e33d66bd223a67f19fd1c116be0318de7ed9d9c" }, "32bit": { - "url": "https://static.rust-lang.org/rustup/archive/1.25.1/i686-pc-windows-gnu/rustup-init.exe", - "hash": "e463cca92bd26e89c7ef79880e68309482cde3cc62f166a2d3c785ea9a09d7cd" + "url": "https://static.rust-lang.org/rustup/archive/1.25.1/i686-pc-windows-msvc/rustup-init.exe", + "hash": "79442f66a969a504febda49ee9158a90ad9e94913209ccdca3c22ef86d635c31" } }, "installer": { "script": [ "[Environment]::SetEnvironmentVariable('CARGO_HOME', \"$persist_dir\\.cargo\", 'Process')", "[Environment]::SetEnvironmentVariable('RUSTUP_HOME', \"$persist_dir\\.rustup\", 'Process')", - "$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" + "Invoke-ExternalCommand -Path \"$dir\\rustup-init.exe\" -Args @('-y', '--no-modify-path') | Out-Null" ] }, "env_add_path": ".cargo\\bin", @@ -37,10 +45,10 @@ "autoupdate": { "architecture": { "64bit": { - "url": "https://static.rust-lang.org/rustup/archive/$version/x86_64-pc-windows-gnu/rustup-init.exe" + "url": "https://static.rust-lang.org/rustup/archive/$version/x86_64-pc-windows-msvc/rustup-init.exe" }, "32bit": { - "url": "https://static.rust-lang.org/rustup/archive/$version/i686-pc-windows-gnu/rustup-init.exe" + "url": "https://static.rust-lang.org/rustup/archive/$version/i686-pc-windows-msvc/rustup-init.exe" } }, "hash": {