[libc++] Use 'export' instead of 'env' to run remote commands

This allows running commands that use shell builtins remotely too, when
'env' would complain that it can't find the program.
This commit is contained in:
Louis Dionne 2020-03-31 17:10:29 -04:00
parent 2dee4d4429
commit 1c0dd57cd3
1 changed files with 6 additions and 2 deletions

View File

@ -78,8 +78,12 @@ def main():
# Execute the command through SSH in the temporary directory, with the
# correct environment.
command = [exe] + remaining if exe else remaining
res = subprocess.call(ssh('cd {} && env -i {} {}'.format(tmp, ' '.join(args.env), ' '.join(command))))
commands = [
'cd {}'.format(tmp),
'export {}'.format(' '.join(args.env)),
' '.join([exe] + remaining if exe else remaining)
]
res = subprocess.call(ssh(' && '.join(commands)))
# Remove the temporary directory when we're done.
subprocess.call(ssh('rm -r {}'.format(tmp)))