From 66eec65c5b4d76f7abb4c62c01ded419fb8d9aae Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Fri, 10 Jun 2022 00:14:11 +0800 Subject: [PATCH] ci/vs2019: switch to powershell 7 Signed-off-by: Yonggang Luo Reviewed-by: Jesse Natalie Part-of: --- .gitlab-ci/windows/Dockerfile_build | 7 ++++++- .gitlab-ci/windows/README.md | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/windows/Dockerfile_build b/.gitlab-ci/windows/Dockerfile_build index b74befeeb5cbb..f10460b62c612 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 d934a222d5d89..caf7c8f0b2965 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