ilammy / msvc-dev-cmd

GitHub Action to setup Developer Command Prompt for Microsoft Visual C++
MIT License
338 stars 49 forks source link

Toolset directory for version '14.38' was not found. #80

Closed MisterDA closed 4 months ago

MisterDA commented 4 months ago

Starting today (2024-05-16), the action has started failing. Any idea of what's happening?

      - name: Set up MSVC
        uses: ilammy/msvc-dev-cmd@v1
        with:
          toolset: 14.38
          arch: ${{ matrix.x86_64 && 'x64' || 'x86' }}
Found with vswhere: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Error: Could not setup Developer Command Prompt: invalid parameters
[ERROR:vcvars.bat] Toolset directory for version '14.38' was not found.
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat]    1 : basic debug logging
[ERROR:VsDevCmd.bat]    2 : detailed debug logging
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
pzhlkj6612 commented 4 months ago

Hi!

As per [Windows-2022] Multiple VC Build Tools will be removed on May, 13 · Issue #9701 · actions/runner-images, I think GitHub has removed all VC++ toolsets except the latest one (for now it's 14.39). That's why the version 14.38 was not found.

Please compare the following two files (lines highlighted by me; I have no idea why two 14.29 toolsets are preserved):

.

MisterDA commented 4 months ago

That what I finally figured, thanks! It's strange though, I thought that 14.39 was pre-release. The page at Latest Microsoft Visual C++ Redistributable Version still indicates 14.38.

If I don't specify toolset, will vcvarsall default to the latest version?

Thanks for the help!

pzhlkj6612 commented 4 months ago

@MisterDA

If I don't specify toolset, will vcvarsall default to the latest version?

The toolset parameter is actually the -vcvars_ver parameter of "vcvarsall"^1. Microsoft says that "By default, the environment is set to use the current Visual Studio compiler toolset"[^2], and there should be only one toolset on GitHub-hosted runners[^3], so I think you will pick the latest version by omitting the toolset parameter.

[^2]: vcvarsall syntax § Use the Microsoft C++ toolset from the command line | Microsoft Learn. [^3]: Using GitHub-hosted runners - GitHub Docs.

MisterDA commented 4 months ago

Thanks a lot!