Skip to content

Commit cd1549e

Browse files
committed
use msrustup when available
1 parent ebd6920 commit cd1549e

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

build.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,15 @@ function Find-LinkExe {
123123
}
124124
}
125125

126+
$channel = 'stable'
126127
if ($null -ne (Get-Command rustup -ErrorAction Ignore)) {
127128
$rustup = 'rustup'
129+
} elseif ($null -ne (Get-Command msrustup -ErrorAction Ignore)) {
130+
$rustup = 'msrustup'
131+
$channel = 'ms-stable'
132+
if ($architecture -eq 'current') {
133+
$env:MSRUSTUP_TOOLCHAIN = "$architecture"
134+
}
128135
} else {
129136
$rustup = 'echo'
130137
}
@@ -191,7 +198,7 @@ if ($architecture -eq 'current') {
191198
$target = Join-Path $PSScriptRoot 'bin' $configuration
192199
}
193200
else {
194-
& $rustup target add $architecture
201+
& $rustup target add --toolchain $channel $architecture
195202
$flags += '--target'
196203
$flags += $architecture
197204
$path = ".\target\$architecture\$configuration"
@@ -343,10 +350,10 @@ if (!$SkipBuild) {
343350
$binary = Split-Path $project -Leaf
344351

345352
if ($IsWindows) {
346-
Copy-Item "$path/$binary.exe" $target -ErrorAction Ignore
353+
Copy-Item "$path/$binary.exe" $target -ErrorAction Ignore -Verbose
347354
}
348355
else {
349-
Copy-Item "$path/$binary" $target -ErrorAction Ignore
356+
Copy-Item "$path/$binary" $target -ErrorAction Ignore -Verbose
350357
}
351358

352359
if (Test-Path "./copy_files.txt") {

0 commit comments

Comments
 (0)