Module: Mesa
Branch: main
Commit: c0ad42fe3453f0079b0a6b282898e7e8182255d6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c0ad42fe3453f0079b0a6b282898e7e8182255d6

Author: Yonggang Luo <[email protected]>
Date:   Wed Dec 20 11:04:43 2023 +0800

ci/msvc: Improve msvc init

Now when choose different version of msvc, there is no need rebuild 
windows-msvc docker

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Jesse Natalie <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26736>

---

 .gitlab-ci/windows/Dockerfile_build   |  1 +
 .gitlab-ci/windows/Dockerfile_msvc    |  2 --
 .gitlab-ci/windows/Dockerfile_test    |  1 +
 .gitlab-ci/windows/mesa_deps_msvc.ps1 | 12 ++++++++----
 .gitlab-ci/windows/mesa_init_msvc.ps1 | 10 +++++-----
 5 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/.gitlab-ci/windows/Dockerfile_build 
b/.gitlab-ci/windows/Dockerfile_build
index dec2c950fc6..5bd252c1477 100644
--- a/.gitlab-ci/windows/Dockerfile_build
+++ b/.gitlab-ci/windows/Dockerfile_build
@@ -6,6 +6,7 @@ FROM ${base_image}
 COPY mesa_deps_vulkan_sdk.ps1 C:\
 RUN C:\mesa_deps_vulkan_sdk.ps1
 
+COPY mesa_init_msvc.ps1 C:\
 COPY mesa_deps_build.ps1 C:\
 RUN C:\mesa_deps_build.ps1
 
diff --git a/.gitlab-ci/windows/Dockerfile_msvc 
b/.gitlab-ci/windows/Dockerfile_msvc
index b1e1c0a5ae9..6eac925afb5 100644
--- a/.gitlab-ci/windows/Dockerfile_msvc
+++ b/.gitlab-ci/windows/Dockerfile_msvc
@@ -18,8 +18,6 @@ RUN C:\mesa_deps_msvc.ps1
 COPY mesa_deps_choco.ps1 C:\
 RUN C:\mesa_deps_choco.ps1
 
-COPY mesa_init_msvc.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/Dockerfile_test 
b/.gitlab-ci/windows/Dockerfile_test
index 31be63d4a93..0c0075a7f26 100644
--- a/.gitlab-ci/windows/Dockerfile_test
+++ b/.gitlab-ci/windows/Dockerfile_test
@@ -6,5 +6,6 @@ FROM ${base_image}
 COPY mesa_deps_vulkan_sdk.ps1 C:\
 RUN C:\mesa_deps_vulkan_sdk.ps1
 
+COPY mesa_init_msvc.ps1 C:\
 COPY mesa_deps_test.ps1 C:\
 RUN C:\mesa_deps_test.ps1
diff --git a/.gitlab-ci/windows/mesa_deps_msvc.ps1 
b/.gitlab-ci/windows/mesa_deps_msvc.ps1
index 13286a1abec..b7f4b5212d7 100644
--- a/.gitlab-ci/windows/mesa_deps_msvc.ps1
+++ b/.gitlab-ci/windows/mesa_deps_msvc.ps1
@@ -2,14 +2,14 @@
 [Net.ServicePointManager]::SecurityProtocol = 
[Net.SecurityProtocolType]::Tls12;
 
 # VS16.x is 2019
-$msvc_2019_url = 'https://aka.ms/vs/16/release/vs_buildtools.exe'
+$msvc_url = 'https://aka.ms/vs/16/release/vs_buildtools.exe'
 
+Write-Host "Downloading Visual Studio 2019 build tools at:"
 Get-Date
-Write-Host "Downloading Visual Studio 2019 build tools"
-Invoke-WebRequest -Uri $msvc_2019_url -OutFile C:\vs_buildtools.exe
+Invoke-WebRequest -Uri $msvc_url -OutFile C:\vs_buildtools.exe
 
+Write-Host "Installing Visual Studio 2019 at:"
 Get-Date
-Write-Host "Installing Visual Studio 2019"
 # Command line
 # 
https://docs.microsoft.com/en-us/visualstudio/install/command-line-parameter-examples?view=vs-2019
 # Component ids
@@ -36,4 +36,8 @@ if (!$?) {
   Exit 1
 }
 Remove-Item C:\vs_buildtools.exe -Force
+
+Write-Host "Installing Visual Studio 2019 finished at:"
 Get-Date
+
+Exit 0
diff --git a/.gitlab-ci/windows/mesa_init_msvc.ps1 
b/.gitlab-ci/windows/mesa_init_msvc.ps1
index a91431d12c5..01f9a7deb2c 100644
--- a/.gitlab-ci/windows/mesa_init_msvc.ps1
+++ b/.gitlab-ci/windows/mesa_init_msvc.ps1
@@ -4,8 +4,8 @@ $vsInstallPath =  if ("$vsInstallPath" -eq "" ) { 
"C:\BuildTools" } else { "$vsI
 Write-Output "Final installPath: $vsInstallPath"
 Import-Module (Join-Path $vsInstallPath 
"Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
 # https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
-# VS2015 14.0
-# VS2017 14.16
-# VS2019 14.29
-# VS2022 14.32
-Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation 
-DevCmdArguments '-vcvars_ver=14.29 -arch=x64 -no_logo -host_arch=amd64'
+# VS2015 14.0 use -vcvars_ver=14.0
+# VS2017 14.1 to 14.16 use -vcvars_ver=14.16
+# 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
+Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation 
-DevCmdArguments '-vcvars_ver=14 -arch=x64 -no_logo -host_arch=amd64'

Reply via email to