-
Notifications
You must be signed in to change notification settings - Fork 90
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
bbf7d3e
commit f21e944
Showing
4 changed files
with
77 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", "-ExecutionPolicy", "Bypass", "-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 = 'beddae8ff6830419b5d24d719a6ef1dd67a280fe8e799963b257467ffc205560'; ` | ||
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", "-ExecutionPolicy", "Bypass", "-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