jenkins-infra / packer-images

This repository hosts the packer definitions for the Jenkins Infrastructure
MIT License
16 stars 18 forks source link

Support VS2019 on Windows 2022 #1146

Open dduportal opened 2 months ago

dduportal commented 2 months ago

What feature do you want to see added?

Since https://github.com/jenkins-infra/packer-images/pull/1143, VS2019 is now part of our Windows 2019 images.

But the installation fails on Windows 2022: stuck at the step

azure-arm.windows: Preparing: C:\Users\packer\AppData\Local\Temp\907b86a749f6598117\vs_bootstrapper_d15\System.Runtime.CompilerS

(ref. https://github.com/jenkins-infra/packer-images/pull/1143#issuecomment-2071744001).

cc @slide

slide commented 2 months ago

The weird thing is that I did most of my prototyping for this with the Windows 2022 Docker Image. Is it difficult to run the packer process locally to debug?

dduportal commented 2 months ago

The weird thing is that I did most of my prototyping for this with the Windows 2022 Docker Image. Is it difficult to run the packer process locally to debug?

It should not be difficult OOB if you have an Azure subscription allowing you to spin up VMs. Otherwise you can try only the provision ps1 script inside a container (or whatever windows server VM) but we never had the time to spend on such case.

Note : as we would like to shift the Windows containers from the current Dockerfile to packer-images, supporting Windows container should be accessible easily. It was working well a few month ago

slide commented 2 months ago

It should not be difficult OOB if you have an Azure subscription allowing you to spin up VMs. Otherwise you can try only the provision ps1 script inside a container (or whatever windows server VM) but we never had the time to spend on such case.

Ok, I will give this a shot. I don't have any Azure subscriptions available I don't think. I'll have to look.

lemeurherve commented 2 weeks ago

For reference, there is an example of a Dockerfile to build a Windows Server Core ltsc2022 containing these build tools, if it can help:

https://github.com/MicrosoftDocs/visualstudio-docs/blob/9050b8dfd09f242fed9bcc893762eca61e1b2b8b/docs/install/build-tools-container.md#create-and-build-the-dockerfile

lemeurherve commented 2 weeks ago

Found out the difference between their ltsc2019 and ltsc2022 Dockerfiles:

- vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe
+ vs_buildtools.exe https://aka.ms/vs/17/release/vs_buildtools.exe

PR incoming.

slide commented 2 weeks ago

16 is VS 2019, 17 is VS 2022. I think we want to remain on 2019. Or we may need to change the install config file to install the 2019 libraries.

lemeurherve commented 2 weeks ago

Oh you're right, thanks, closing my PR.