[PATCH] D56162: [test] Fix propagating HOME envvar to unittests

Michał Górny via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 30 12:47:24 PST 2018


mgorny created this revision.
mgorny added reviewers: zturner, chapuni, ddunbar, chandlerc.

Propagate HOME environment variable to unittests.  This is necessary
to fix test failures resulting from pw_home pointing to a non-existing
directory while being overriden with HOME.  Apparently Gentoo users
hit this sometimes when they override build directory for Portage.

Original bug report: https://bugs.gentoo.org/674088


Repository:
  rL LLVM

https://reviews.llvm.org/D56162

Files:
  test/Unit/lit.cfg.py


Index: test/Unit/lit.cfg.py
===================================================================
--- test/Unit/lit.cfg.py
+++ test/Unit/lit.cfg.py
@@ -31,6 +31,11 @@
 if 'TEMP' in os.environ:
     config.environment['TEMP'] = os.environ['TEMP']
 
+# Propagate HOME as it can be used to override incorrect homedir in passwd
+# that causes the tests to fail.
+if 'HOME' in os.environ:
+    config.environment['HOME'] = os.environ['HOME']
+
 # Propagate path to symbolizer for ASan/MSan.
 for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
     if symbolizer in os.environ:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56162.179741.patch
Type: text/x-patch
Size: 587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181230/657ea6ed/attachment.bin>


More information about the llvm-commits mailing list