-
Notifications
You must be signed in to change notification settings - Fork 340
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 forwarding script on Windows (suite supporting) #968
Fix forwarding script on Windows (suite supporting) #968
Conversation
83198bb
to
7aa9d99
Compare
Sorry for the force push, was trying to get rid of commits which turns out to be bad approach in test. Mainly because Rez is not activated (rez bin is not in Now, with that test case, should be enough to prove |
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.
Has anyone tried this on Windows ? 🤓
# activate suite | ||
env["PATH"] = os.pathsep.join([bin_path, env["PATH"]]) | ||
|
||
output = subprocess.check_output(["hunny"], shell=True, env=env, |
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.
Should have change this to use tool's context.execute_shell(block=True)
, then I won't have to put rez_bin_path
manually. Didn't know that before.
Will fix that later.
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.
Sorry, scratch that. The purpose of this test case is to test suite tool can be executed from a rez activated shell, not a resolved context.
Doc string added in f4ca471 to be more clear.
Problem
The forwarding script is basically an executable yaml file that has shebang which made it can be executed by
_rez_fwd
.But this doesn't work on Windows, which means that tools in
rez-suite
cannot be found nor executed, and the build script that generated byrez-build --scripts
won't work either.Solution
Adding extension
.cmd
to the forwarding script, makes it a semi-batch-script, e.g.The line
goto :eof
will skip the YAML content when this script is being called in terminal, and the first 4 cmd script lines will be stripped before parsing into dict byyaml.load
inforward.py
.I also fixed the missing import statement in custom build system on my way out.