-
Notifications
You must be signed in to change notification settings - Fork 26
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
use msbuild -version, not %VisualStudioVersion% #92
Conversation
This is meant to make Colcon more friendly with github actions, since the Github action only sets the PATH to the current build tools.
FYI, the stuff in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stuff in
test.py
and__init__.py
was changed because the linter complained about it. I can revert those changes ...
Please do so to keep this patch minimal with only changes relevant to the topic of the PR..
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- If the user has activated MSBuild (e.g. with the action `microsoft/setup-msbuild`), respect it instead of sourcing msbuild. - (esp. if using PowerShell) don't wrap commands in an additional layer of cmd - convert build-and-test to a github composite action - add many more (too many?) variations to the ros2 matrix Signed-off-by: Dan Rose <dan@digilabs.io> Check for msbuild instead of %VisualStudioVersion% Depends on colcon/colcon-cmake#92
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function get_visual_studio_version()
should be deprecated since it is no more used anywhere.
(I would have applied some of the changes I requested directly but it seems that editing the upstream branch is disabled.)
|
||
:rtype: str | ||
""" | ||
completed_process = subprocess.run( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please invoke check_output
instead of run
since that is what it is used for here.
@functools.lru_cache(maxsize=1) | ||
def get_msbuild_version(): | ||
""" | ||
Get the version of msbuild or throw an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docblock should contain more information what kind of exceptions can be raised. This should use the :raises ExceptionType: ...
style.
'14.0': 'Visual Studio 14 2015', | ||
} | ||
if vsv not in supported_vsv: | ||
'msbuild is not found, ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: instead if "is" it should be "was".
@rotu Friendly ping. |
1 similar comment
@rotu Friendly ping. |
Closing due to no response. |
When building on Windows, instead of using
%VisualStudioVersion%
, usemsbuild -version
This is intended to make
colcon-cmake
more friendly to Github actions. Themicrosoft/setup-msbuild
action does not populate%VisualStudioVersion%
, socolcon-cmake
crashes on that platform.Here is a workflow demonstrating the issue and the proposed fix:
https://github.com/rotu/ros2-ci/actions/runs/233271645/workflow