diff --git a/ci/windows-docker/Dockerfile b/ci/windows-docker/Dockerfile index a5247dbeb..00b27da61 100644 --- a/ci/windows-docker/Dockerfile +++ b/ci/windows-docker/Dockerfile @@ -13,10 +13,8 @@ RUN choco install -y pkgconfiglite nasm llvm openssl RUN setx PATH '%PATH%;C:\Program Files\NASM;C:\gst-install\bin' 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_dav1d.ps1 - -RUN Invoke-WebRequest -Uri https://win.rustup.rs/x86_64 -OutFile C:\rustup-init.exe -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 +RUN C:\install_rust.ps1 +RUN C:\install_cargo_utils.ps1 diff --git a/ci/windows-docker/install_cargo_utils.ps1 b/ci/windows-docker/install_cargo_utils.ps1 new file mode 100644 index 000000000..2dd87a4b4 --- /dev/null +++ b/ci/windows-docker/install_cargo_utils.ps1 @@ -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 diff --git a/ci/windows-docker/install_rust.ps1 b/ci/windows-docker/install_rust.ps1 new file mode 100644 index 000000000..9929e9516 --- /dev/null +++ b/ci/windows-docker/install_rust.ps1 @@ -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 +}