Skip to content

Commit a885567

Browse files
committed
[LLD] Fix probing a MSYS based 'tar' in a Windows Container
Don't run the 'tar' tool in a cleared environment with only the LANG variable set, just set LANG on top of the existing environment. If the 'tar' tool is an MSYS based tool, running it in a Windows Container hangs if all environment variables are cleared - in particular, the USERPROFILE variable needs to be kept intact. This is the same issue fixed as was fixed in other places in 9de63b2, but contrary to running the actual tests, running with an as-cleared-as-possible environment here is less important. Differential Revision: https://reviews.llvm.org/D99304
1 parent 32f6a15 commit a885567

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lld/test/lit.cfg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@
101101

102102
tar_executable = lit.util.which('tar', config.environment['PATH'])
103103
if tar_executable:
104+
env = os.environ
105+
env['LANG'] = 'C'
104106
tar_version = subprocess.Popen(
105107
[tar_executable, '--version'],
106108
stdout=subprocess.PIPE,
107109
stderr=subprocess.PIPE,
108-
env={'LANG': 'C'})
110+
env=env)
109111
sout, _ = tar_version.communicate()
110112
if 'GNU tar' in sout.decode():
111113
config.available_features.add('gnutar')

0 commit comments

Comments
 (0)