ci/windows-docker: Move rustup install into a ps1 script

We will need this in order to be able to add conditionals
depending on the rustc version, like we do on the linux
script.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1491>
This commit is contained in:
Jordan Petridis 2024-08-12 18:38:15 +03:00
parent 80d1066a20
commit 2061a4e310
3 changed files with 34 additions and 5 deletions

View file

@ -13,10 +13,8 @@ RUN choco install -y pkgconfiglite nasm llvm openssl
RUN setx PATH '%PATH%;C:\Program Files\NASM;C:\gst-install\bin' RUN setx PATH '%PATH%;C:\Program Files\NASM;C:\gst-install\bin'
ENV PKG_CONFIG_PATH="C:\gst-install\lib\pkgconfig" ENV PKG_CONFIG_PATH="C:\gst-install\lib\pkgconfig"
COPY install_gst.ps1 install_dav1d.ps1 C:\ COPY install_gst.ps1 install_dav1d.ps1 install_rust.ps1 install_cargo_utils.ps1 C:\
RUN C:\install_gst.ps1 RUN C:\install_gst.ps1
RUN C:\install_dav1d.ps1 RUN C:\install_dav1d.ps1
RUN C:\install_rust.ps1
RUN Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe RUN C:\install_cargo_utils.ps1
RUN C:\rustup-init.exe -y --profile minimal --default-toolchain $env:RUST_VERSION
RUN cargo install --locked cargo-c --version 0.9.22+cargo-0.72

View file

@ -0,0 +1,14 @@
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
rustup --version
rustc --version
cargo --version
cargo install --locked cargo-c --version 0.9.26+cargo-0.72
if (!$?) {
Write-Host "Failed to install cargo-c"
Exit 1
}
cargo-cbuild --version

View file

@ -0,0 +1,17 @@
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
$rustup_url = 'https://win.rustup.rs/x86_64'
Invoke-WebRequest -Uri $rustup_url -OutFile C:\rustup-init.exe
if (!$?) {
Write-Host "Failed to download rustup"
Exit 1
}
C:\rustup-init.exe -y --profile minimal --default-toolchain $env:RUST_VERSION
if (!$?) {
Write-Host "Failed to install rust"
Exit 1
}