[lld] r327966 - Revert r327964 "lit: Make config.llvm_libxml2_enabled an int, not a string"

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 20 03:43:02 PDT 2018


Author: hans
Date: Tue Mar 20 03:43:02 2018
New Revision: 327966

URL: http://llvm.org/viewvc/llvm-project?rev=327966&view=rev
Log:
Revert r327964 "lit: Make config.llvm_libxml2_enabled an int, not a string"

It seems @LLVM_LIBXML2_ENABLED@ doesn't always get set to 0 when not available,
but to nothing, which broke parsing of lit.site.cfg.py.

> @LLVM_LIBXML2_ENABLED@ will be replaced with 0 or 1. Putting quotes
> around that is unnecessary and just makes it harder to use the value.
> This matches what have_zlib does below.
>
> This also puts the flag together with the feature-related ones instead
> of the path-related flags.

Modified:
    lld/trunk/test/lit.cfg.py
    lld/trunk/test/lit.site.cfg.py.in

Modified: lld/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.cfg.py?rev=327966&r1=327965&r2=327966&view=diff
==============================================================================
--- lld/trunk/test/lit.cfg.py (original)
+++ lld/trunk/test/lit.cfg.py Tue Mar 20 03:43:02 2018
@@ -78,11 +78,11 @@ config.environment['LLD_IN_TEST'] = '1'
 # Indirectly check if the mt.exe Microsoft utility exists by searching for
 # cvtres, which always accompanies it.  Alternatively, check if we can use
 # libxml2 to merge manifests.
-if lit.util.which('cvtres', config.environment['PATH']) or \
-        config.llvm_libxml2_enabled:
+if (lit.util.which('cvtres', config.environment['PATH'])) or \
+        (config.llvm_libxml2_enabled == '1'):
     config.available_features.add('manifest_tool')
 
-if config.llvm_libxml2_enabled:
+if (config.llvm_libxml2_enabled == '1'):
     config.available_features.add('libxml2')
 
 tar_executable = lit.util.which('tar', config.environment['PATH'])

Modified: lld/trunk/test/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/lit.site.cfg.py.in?rev=327966&r1=327965&r2=327966&view=diff
==============================================================================
--- lld/trunk/test/lit.site.cfg.py.in (original)
+++ lld/trunk/test/lit.site.cfg.py.in Tue Mar 20 03:43:02 2018
@@ -4,6 +4,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+config.llvm_libxml2_enabled = "@LLVM_LIBXML2_ENABLED@"
 config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
 config.lld_obj_root = "@LLD_BINARY_DIR@"
 config.lld_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
@@ -11,7 +12,6 @@ config.lld_tools_dir = "@LLVM_RUNTIME_OU
 config.target_triple = "@TARGET_TRIPLE@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.have_zlib = @HAVE_LIBZ@
-config.llvm_libxml2_enabled = @LLVM_LIBXML2_ENABLED@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.




More information about the llvm-commits mailing list