-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for GNU toolchain on Windows
- Loading branch information
1 parent
d0c7631
commit abe18c3
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# escape=` | ||
|
||
FROM mcr.microsoft.com/windows/servercore:1809 | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=1.50.0 | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/1.23.1/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = 'a586cf9de3e4aa791fd5796b6a5f99ca05591ccef8bb94e53af5b69f0261fb03'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-gnu; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# escape=` | ||
|
||
FROM mcr.microsoft.com/windows/servercore:%%WINDOWS-VERSION%% | ||
|
||
SHELL ["powershell.exe", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
ENV RUSTUP_HOME=C:\rustup ` | ||
CARGO_HOME=C:\cargo ` | ||
RUST_VERSION=%%RUST-VERSION%% | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; ` | ||
$url = 'https://static.rust-lang.org/rustup/archive/%%RUSTUP-VERSION%%/x86_64-pc-windows-msvc/rustup-init.exe'; ` | ||
$sha256 = '%%RUSTUP-SHA256%%'; ` | ||
Invoke-WebRequest -Uri $url -OutFile C:\rustup-init.exe; ` | ||
$actual256 = (Get-FileHash rustup-init.exe -Algorithm sha256).Hash; ` | ||
if ($actual256 -ne $sha256) { ` | ||
Write-Host 'FAILED!'; ` | ||
Write-Host ('expected: {0}' -f $sha256); ` | ||
Write-Host ('got: {0}' -f $actual256); ` | ||
exit 1; ` | ||
}; ` | ||
New-Item ${env:CARGO_HOME}\bin -type directory | Out-Null; ` | ||
$newPath = ('{0}\bin;{1}' -f ${env:CARGO_HOME}, ${env:PATH}); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Machine); ` | ||
[Environment]::SetEnvironmentVariable('PATH', $newPath, [EnvironmentVariableTarget]::Process); ` | ||
C:\rustup-init.exe -y -v --no-modify-path --default-toolchain ${env:RUST_VERSION} --default-host x86_64-pc-windows-gnu; ` | ||
Remove-Item C:\rustup-init.exe; ` | ||
rustup -V; ` | ||
cargo -V; ` | ||
rustc -V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters