Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify exact version number rather than latest #68

Open
SSoelvsten opened this issue Sep 22, 2023 · 3 comments
Open

How to specify exact version number rather than latest #68

SSoelvsten opened this issue Sep 22, 2023 · 3 comments

Comments

@SSoelvsten
Copy link

SSoelvsten commented Sep 22, 2023

I am on thomasmoelhave/tpie#257 , adding CI for all major platforms for the TPIE library which my research project is heavily dependent upon. Yet, due to a very weird error (thomasmoelhave/tpie#269), the library cannot compile with the latest 2019 MSC compiler, but only up to 19.27.

Specifically, as far as I can tell, the TPIE compatibility with MSC breaks between these two version numbers

Working Failing
Product Version 16.7 16.8.1
Runtime Library 14.27 14.28
MSC version 19.27.29112 19.28.29333

Based on the README, I am unable to figure out what value to parse to this GitHub Action? There is a toolset argument but I seem to get an error regardless of whether I set it to 16.7, 14.27 or 19.27 (or maybe I missed a specific value when trying it out?).

For example when using v1.12.1 and toolset to the product version, I get the error messages

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 '16.7' was not found.

Based on the Wikipedia article, I should provide a truncated runtime library instead, but neither 14.27 nor 141 seem to work.

@SSoelvsten SSoelvsten changed the title Specify exact version number rather than latest How to specify exact version number rather than latest Sep 22, 2023
@SSoelvsten
Copy link
Author

Maybe all this boils down to "How do I derive the toolset number?" which in itself might be worth adding to the README.

@pzhlkj6612
Copy link
Contributor

Hi! I've not dug into the issues you link but still want to share something with you.

I've tested GitHub Actions with the following workflow file:

name: CI
on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  workflow_dispatch:
jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-2019, windows-2022]
        toolset_ver:
          - "v140"
          - "v141"
          - 140
          - 141
          - 14
          - "14.0"
          - 14.1
          - 14.2
          - 14.21
          - 14.22
          - 14.23
          - 14.24
          - 14.25
          - 14.26
          - 14.27
          - 14.28
          - 14.29
          - "14.30"
          - 14.3
          - 14.31
          - 14.32
          - 14.33
          - 14.34
          - 14.35
          - 14.36
          - 14.37
          - 14.38
    steps:
      - uses: ilammy/msvc-dev-cmd@v1
        with:
          arch: x64
          toolset: ${{ matrix.toolset_ver }}
      # https://learn.microsoft.com/cpp/build/reference/help-compiler-command-line-help
      - run: |
          "CL_VERSION=$(cl /? 2>&1 | Select-String -Pattern 'Compiler Version' -CaseSensitive -SimpleMatch)" | Out-File -Append -FilePath ${env:\GITHUB_OUTPUT}
        shell: pwsh
        id: cl
      - run: echo '::warning ::${{ matrix.os }} + toolset-${{ matrix.toolset_ver }} = ${{ steps.cl.outputs.CL_VERSION }}'

The result is:

toolset windows-2019 windows-2022 note
14 19.29.30152 19.37.32824
14.0 19.00.24247.2 140
14.1 19.16.27051 19.16.27051 v141
14.2 19.29.30152 19.29.30152
14.25 19.25.28614
14.29 19.29.30152 19.29.30152
14.3 19.37.32824
14.35 19.35.32217.1
14.37 19.37.32824

(The above table is generated by TablesGenerator.com)

The versions of toolset are from the "windowsNNNN-readme.md" files in https://github.com/actions/runner-images/tree/main/images/win . Please search "Microsoft.VisualStudio.Component.VC" in those files.

@SSoelvsten
Copy link
Author

That looks like the exact information I needed, thanks! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants