lichray created this revision. Herald added subscribers: krytarowski, emaste.
Lit tries to inject the shared library paths, but no action is taken when `platform.system()` is not recognized, results in an environment variable with an empty name, which is illegal. The patch fixes this mechanism for FreeBSD, and throws an exception on other platforms, so that the latecomers don't have to spend time on debugging lit. https://reviews.llvm.org/D39162 Files: test/Unit/lit.cfg.py Index: test/Unit/lit.cfg.py =================================================================== --- test/Unit/lit.cfg.py +++ test/Unit/lit.cfg.py @@ -36,12 +36,14 @@ config.environment[symbolizer] = os.environ[symbolizer] shlibpath_var = '' -if platform.system() == 'Linux': +if platform.system() in ['Linux', 'FreeBSD']: shlibpath_var = 'LD_LIBRARY_PATH' elif platform.system() == 'Darwin': shlibpath_var = 'DYLD_LIBRARY_PATH' elif platform.system() == 'Windows': shlibpath_var = 'PATH' +else: + raise EnvironmentError('unknown platform.system()') # in stand-alone builds, shlibdir is clang's build tree # while llvm_libs_dir is installed LLVM (and possibly older clang)
Index: test/Unit/lit.cfg.py =================================================================== --- test/Unit/lit.cfg.py +++ test/Unit/lit.cfg.py @@ -36,12 +36,14 @@ config.environment[symbolizer] = os.environ[symbolizer] shlibpath_var = '' -if platform.system() == 'Linux': +if platform.system() in ['Linux', 'FreeBSD']: shlibpath_var = 'LD_LIBRARY_PATH' elif platform.system() == 'Darwin': shlibpath_var = 'DYLD_LIBRARY_PATH' elif platform.system() == 'Windows': shlibpath_var = 'PATH' +else: + raise EnvironmentError('unknown platform.system()') # in stand-alone builds, shlibdir is clang's build tree # while llvm_libs_dir is installed LLVM (and possibly older clang)
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits