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

Fixed parsing the output of vswhere #13284

Conversation

rainman110
Copy link
Contributor

@rainman110 rainman110 commented Mar 1, 2023

Changelog: Bugfix: Fixed the detection of certain visual c++ installations.
Docs: Omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

The output of vswhere uses "Ansi" encoding. It was though decoded via "Utf-8", which raised an exception in certain cases (i.e. letters like 'ö').

This PR forces the output of vswhere to be utf-8, resolving the issue.

Thus, some visual studio installation could not be found.

Fixes #13281

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@CLAassistant
Copy link

CLAassistant commented Mar 1, 2023

CLA assistant check
All committers have signed the CLA.

@rainman110
Copy link
Contributor Author

@memsharded please have a look to this. This fixes the Visual Studio detection.

@rainman110
Copy link
Contributor Author

@memsharded An alternative to this PR would be to force utf-8 encoding by adding the "-utf-8" argument to vswhere, see:
https://github.com/microsoft/vswhere/wiki/Encoding

The output of vswhere normally uses "Ansi" encoding.
It was though decoded via "Utf-8", which raised
an exception in certain cases (i.e. letters like 'ö').

This commit forces the output to be utf-8, by providing the "utf8"
option to vswhere.

Thus, some visual studio installation could not be found.

Fixes conan-io#13281
@rainman110 rainman110 force-pushed the bugfix/13281_fix_parsing_vswhere_output branch from 80cd0bc to 1002d4a Compare March 1, 2023 14:10
@rainman110
Copy link
Contributor Author

@memsharded I now follow the other approach by forcing utf-8. Works nicely locally.

@memsharded
Copy link
Member

@memsharded I now follow the other approach by forcing utf-8. Works nicely locally.

Excellent, I think it seems a little less risky than the alternative, lets see how it goes.
Thanks very much for contributing it!

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.

3 participants