Page MenuHomePhabricator

[llvm] [lit/tests] Replace 'env -u' with more portable construct

Authored by mgorny on Jul 26 2019, 7:07 AM.



Set environment variables to empty values rather than attempting
to unset them via 'env -u', in order to fix NetBSD test regression
caused by r366980. POSIX does not guarantee that env(1) supports '-u'
option, and indeed NetBSD env(1) does not support it.

Diff Detail


Event Timeline

mgorny created this revision.Jul 26 2019, 7:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2019, 7:07 AM
jdenny accepted this revision.Jul 26 2019, 7:48 AM

LGTM. Thanks again.

This revision is now accepted and ready to land.Jul 26 2019, 7:48 AM
This revision was automatically updated to reflect the committed changes.

This actually breaks the lit tests on Windows when the path to Python has spaces. For example:

Command Output (stdout):
$ ":" "RUN: at line 3"
note: command had no output on stdout or stderr
$ "not" "env" "FILECHECK_OPTS=" "FILECHECK_DUMP_INPUT_ON_FAILURE=" "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\python.exe" "E:/_work/18/s/llvm\utils\lit\" "-j" "1" "-v" "E:/_work/18/b/utils/lit/tests\Inputs/shtest-output-printing"
# command stderr:
C:\Program: can't open file 'Files': [Errno 2] No such file or directory

Are you talking about this *specific* change or the original change that added env usage?

It could be either actually. I'll run the tests with just the first one and see if it reproduces. I *think* it's this one.

It is indeed which introduced the failure