Chocolatey 无法在 GitHub 操作中安装 visualstudio2017-workload-vctools

Chocolatey fails to install visualstudio2017-workload-vctools in GitHub Actions

我们有一个 GitHub Action,它使用 Chocolatey 安装 visualstudio2017-workload-vctools 来进行 Windows 构建。相关的 YAML 如下所示:

    steps:
      - uses: actions/checkout@v1

      - name: Set up GraalVM (Java 11)
        uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18
        with:
          graalvm-version: '20.3.0.java11'

      - name: Install native-image
        run: gu install native-image
        shell: cmd

      - name: Set up Visual C Build Tools Workload for Visual Studio 2017 Build Tools
        run: |
          choco install visualstudio2017-workload-vctools
      - name: Configure Pagefile
        uses: al-cheb/configure-pagefile-action@v1.2

      - name:
        run: |
          (Get-CimInstance Win32_PageFileUsage).AllocatedBaseSize

几天前,choco install visualstudio2017-workload-vctools 开始出现错误,我们一直无法修复它。

visualstudio2017buildtools has been installed.
 The install of visualstudio2017buildtools was successful.
  Software install location not explicitly set, could be in package or
  default install location if installer.

visualstudio2017-workload-vctools v1.3.2 [Approved]
visualstudio2017-workload-vctools package files install completed. Performing other installation steps.
ERROR: Unable to detect any supported Visual Studio product. You may try passing --installPath or both --productId and --channelId parameters.
The install of visualstudio2017-workload-vctools was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\visualstudio2017-workload-vctools\tools\ChocolateyInstall.ps1'.
 See log for details.

我们尝试了 pinning the version,但这似乎没有帮助。

完全构建失败 here

解决方法:使用 windows-2016 图像代替 windows-latest / windows-2019 图像。

我也提交了一个相关的错误 report