Skip to content

cue.py fails with KeyError 'vs2022' on GitHub Actions windows-2025-vs2026 #112

Closed

Description

@anderslindho
Run python .ci/cue.py prepare
Clearing empty environment variable GITHUB_ACTION_REF
Clearing empty environment variable GITHUB_ACTION_REPOSITORY
Clearing empty environment variable GITHUB_BASE_REF
Clearing empty environment variable GITHUB_HEAD_REF
Traceback (most recent call last):
  File "D:\a\recsync\recsync\client\.ci\cue.py", line 1477, in <module>
    main(sys.argv[1:])
  File "D:\a\recsync\recsync\client\.ci\cue.py", line 1471, in main
    with_vcvars(' '.join(['--no-vcvars'] + raw))
  File "D:\a\recsync\recsync\client\.ci\cue.py", line 1380, in with_vcvars
    info['vcvars'] = vcvars_found[CC]
                     ~~~~~~~~~~~~^^^^
KeyError: 'vs2022'
Error: Process completed with exit code 1.

with:

  • GITHUB_ACTIONS=true
  • RUNNER_OS=Windows
  • CMP=vs2022
  • runs-on: windows-2025

see https://github.com/ChannelFinder/recsync/actions/runs/25477705971/job/74754707955 (or https://github.com/ChannelFinder/recsync/actions/runs/25481502523/job/74766536542 for latest version of this project)

Activity

  1. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    Meh.

    Could it be the windows-2025 runner doesn't have vs2022? The doc says it does.
    The title mentions vs2026 - now I'm confused.

    In any case: The failure should be more explicit, I agree.

  2. anderslindho commented on May 7, 2026

    @anderslindho
    Author
    Image

    I think we can fix with vswhere

  3. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    vsWHAT?

  4. anderslindho commented on May 7, 2026

    @anderslindho
    Author

    Detecting existing Visual Studio instances
    The following tools and utilities will help you detect and manage installed Visual Studio instances on client machines:

    • vswhere: an executable built into Visual Studio or available for separate distribution that helps you find the location of all Visual Studio instances on a particular machine.
  5. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    Jajaja.

    I found the new README.
    Will add the path for vs2026 as a quick fix and check out vswhatever.
    (Scared about backward compatibility and portability across CI services.)

  6. added a commit that references this issue on May 7, 2026
    2d8ab26
  7. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    Please check #113 - you need to set CMP=vs2026.

  8. anderslindho commented on May 7, 2026

    @anderslindho
    Author

    Have you tested it or do you want me to do so now? I will otherwise leave this be till merged.

  9. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    Untested.
    I will update ci-scripts own tests next. The matrix needs to get more complicated...

  10. anderslindho commented on May 7, 2026

    @anderslindho
    Author

    Doesn't seem to work, if I did things correctly:

    Run python .ci/cue.py prepare
    Clearing empty environment variable GITHUB_ACTION_REF
    Clearing empty environment variable GITHUB_ACTION_REPOSITORY
    Clearing empty environment variable GITHUB_BASE_REF
    Clearing empty environment variable GITHUB_HEAD_REF
    Traceback (most recent call last):
      File "D:\a\recsync\recsync\client\.ci\cue.py", line 1514, in <module>
        main(sys.argv[1:])
      File "D:\a\recsync\recsync\client\.ci\cue.py", line 1508, in main
        with_vcvars(' '.join(['--no-vcvars'] + raw))
      File "D:\a\recsync\recsync\client\.ci\cue.py", line 1415, in with_vcvars
        info['vcvars'] = vcvars_found[CC]
                         ~~~~~~~~~~~~^^^^
    KeyError: 'vs2026'
    Error: Process completed with exit code 1.
    

    https://github.com/ChannelFinder/recsync/actions/runs/25484117010/job/74775236272

  11. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    That's a job on windows-2022, which doesn't have vs2026.
    Your matrix also needs to get more complicated.

  12. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    Should ci-scripts @windows have a default vs version?
    (That would move us towards vswherethehell.)

  13. anderslindho commented on May 7, 2026

    @anderslindho
    Author

    I don't really want my matrix to get more complicated :/

    I vote for auto-detected vs version in all cases, i.e. vswhosehouse

  14. ralphlange commented on May 7, 2026

    @ralphlange
    Contributor

    There are runners (on other services) with multiple vs versions installed.

    Suggestion:
    Default loops through the locations (new -> old), takes the first one found.
    Explicit setting checks only the matching locations and fails if not found.

  15. anderslindho commented on May 7, 2026

    @anderslindho
    Author

    Maybe vswhatsup can handle that case neatly though? Otherwise your approach sounds good to me

  16. pheest commented on Jul 13, 2026

    @pheest

    I am struggling also with this issue, while seeking to use VS2022.

  17. ralphlange commented on Jul 13, 2026

    @ralphlange
    Contributor

    Thanks for the reminder. I seem to have left PR #113 dangling.

  18. added a commit that references this issue on Jul 14, 2026
    42a998b
  19. ralphlange commented on Jul 14, 2026

    @ralphlange
    Contributor

    @anderslindho, @pheest: Please check #115 - I think that PR will solve your issues.
    In your job settings, set the compiler to 'vs' to automatically select the installed one (if only one is installed).

    I still need to check the PR on the other forges (GitLab, Appveyor) before I feel confident enough to merge.
    And I need to properly document it, of course.
    @anderslindho: Thanks a lot for pointing out vswtf - not bad after all.

  20. pheest commented on Jul 15, 2026

    @pheest

    I am pleased to confirm that it does solve the issue.
    I tested this with the compiler set to 'vs' (selected vs2026) and also set to 'vs2026'.

  21. added a commit that references this issue on Jul 28, 2026
    728ed2b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions