ci/windows: Improve ci scripts

Remove more generated files
deps are removed
args need to be quoted.

Add example to run mesa_vs docker image

pass args to choose MSVC version properly

Add EXTRA_MESON_ARGS for meson configure

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37210>
This commit is contained in:
Yonggang Luo 2025-08-15 17:21:52 +08:00 committed by Marge Bot
parent 692f20499a
commit cdaa68cf81
5 changed files with 15 additions and 5 deletions

View file

@ -15,5 +15,4 @@ COPY mesa_deps_build.ps1 C:\
RUN C:\mesa_deps_build.ps1 RUN C:\mesa_deps_build.ps1
# When building, `--isolation=process` can leverage all cores and memory # When building, `--isolation=process` can leverage all cores and memory
# docker build --isolation=process -f .\Dockerfile_build -t mesa_dep --build-arg base_image=mesa_vs . # docker build --isolation=process -f .\Dockerfile_build -t mesa_dep --build-arg base_image=mesa_msvc .

View file

@ -23,5 +23,8 @@ RUN C:\mesa_deps_choco.ps1
# since the resulting container will want to be used that way be later containers in the build process. # since the resulting container will want to be used that way be later containers in the build process.
# Only --isolation=hyperv can succeed building this container locally, # Only --isolation=hyperv can succeed building this container locally,
# --isolation=process have network issue when installing Visual Studio and choco will crash # --isolation=process have network issue when installing Visual Studio and choco will crash
# docker build --isolation=hyperv -f .\Dockerfile_msvc -t mesa_vs --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" . # docker build --isolation=hyperv -f .\Dockerfile_msvc -t mesa_msvc --build-arg base_image="mcr.microsoft.com/windows:10.0.19041.1415" .
# Example run:
# docker run --isolation=hyperv -it --rm -v ${PWD}:${PWD} mesa_msvc pwsh -ExecutionPolicy RemoteSigned
# docker run --isolation=process -it --rm -v ${PWD}:${PWD} mesa_msvc pwsh -ExecutionPolicy RemoteSigned

View file

@ -29,8 +29,9 @@ Write-Output builddir:$builddir
Write-Output installdir:$installdir Write-Output installdir:$installdir
Write-Output sourcedir:$sourcedir Write-Output sourcedir:$sourcedir
$vcvars_ver_arg="$args"
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent $MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_init_msvc.ps1" . "$MyPath\mesa_init_msvc.ps1" "$vcvars_ver_arg"
$depsInstallPath="C:\mesa-deps" $depsInstallPath="C:\mesa-deps"
@ -65,6 +66,7 @@ meson setup `
-Dbuild-tests=true ` -Dbuild-tests=true `
-Dwerror=true ` -Dwerror=true `
-Dwarning_level=2 ` -Dwarning_level=2 `
$env:EXTRA_MESON_ARGS `
$sourcedir && ` $sourcedir && `
meson install && ` meson install && `
meson test --num-processes 32 --print-errorlogs meson test --num-processes 32 --print-errorlogs

View file

@ -75,5 +75,11 @@ if (!$buildstatus) {
Exit 1 Exit 1
} }
function Remove-Symlinks {
Get-ChildItem -Force -ErrorAction SilentlyContinue @Args | Where-Object { if($_.Attributes -match "ReparsePoint"){$_.Delete()} }
}
Remove-Symlinks -Path "deps" -Recurse
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path "deps" | Out-Null
Write-Host "Building libva-utils finished at:" Write-Host "Building libva-utils finished at:"
Get-Date Get-Date

View file

@ -9,7 +9,7 @@ Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.De
# VS2019 14.20 to 14.29 use -vcvars_ver=14.29 # VS2019 14.20 to 14.29 use -vcvars_ver=14.29
# VS2022 14.30 to 14.38 (not finished yet) use -vcvars_ver=14 to choose the newest version # VS2022 14.30 to 14.38 (not finished yet) use -vcvars_ver=14 to choose the newest version
$vcvars_ver_arg=$args $vcvars_ver_arg="$args"
if ($null -eq $vcvars_ver_arg[0]) { if ($null -eq $vcvars_ver_arg[0]) {
$vcvars_ver_arg="-vcvars_ver=14" $vcvars_ver_arg="-vcvars_ver=14"
} }