[Windows] Apply code style rules to Windows scripts (#8957)

* Apply code style rules to Windows scripts

* Fix typo

* Fix configure-toolset script

* Fix parameters in Msys2 installation script

* Improve log readability

* Remove broken exit code validation
This commit is contained in:
Vasilii Polikarpov
2023-12-11 22:23:36 +01:00
committed by GitHub
parent 76d6f0f574
commit 7fe65a2204
54 changed files with 544 additions and 418 deletions

View File

@@ -19,6 +19,9 @@ Test-FileChecksum $rustupPath -ExpectedSHA256Sum $distributorFileHash
# Install Rust by running rustup-init.exe (disabling the confirmation prompt with -y)
& $rustupPath -y --default-toolchain=stable --profile=minimal
if ($LASTEXITCODE -ne 0) {
throw "Rust installation failed with exit code $LASTEXITCODE"
}
# Add %USERPROFILE%\.cargo\bin to USER PATH
Add-DefaultPathItem "%USERPROFILE%\.cargo\bin"
@@ -33,7 +36,14 @@ rustup target add x86_64-pc-windows-gnu
# Install common tools
rustup component add rustfmt clippy
if ($LASTEXITCODE -ne 0) {
throw "Rust component installation failed with exit code $LASTEXITCODE"
}
cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated
if ($LASTEXITCODE -ne 0) {
throw "Rust tools installation failed with exit code $LASTEXITCODE"
}
# Cleanup Cargo crates cache
Remove-Item "${env:CARGO_HOME}\registry\*" -Recurse -Force