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

Better Windows Support #377

Merged
merged 15 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/rez/tests/test_shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,16 @@ def test_rcfile(self):
@shell_dependent(exclude=["cmd"])
@install_dependent
def test_rez_env_output(self):
# TODO: this test does not run on Windows using the CMD shell as it
# does not accept commands from stdin. Rather than explicitly skipping
# the test (via the decorator) perhaps we should check for startup
# capabilities as the other tests do.
from rez.vendor.sh import sh

# here we are making sure that running a command via rez-env prints
# exactly what we expect. We use 'sh' because subprocess strips special
# characters such as color codes - we want to ensure that the output
# EXACTLY matches the output of the command being run.
# exactly what we expect.
echo_cmd = which("echo")
if not echo_cmd:
print "\nskipping test, 'echo' command not found."
return

cmd = sh.Command(os.path.join(system.rez_bin_path, "rez-env"))
sh_out = cmd(["--", "echo", "hey"])
cmd = [os.path.join(system.rez_bin_path, "rez-env"), "--", "echo", "hey"]
process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
sh_out, _ = process.communicate()
out = str(sh_out).strip()
self.assertEqual(out, "hey")

Expand Down
2 changes: 1 addition & 1 deletion src/rez/utils/platform_.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def symlink(self, source, link_name):
raise ctypes.WinError()

def _terminal_emulator_command(self):
return "CMD.exe /Q /K"
return "START"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"terminal emulator" is probably a bit misleading. This command is only used when launching a rez environment using detached=True. CMD.exe just spawns a subshell within the current shell. START will launch a separate shell.


def _physical_cores_from_wmic(self):
# windows
Expand Down
19 changes: 0 additions & 19 deletions src/rez/vendor/sh/LICENSE.txt

This file was deleted.

6 changes: 0 additions & 6 deletions src/rez/vendor/sh/__init__.py

This file was deleted.

Loading