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

Correct spelling of Python variable in CMake #1319

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

mjcarroll
Copy link
Contributor

Not critical, but does seem to have issues, at least on Windows.

I believe that the problem is that COMMAND is expected to be one argument, so passing the python.exe plus the script name violates that. I'm not sure why this hasn't been an issue before, but it causes all sorts of hilariously bad behavior on Windows (popping open the Microsoft store of VS code rather than trying to run the script).

This seems to have issues on newer Windows/CMake combinations

Signed-off-by: Michael Carroll <[email protected]>
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Aug 31, 2023
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Merging #1319 (405e65e) into sdf14 (f6f34e2) will not change coverage.
The diff coverage is n/a.

❗ Current head 405e65e differs from pull request most recent head 2cb94b2. Consider uploading reports for the commit 2cb94b2 to get more accurate results

@@           Coverage Diff           @@
##            sdf14    #1319   +/-   ##
=======================================
  Coverage   87.47%   87.47%           
=======================================
  Files         134      134           
  Lines       17751    17751           
=======================================
  Hits        15528    15528           
  Misses       2223     2223           

📢 Have feedback on the report? Share it here.

@peci1
Copy link
Contributor

peci1 commented Sep 2, 2023

Got hit by this issue, too (in my case, opening GVim.exe :) ).

The resolution is much simpler, though:

COMMAND ${Pyhton3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/xmlschema.py

See, Pyhton ? :-D It's only in the 1.5 SDF CMakeLists, elsewhere it's okay.

@mjcarroll I think you can revert the other changes in your PR as they don't really make sense. CMake docs say ARGS is only for backwards compatibility and is ignored. So my interpretation is that command is always the first thing after COMMAND, while other things are args.

I guess it didn't manifest on the other operating systems as their default is to run .py files with an interpreter instead of an IDE. Although it could have used a wrong interpreter.

@mjcarroll
Copy link
Contributor Author

Good call, reverted.

I guess it didn't manifest on the other operating systems as their default is to run .py files with an interpreter instead of an IDE.

Yeah, we have a shebang line in the xmlschema.py, so it should just do the right thing on platforms that understand that. Windows is not one of those, unfortunately, so it would have all sorts of silly side effects.

@mjcarroll mjcarroll self-assigned this Sep 7, 2023
@azeey azeey added the beta Targeting beta release of upcoming collection label Sep 11, 2023
@azeey
Copy link
Collaborator

azeey commented Sep 11, 2023

The title of the PR should be renamed though.

@mjcarroll mjcarroll changed the title CMake custom command can only be one arg Correct spelling of Python variable in CMake Sep 11, 2023
@mjcarroll mjcarroll merged commit 6371cc7 into sdf14 Sep 11, 2023
@mjcarroll mjcarroll deleted the mjcarroll/fix_cmake_command branch September 11, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants