actions / runner-images

GitHub Actions runner images
MIT License
10.16k stars 3.06k forks source link

`vcvarsall.bat` from VS 2019 has recently stopped setting `VCToolsRedistDir` #10819

Open guihkx opened 2 weeks ago

guihkx commented 2 weeks ago

Description

The vcvarsall.bat script from Visual Studio 2019 has recently stopped setting the VCToolsRedistDir environment variable.

I have a build step that uses this action, which essentially invokes vcvarsall.bat from Visual Studio 2019, and "forwards" every environment variable set by that script to subsequent build jobs.

3 weeks ago, the vcvarsall.bat script would still set VCToolsRedistDir, but now it doesn't.

It's not clear to me why, but it felt appropriate to report it here.

Platforms affected

Runner images affected

Image version and build link

20241015.1.0: https://github.com/nuttyartist/notes/actions/runs/11418927860/job/31772946804#step:4:28

Is it regression?

Yes. 20240922.1.0: https://github.com/nuttyartist/notes/actions/runs/11128027843/job/30922790999#step:4:29

Expected behavior

The VCToolsRedistDir environment to be set after running vcvarsall.bat.

Actual behavior

VCToolsRedistDir is not set anymore.

Repro steps

name: Test VCToolsRedistDir

on:
  workflow_dispatch:
  push:

jobs:
  test:
    runs-on: windows-2019
    steps:
      - name: Check if VCToolsRedistDir exists
        shell: cmd
        run: |
          call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
          :: Check if VCToolsRedistDir is set
          if not defined VCToolsRedistDir (
            echo Error: Environment variable VCToolsRedistDir is not set.
            exit /b 1
          )
guihkx commented 2 weeks ago

I found a more recent build job that ran on 20241006.1.0 and still sets VCToolsRedistDir: https://github.com/nuttyartist/notes/actions/runs/11383332274/job/31668737205#step:4:29

So this regression(?) was introduced with 20241015.1.0.

hemanthmanga commented 2 weeks ago

Hi @guihkx Thank you for bringing this issue to our attention. We are looking into this issue and will update you on this issue after investigating.

zanieb commented 2 weeks ago

I believe this may be the problem in https://github.com/indygreg/python-build-standalone/issues/376 as well, but haven't been able to produce a fix yet to confirm.

hemanthmanga commented 1 week ago

Hi @guihkx, Could you please try the latest version 20241021.1 and please update us, Thank you.

guihkx commented 1 week ago

Could you please try the latest version 20241021.1 and please update us, Thank you.

Still unset: https://github.com/guihkx/notes/actions/runs/11532828745/job/32105052408

dlux95 commented 3 days ago

We are using Windows Server 2022 based container images with Visual Studio 2019 Build Tools and are also missing the VCToolsRedistDir environment variable. Last successful container image was built 3 weeks ago. As the system is in it's startup phase i don't have any exact version numbers. But it appears to me that this is a general Visual Studio 2019 issue and nothing specific to Github Actions or (as in our case) Gitlab Runners as well as regular container images.

Do you know the best way to raise an issue to Visual Studio developers about this?

hemanthmanga commented 2 days ago

Hi @dlux95, You can raise an issue here https://github.com/microsoft/vscode , Thanks.

dlux95 commented 2 days ago

Hi @dlux95, You can raise an issue here https://github.com/microsoft/vscode , Thanks.

Isn’t that only for Visual Studio Code related issues? I don’t think that’s the right place.

hemanthmanga commented 17 hours ago

Hi @dlux95, This is the URL which may be referred to for reporting the problem in a general https://learn.microsoft.com/en-gb/visualstudio/ide/how-to-report-a-problem-with-visual-studio?view=vs-2022.