cirruslabs / docker-images-windows

Base Windows Docker images for Cirrus CI
MIT License
6 stars 7 forks source link

Add additional workloads to cirrusci/windowsservercore:cmake? #9

Open janpio opened 5 years ago

janpio commented 5 years ago

I'm trying to use cirrusci/windowsservercore:cmake but have to add a few workloads to Visual Studio (Microsoft.VisualStudio.Workload.Universal and Microsoft.VisualStudio.Component.Windows10SDK.10240).

From googling I found the visualstudio2017buildtools choco package, then on https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community?view=vs-2017 I could get the workload IDs, which I combined to choco install visualstudio2017buildtools --params "--add Microsoft.VisualStudio.Workload.Universal --add Microsoft.VisualStudio.Component.Windows10SDK.10240". But when I try to run this in a script I get this error message:

C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call choco install visualstudio2017buildtools --params "--add Microsoft.VisualStudio.Workload.Universal --add Microsoft.VisualStudio.Component.Windows10SDK.10240" 
Chocolatey v0.10.13
Installing the following packages:
visualstudio2017buildtools
By installing you accept licenses for the packages.
visualstudio2017buildtools v15.9.11.0 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.
Chocolatey installed 0/1 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Warnings:
 - visualstudio2017buildtools - visualstudio2017buildtools v15.9.11.0 already installed.
 Use --force to reinstall, specify a version to install, or try upgrade.

Should I really use --force or is there another way to just add those workloads to the existing installation?

janpio commented 5 years ago

I also tried choco upgrade which also did not lead to success:

C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call choco upgrade visualstudio2017buildtools --params "--add Microsoft.VisualStudio.Workload.Universal --add Microsoft.VisualStudio.Component.Windows10SDK.10240" 
Chocolatey v0.10.13
Upgrading the following packages:
visualstudio2017buildtools
By upgrading you accept licenses for the packages.
visualstudio2017buildtools v15.9.11.0 is the latest version available based on your source(s).
Chocolatey upgraded 0/1 packages. 
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
fkorotkov commented 5 years ago

Right now it seems the only workaround is to force re-install but I don't mind to add support for universal apps. At the moment I'm trying to build an image with all the packages pre-install to see how big it will be.

janpio commented 5 years ago

That sounds like a good idea, I am hitting install errors when trying to install vs17community on the plain image: https://cirrus-ci.com/build/6301294078197760

janpio commented 5 years ago

Turns out the --params "--add ..." syntax didn't really work, but luckily the main workloads are also published as their own packages on choco:

    choco install visualstudio2017-workload-universal -y
    choco install visualstudio2017-workload-webcrossplat -y

With these commands I could add the two workloads that I needed.

It takes 20 minutes though, so having an image with all the workloads installed would definitely be a big improvement.

fkorotkov commented 5 years ago

Nice! I was trying to add --package-parameters "--add Microsoft.VisualStudio.Workload.Universal --includeRecommended --locale en-US" and it was timing out yesterday after 2 hours. 😅Feel free to create a PR to add these packages to contrib/cmake/Dockerfile

janpio commented 5 years ago

These are for a very specific use case (Cordova Windows apps), which are probably useful just for me ;) Don't know enough about VS to suggest a better loadout of workloads.

fkorotkov commented 5 years ago

Still timing out 🤔 Trying here: #10

adunstan commented 3 years ago

Please also add all the optional components for vctools. ATM I am having to reinstall using:

choco install --force -y visualstudio2019-workload-vctools --package-parameters "--includeOptional"

which takes over 20 minutes :-(