ilammy/msvc-dev-cmd

CI: test this action when "vswhere" does not exist

Opened this issue · 8 comments

We have some code to find "vcvarsall.bat" manually when "vswhere" does not exist:

msvc-dev-cmd/index.js

Lines 33 to 44 in f456b80

// If that does not work, try the standard installation locations,
// starting with the latest and moving to the oldest.
for (const ver of VERSIONS) {
for (const ed of EDITIONS) {
path = `${PROGRAM_FILES_X86}\\Microsoft Visual Studio\\${ver}\\${ed}\\VC\\Auxiliary\\Build\\vcvarsall.bat`
core.info(`Trying standard location: ${path}`)
if (fs.existsSync(path)) {
core.info(`Found standard location: ${path}`)
return path
}
}
}

However, the test in the current main.yml doesn't cover this case.

I think we should test this action more exhaustively.

I run into this issue now.

Hi, @albinahlback !

I run into this issue now.

What issue did you encounter? I think it would be better if you post your workflow conf, CI logs and more details in a new issue. This issue is not for solving users' problems, though.

The CI I just started ran into this issue. See it here.

The workflow configuration can be seen here.

@albinahlback

      - name: "Setup MSVC"
        uses: ilammy/msvc-dev-cmd@v1.13.0
        with:
          arch: x86_64
          toolset: 14.37.32822
          vsversion: 17.6.0
  with:
    arch: x86_64
    toolset: 14.37.32822
    vsversion: 17.6.0
  env:
    ACTIONS_CACHE_URL: https://acghubeus1.actions.githubusercontent.com/4zQcPMsKhvhGvybvpAQ5Qla8U4fvNh2IwCWQWVQQRZcqfksgNm/
    ACTIONS_RUNTIME_TOKEN: ***
Not found with vswhere
Trying standard location: C:\Program Files (x86)\Microsoft Visual Studio\17.6.0\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files (x86)\Microsoft Visual Studio\17.6.0\Professional\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files (x86)\Microsoft Visual Studio\17.6.0\Community\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files (x86)\Microsoft Visual Studio\17.6.0\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files\Microsoft Visual Studio\17.6.0\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files\Microsoft Visual Studio\17.6.0\Professional\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files\Microsoft Visual Studio\17.6.0\Community\VC\Auxiliary\Build\vcvarsall.bat
Trying standard location: C:\Program Files\Microsoft Visual Studio\17.6.0\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
Not found in standard locations
Not found in VS 2015 location: C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat

Why specified vsversion? There is only one VS in the runner.

Oh, I didn't think of that, thanks! The README doesn't really state which versions it picks for toolset and vsversion. Perhaps add that to the README?

Perhaps add that to the README?

Done, see #77 .

Hi @albinahlback, the README has been updated.

Thanks!