Ensure that command wrapping only runs on Windows #3056
+54
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change(s)
The
shebang.py
script has two modes, one which does substitution of\pxrpythonsubst
, the other which generates a wrapper command for Windows. The mode is argument dependent. However, ifcmake
fails to setPXR_PYTHON_SHEBANG
, the wrong mode can get executed and a build with errors will silently be installed.This change separates the unrelated windows only components out of
shebang.py
into a siblingwinpycmd.py
script. It also adds a warning towinpycmd
to alert users that it's being run on a non-Windows platform.With this fix, the build will now fail (instead of silently installing a build with errors) when
PXR_PYTHON_SHEBANG
cannot be correctly set.Fixes Issue(s)
cmake/macros/shebang.py
runs the wrong code path ifPXR_PYTHON_SHEBANG
fails to be set to the python executable #3047