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

Fix Visual Studio version search #1366

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

KyleSiefring
Copy link
Contributor

Prevents vs2017 from being used when version 17 (2022) is specified.

@danyeaw
Copy link
Member

danyeaw commented Jun 13, 2024

Hi @KyleSiefring, thanks for the contribution. Could you please explain more about the issue? What is your setup and what does this fix?

@KyleSiefring
Copy link
Contributor Author

KyleSiefring commented Jun 13, 2024

I have both the Visual Studio 2017 (version number 15.x) build tools installed and Visual Studio 2022 (version number 17.x) installed. The problem is that 2017 shows up in the list passed to this function before 2022. In that case, if we search for version 17 (again 2022), we end up selecting the 2017 edition based on the path to the tools.

Here are the current editions (year) and version number pairs to make what I'm saying a little clearer.

vs_zip_parts = {

@danyeaw
Copy link
Member

danyeaw commented Jun 13, 2024

Thanks! Can you please run pre-commit install and pre-commit run --all-files to fix the lint issues Ruff detected?

Fix how the version of visual studio is selected.

Visual Studio is selected by checking the path for the presence of
either the year or the version number. Unfortunately, some version
number are present in different editions. This can lead to the wrong
installed version being selected. For example, Visual Studio 2022 has a
version of 17, so specifying the use of version 17 can result in 2017
being selected instead.
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @KyleSiefring!

@danyeaw danyeaw merged commit 5e0f49c into wingtk:main Jun 14, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

2 participants