[PATCH] D30155: [clang-tools-extra] [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build
This revision was automatically updated to reflect the committed changes. Closed by commit rL309979: [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build (authored by mgorny). Changed prior to commit: https://reviews.llvm.org/D30155?vs=89062=109616#toc Repository: rL LLVM https://reviews.llvm.org/D30155 Files: clang-tools-extra/trunk/test/Unit/lit.cfg clang-tools-extra/trunk/test/lit.cfg clang-tools-extra/trunk/test/lit.site.cfg.in Index: clang-tools-extra/trunk/test/lit.site.cfg.in === --- clang-tools-extra/trunk/test/lit.site.cfg.in +++ clang-tools-extra/trunk/test/lit.site.cfg.in @@ -7,6 +7,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_libs_dir = "@SHLIBDIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.target_triple = "@TARGET_TRIPLE@" Index: clang-tools-extra/trunk/test/lit.cfg === --- clang-tools-extra/trunk/test/lit.cfg +++ clang-tools-extra/trunk/test/lit.cfg @@ -99,10 +99,13 @@ clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path +clang_libs_dir = getattr(config, 'clang_libs_dir', None) +if not clang_libs_dir: +lit_config.fatal('No Clang libs dir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -path = os.path.pathsep.join((llvm_libs_dir, +path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir, config.environment.get('LD_LIBRARY_PATH',''))) config.environment['LD_LIBRARY_PATH'] = path Index: clang-tools-extra/trunk/test/Unit/lit.cfg === --- clang-tools-extra/trunk/test/Unit/lit.cfg +++ clang-tools-extra/trunk/test/Unit/lit.cfg @@ -41,14 +41,17 @@ shlibpath_var = 'PATH' # Point the dynamic loader at dynamic libraries in 'lib'. +shlibdir = getattr(config, 'shlibdir', None) +if not shlibdir: +lit_config.fatal('No shlibdir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -shlibpath = os.path.pathsep.join((llvm_libs_dir, +shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir, config.environment.get(shlibpath_var,''))) # Win32 seeks DLLs along %PATH%. -if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): -shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath)) +if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir): +shlibpath = os.path.pathsep.join((shlibdir, shlibpath)) config.environment[shlibpath_var] = shlibpath Index: clang-tools-extra/trunk/test/lit.site.cfg.in === --- clang-tools-extra/trunk/test/lit.site.cfg.in +++ clang-tools-extra/trunk/test/lit.site.cfg.in @@ -7,6 +7,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_libs_dir = "@SHLIBDIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.target_triple = "@TARGET_TRIPLE@" Index: clang-tools-extra/trunk/test/lit.cfg === --- clang-tools-extra/trunk/test/lit.cfg +++ clang-tools-extra/trunk/test/lit.cfg @@ -99,10 +99,13 @@ clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path +clang_libs_dir = getattr(config, 'clang_libs_dir', None) +if not clang_libs_dir: +lit_config.fatal('No Clang libs dir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -path = os.path.pathsep.join((llvm_libs_dir, +path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir, config.environment.get('LD_LIBRARY_PATH',''))) config.environment['LD_LIBRARY_PATH'] = path Index: clang-tools-extra/trunk/test/Unit/lit.cfg === --- clang-tools-extra/trunk/test/Unit/lit.cfg +++ clang-tools-extra/trunk/test/Unit/lit.cfg @@ -41,14 +41,17 @@ shlibpath_var = 'PATH' # Point the dynamic loader at dynamic libraries in 'lib'. +shlibdir = getattr(config, 'shlibdir', None) +if not shlibdir: +lit_config.fatal('No shlibdir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -shlibpath = os.path.pathsep.join((llvm_libs_dir, +shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir,
[PATCH] D30155: [clang-tools-extra] [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. Looks reasonable to me. Repository: rL LLVM https://reviews.llvm.org/D30155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D30155: [clang-tools-extra] [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build
mgorny added a comment. Another ping. @beanz, any chance you could take a look at this? Repository: rL LLVM https://reviews.llvm.org/D30155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D30155: [clang-tools-extra] [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build
mgorny added a comment. Ping. Repository: rL LLVM https://reviews.llvm.org/D30155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D30155: [clang-tools-extra] [test] Fix clang library dir in LD_LIBRARY_PATH For stand-alone build
mgorny created this revision. mgorny added a project: clang-tools-extra. Prepend the clang library directory (determined using SHLIBDIR, alike in clang) to the LD_LIBRARY_PATH to ensure that just-built clang libraries will be used instead of a previous installed version. When a stand-alone build is performed, LLVM_LIBS_DIR contains the path to installed LLVM library directory. The same directory frequently contains a previously installed version of clang. SHLIBDIR, on the other hand, is always the build-tree directory, and therefore contains the freshly built clang libraries. In a non-stand-alone build, both paths will be the same and therefore including them both will not cause any issues. Repository: rL LLVM https://reviews.llvm.org/D30155 Files: test/Unit/lit.cfg test/lit.cfg test/lit.site.cfg.in Index: test/lit.site.cfg.in === --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -7,6 +7,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_libs_dir = "@SHLIBDIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.target_triple = "@TARGET_TRIPLE@" Index: test/lit.cfg === --- test/lit.cfg +++ test/lit.cfg @@ -99,10 +99,13 @@ clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path +clang_libs_dir = getattr(config, 'clang_libs_dir', None) +if not clang_libs_dir: +lit_config.fatal('No Clang libs dir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -path = os.path.pathsep.join((llvm_libs_dir, +path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir, config.environment.get('LD_LIBRARY_PATH',''))) config.environment['LD_LIBRARY_PATH'] = path Index: test/Unit/lit.cfg === --- test/Unit/lit.cfg +++ test/Unit/lit.cfg @@ -41,14 +41,17 @@ shlibpath_var = 'PATH' # Point the dynamic loader at dynamic libraries in 'lib'. +shlibdir = getattr(config, 'shlibdir', None) +if not shlibdir: +lit_config.fatal('No shlibdir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -shlibpath = os.path.pathsep.join((llvm_libs_dir, +shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir, config.environment.get(shlibpath_var,''))) # Win32 seeks DLLs along %PATH%. -if sys.platform in ['win32', 'cygwin'] and os.path.isdir(config.shlibdir): -shlibpath = os.path.pathsep.join((config.shlibdir, shlibpath)) +if sys.platform in ['win32', 'cygwin'] and os.path.isdir(shlibdir): +shlibpath = os.path.pathsep.join((shlibdir, shlibpath)) config.environment[shlibpath_var] = shlibpath Index: test/lit.site.cfg.in === --- test/lit.site.cfg.in +++ test/lit.site.cfg.in @@ -7,6 +7,7 @@ config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.clang_tools_binary_dir = "@CLANG_TOOLS_BINARY_DIR@" config.clang_tools_dir = "@CLANG_TOOLS_DIR@" +config.clang_libs_dir = "@SHLIBDIR@" config.python_executable = "@PYTHON_EXECUTABLE@" config.target_triple = "@TARGET_TRIPLE@" Index: test/lit.cfg === --- test/lit.cfg +++ test/lit.cfg @@ -99,10 +99,13 @@ clang_tools_dir, llvm_tools_dir, config.environment['PATH'])) config.environment['PATH'] = path +clang_libs_dir = getattr(config, 'clang_libs_dir', None) +if not clang_libs_dir: +lit_config.fatal('No Clang libs dir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -path = os.path.pathsep.join((llvm_libs_dir, +path = os.path.pathsep.join((clang_libs_dir, llvm_libs_dir, config.environment.get('LD_LIBRARY_PATH',''))) config.environment['LD_LIBRARY_PATH'] = path Index: test/Unit/lit.cfg === --- test/Unit/lit.cfg +++ test/Unit/lit.cfg @@ -41,14 +41,17 @@ shlibpath_var = 'PATH' # Point the dynamic loader at dynamic libraries in 'lib'. +shlibdir = getattr(config, 'shlibdir', None) +if not shlibdir: +lit_config.fatal('No shlibdir set!') llvm_libs_dir = getattr(config, 'llvm_libs_dir', None) if not llvm_libs_dir: lit_config.fatal('No LLVM libs dir set!') -shlibpath = os.path.pathsep.join((llvm_libs_dir, +shlibpath = os.path.pathsep.join((shlibdir, llvm_libs_dir, config.environment.get(shlibpath_var,''))) # Win32