Virtual-environments: Add MSVC v142 - VS 2019 C++ x64/x86 Build Tools (v14.25)

Created on 18 Jun 2020  路  8Comments  路  Source: actions/virtual-environments

Tool information

Area for Triage:
"C/C++" Visual Studio

Question, Bug, or Feature?:
"Question" "Feature"

Virtual environments affected

  • [ ] macOS 10.15
  • [ ] Ubuntu 16.04 LTS
  • [ ] Ubuntu 18.04 LTS
  • [ ] Ubuntu 20.04 LTS
  • [x] Windows Server 2016 R2
  • [x] Windows Server 2019

Can this tool be installed during the build?
If yes I want to know how

Tool installation time in runtime

Are you willing to submit a PR?

C++ Windows enhancement

Most helpful comment

Thanks all is working.

All 8 comments

Finaly I get a work arround.
We compile using CMake and with latest Visual Studio 16.6, it is not compiling, so I wanted to use MSVC v14.25.
Normally you can choose that whith cmake option
-T version=14.25
but we get this error:

CMake Error at D:/a/1/b/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project):
  Generator
    Visual Studio 16 2019
  given toolset and version specification
    v142,version=14.25
  does not seem to be installed at
    C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/14.25/Microsoft.VCToolsVersion.14.25.props

finaly installing component using this script :

- powershell: |
        [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
        $client = new-object System.Net.WebClient
        $client.DownloadFile("$(visual_bootstrapper)","vs_enterprise.exe")
        .\vs_enterprise.exe modify --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" --add Microsoft.VisualStudio.Component.VC.14.25.x86.x64 --passive --wait

that runs only 8s makes our build work again.

So my question is: "can we avoid this installation as it seems component is somehow there?"

our yml file: https://github.com/Mobsya/aseba/blob/master/azure-pipelines.yml

Thank you for feature request, we will consider pre-installing this component

Thank for considering.
My work around do not work all the time, sometimes /Build/14.25/ is found sometime not.
What can I do to ensure it?
Our pipeline : https://dev.azure.com/mobsya/Thymio%20Software%20Suite/_build?definitionId=6&_a=summary

Unfortunately, no idea why installation is not stable in runtime. We use the following code to install VS during image generation: https://github.com/actions/virtual-environments/blob/master/images/win/scripts/ImageHelpers/InstallHelpers.ps1#L66

@mbonani we already have vsinstaller on VM so you are able to use something like this and it can be a more stable option:

      - name: Add Component
        shell: cmd
        run: |
          "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify --channelId VisualStudio.16.Release --productId Microsoft.VisualStudio.Product.Enterprise -q --includeRecommended --add "Microsoft.VisualStudio.Component.VC.14.25.x86.x64"

@miketimofeev Thank for your advise.
With your command line this process take arround 15min, at least we are sure it is installed.
So please consider pre-installing this component, specially when a new compiler come out so that people can minor version in case of problem until new version is stabilised.

Microsoft.VisualStudio.Component.VC.14.25.x86.x64 has been added to Visual Studio deployment.
You can find this component in the next week (after next Windows image deployment)

Thanks all is working.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

damccorm picture damccorm  路  3Comments

raulpopadineti picture raulpopadineti  路  3Comments

mxschmitt picture mxschmitt  路  3Comments

trajano picture trajano  路  3Comments

estebanes22 picture estebanes22  路  3Comments