Skip to content

Commit

Permalink
[libc++] NFC: Do not print the environment on remote hosts
Browse files Browse the repository at this point in the history
Running `export` when there is no environment variable to export will
cause the environment on the remote host to be printed. We don't want
that, so don't run any `export` command on the host when there's no env.
  • Loading branch information
ldionne committed May 6, 2020
1 parent 6533c1d commit d98b9a4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions libcxx/utils/ssh.py
Expand Up @@ -98,11 +98,10 @@ def main():
# temporary directory, where we know they have been copied when we handled
# test dependencies above.
commandLine = (pathOnRemote(x) if isTestExe(x) else x for x in commandLine)
remoteCommands += [
'cd {}'.format(tmp),
'export {}'.format(' '.join(args.env)),
subprocess.list2cmdline(commandLine)
]
remoteCommands.append('cd {}'.format(tmp))
if args.env:
remoteCommands.append('export {}'.format(' '.join(args.env)))
remoteCommands.append(subprocess.list2cmdline(commandLine))

# Finally, SSH to the remote host and execute all the commands.
rc = subprocess.call(ssh(' && '.join(remoteCommands)))
Expand Down

0 comments on commit d98b9a4

Please sign in to comment.