diff --git a/.gitlab-ci/windows/Dockerfile_build b/.gitlab-ci/windows/Dockerfile_build index 3772c16514a..dec2c950fc6 100644 --- a/.gitlab-ci/windows/Dockerfile_build +++ b/.gitlab-ci/windows/Dockerfile_build @@ -3,6 +3,9 @@ ARG base_image FROM ${base_image} +COPY mesa_deps_vulkan_sdk.ps1 C:\ +RUN C:\mesa_deps_vulkan_sdk.ps1 + COPY mesa_deps_build.ps1 C:\ RUN C:\mesa_deps_build.ps1 diff --git a/.gitlab-ci/windows/Dockerfile_test b/.gitlab-ci/windows/Dockerfile_test index 106e493358f..31be63d4a93 100644 --- a/.gitlab-ci/windows/Dockerfile_test +++ b/.gitlab-ci/windows/Dockerfile_test @@ -3,5 +3,8 @@ ARG base_image FROM ${base_image} +COPY mesa_deps_vulkan_sdk.ps1 C:\ +RUN C:\mesa_deps_vulkan_sdk.ps1 + COPY mesa_deps_test.ps1 C:\ RUN C:\mesa_deps_test.ps1 diff --git a/.gitlab-ci/windows/Dockerfile_vs b/.gitlab-ci/windows/Dockerfile_vs index 95c45633151..5e1c9566500 100644 --- a/.gitlab-ci/windows/Dockerfile_vs +++ b/.gitlab-ci/windows/Dockerfile_vs @@ -14,12 +14,12 @@ RUN Write-Output $PSVersionTable $ErrorActionPreference COPY mesa_deps_vs2019.ps1 C:\ RUN C:\mesa_deps_vs2019.ps1 -COPY mesa_vs_init.ps1 C:\ -ENV VULKAN_SDK_VERSION='1.3.211.0' COPY mesa_deps_choco.ps1 C:\ RUN C:\mesa_deps_choco.ps1 +COPY mesa_vs_init.ps1 C:\ + # Example usage: # `base_image` should use windows image that can be run with `--isolation=process` option, # since the resulting container will want to be used that way be later containers in the build process. diff --git a/.gitlab-ci/windows/mesa_deps_choco.ps1 b/.gitlab-ci/windows/mesa_deps_choco.ps1 index 5255839f3d2..d2cbeb69608 100644 --- a/.gitlab-ci/windows/mesa_deps_choco.ps1 +++ b/.gitlab-ci/windows/mesa_deps_choco.ps1 @@ -1,6 +1,6 @@ # Download new TLS certs from Windows Update +Write-Host "Updating TLS certificate store at:" Get-Date -Write-Host "Updating TLS certificate store" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "_tlscerts" | Out-Null $certdir = (New-Item -ItemType Directory -Name "_tlscerts") certutil -syncwithWU "$certdir" @@ -9,8 +9,8 @@ Foreach ($file in (Get-ChildItem -Path "$certdir\*" -Include "*.crt")) { } Remove-Item -Recurse -Path $certdir +Write-Host "Installing graphics tools (DirectX debug layer) at:" Get-Date -Write-Host "Installing graphics tools (DirectX debug layer)" Set-Service -Name wuauserv -StartupType Manual if (!$?) { Write-Host "Failed to enable Windows Update" @@ -31,17 +31,19 @@ if (!$graphics_tools_installed) { Exit 1 } +Write-Host "Installing Chocolatey at:" Get-Date -Write-Host "Installing Chocolatey" Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) Import-Module "$env:ProgramData\chocolatey\helpers\chocolateyProfile.psm1" +# Add Chocolatey's native install path Update-SessionEnvironment -Write-Host "Installing Chocolatey packages" +Write-Host "Installing Chocolatey packages at:" +Get-Date # Chocolatey tries to download winflexbison3 from github, which is not super reliable, and has no retry # loop of its own - so we give it a helping hand here For ($i = 0; $i -lt 5; $i++) { - choco install --no-progress -y python3 --params="/InstallDir:C:\python3" + choco install --no-progress -y python3 $python_install = $? choco install --allow-empty-checksums --no-progress -y cmake git git-lfs ninja pkgconfiglite winflexbison3 --installargs "ADD_CMAKE_TO_PATH=System" $other_install = $? @@ -56,40 +58,20 @@ if (!$choco_installed) { Exit 1 } -# Add Chocolatey's native install path +# Add Chocolatey's newly installed package path Update-SessionEnvironment -# Python and CMake add themselves to the system environment path, which doesn't get refreshed -# until we start a new shell -$env:PATH = "C:\python3;C:\python3\scripts;C:\Program Files\CMake\bin;$env:PATH" Start-Process -NoNewWindow -Wait git -ArgumentList 'config --global core.autocrlf false' +Write-Host "Upgrading pip at:" Get-Date -Write-Host "Installing Meson, Mako and numpy" -pip3 install meson mako numpy --progress-bar off +python -m pip install --upgrade pip --progress-bar off +Write-Host "Installing python packages at:" +Get-Date +pip3 install packaging meson mako numpy --progress-bar off if (!$?) { Write-Host "Failed to install dependencies from pip" Exit 1 } - +Write-Host "Installing python packages finished at:" Get-Date -Write-Host "Downloading Vulkan-SDK" -Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan_sdk.exe' -C:\vulkan_sdk.exe --am --al -c in -if (!$?) { - Write-Host "Failed to install Vulkan SDK" - Exit 1 -} -Remove-Item C:\vulkan_sdk.exe -Force - -Get-Date -Write-Host "Downloading Vulkan-Runtime" -Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe" -OutFile 'C:\vulkan-runtime.exe' | Out-Null -Write-Host "Installing Vulkan-Runtime" -Start-Process -NoNewWindow -Wait C:\vulkan-runtime.exe -ArgumentList '/S' -if (!$?) { - Write-Host "Failed to install Vulkan-Runtime" - Exit 1 -} -Remove-Item C:\vulkan-runtime.exe -Force - diff --git a/.gitlab-ci/windows/mesa_deps_vulkan_sdk.ps1 b/.gitlab-ci/windows/mesa_deps_vulkan_sdk.ps1 new file mode 100644 index 00000000000..4144b8eba44 --- /dev/null +++ b/.gitlab-ci/windows/mesa_deps_vulkan_sdk.ps1 @@ -0,0 +1,39 @@ +# Downloading specified vulkan sdk and vulkan runtime +# Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG +# This file needs run in administrator mode + +$env:VULKAN_SDK_VERSION="1.3.211.0" + +$ProgressPreference = "SilentlyContinue" + +# Save environment VULKAN_SDK_VERSION to system +[System.Environment]::SetEnvironmentVariable('VULKAN_SDK_VERSION', "$env:VULKAN_SDK_VERSION", [System.EnvironmentVariableTarget]::Machine) + +$VULKAN_SDK_URL="https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanSDK-$env:VULKAN_SDK_VERSION-Installer.exe" +Write-Host "Downloading Vulkan-SDK $VULKAN_SDK_URL at:" +Get-Date +Invoke-WebRequest -Uri "$VULKAN_SDK_URL" -OutFile "${env:TMP}\vulkan_sdk.exe" | Out-Null +Write-Host "Installing Vulkan-SDK at:" +Get-Date +Start-Process -NoNewWindow -Wait "${env:TMP}\vulkan_sdk.exe" -ArgumentList "--am --al -c in" +if (!$?) { + Write-Host "Failed to install Vulkan SDK" + Exit 1 +} +Remove-Item "${env:TMP}\vulkan_sdk.exe" -Force + +$VULKAN_RUNTIME_URL="https://sdk.lunarg.com/sdk/download/$env:VULKAN_SDK_VERSION/windows/VulkanRT-$env:VULKAN_SDK_VERSION-Installer.exe" +Write-Host "Downloading Vulkan-Runtime $VULKAN_RUNTIME_URL at:" +Get-Date +Invoke-WebRequest -Uri "$VULKAN_RUNTIME_URL" -OutFile "${env:TMP}\vulkan-runtime.exe" | Out-Null +Write-Host "Installing Vulkan-Runtime at:" +Get-Date +Start-Process -NoNewWindow -Wait "${env:TMP}\vulkan-runtime.exe" -ArgumentList '/S' +if (!$?) { + Write-Host "Failed to install Vulkan-Runtime" + Exit 1 +} +Remove-Item "${env:TMP}\vulkan-runtime.exe" -Force + +Write-Host "Installing Vulkan-Runtime finished at:" +Get-Date