diff --git a/.gitlab-ci/windows/Dockerfile_build b/.gitlab-ci/windows/Dockerfile_build index b74befeeb5c..f10460b62c6 100644 --- a/.gitlab-ci/windows/Dockerfile_build +++ b/.gitlab-ci/windows/Dockerfile_build @@ -2,8 +2,13 @@ FROM mcr.microsoft.com/windows/server:ltsc2022 +# https://www.thomasmaurer.ch/2019/07/how-to-install-and-update-powershell-7/ +# Wrapping the following command in cmd.exe +# iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet" +RUN powershell -ExecutionPolicy RemoteSigned -Command "$ErrorActionPreference = 'Stop'; iex ""& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI -Quiet""" + # Make sure any failure in PowerShell scripts is fatal -SHELL ["powershell", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"] +SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPreference = 'Stop';"] COPY mesa_deps_vs2019.ps1 C:\ RUN C:\mesa_deps_vs2019.ps1 diff --git a/.gitlab-ci/windows/README.md b/.gitlab-ci/windows/README.md index d934a222d5d..caf7c8f0b29 100644 --- a/.gitlab-ci/windows/README.md +++ b/.gitlab-ci/windows/README.md @@ -30,3 +30,7 @@ host, without Docker. The Mesa build runs inside the base container, executing `mesa_build.ps1`. This simply compiles Mesa using Meson and Ninja, executing the build and unit tests. Currently, no build artifacts are captured. + +## Using build scripts locally + +`*.ps1` scripts for building dockers are using PowerShell 7 to run