[libcxx-commits] [PATCH] D69169: [libcxx] Force-cache LIBCXX_CXX_ABI_LIBRARY_PATH

Sergej Jaskiewicz via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 18 08:00:59 PDT 2019


broadwaylamb created this revision.
broadwaylamb added reviewers: jroelofs, bcraig, ldionne, EricWF.
broadwaylamb added a project: libc++.
Herald added subscribers: dexonsmith, christof, mgorny.
Herald added a reviewer: mclow.lists.

The `LIBCXX_CXX_ABI_LIBRARY_PATH` CMake variable is cached once in
libcxx/cmake/Modules/HandleLibCXXABI.cmake in the `setup_abi_lib` macro,
and then cached again in libcxx/test/CMakeLists.txt. There, if it is
not set to a value, it is by default set to `LIBCXX_LIBRARY_DIR`.

However, this new value is not actually cached, because the old (empty)
value has been already cached. Use the `FORCE` CMake flag so that it
is saved to the cache.

This should not break anything, because the code changed here previously
had no effect, when it should have.

Additionally, fixed a small error in libcxx/utils/libcxx/test/tracing.py
that prevented tracing in Python 3 due to `AttributeError`.

The correct way to get a function name in Python 3 is to use
the `__name__` attribute.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69169

Files:
  libcxx/test/CMakeLists.txt
  libcxx/utils/libcxx/test/tracing.py


Index: libcxx/utils/libcxx/test/tracing.py
===================================================================
--- libcxx/utils/libcxx/test/tracing.py
+++ libcxx/utils/libcxx/test/tracing.py
@@ -14,7 +14,7 @@
     def wrapper(*args, **kwargs):
         kwarg_strs = ['{}={}'.format(k, v) for (k, v) in kwargs]
         arg_str = ', '.join([str(a) for a in args] + kwarg_strs)
-        call_str = '{}({})'.format(function.func_name, arg_str)
+        call_str = '{}({})'.format(function.__name__, arg_str)
 
         # Perform the call itself, logging before, after, and anything thrown.
         try:
Index: libcxx/test/CMakeLists.txt
===================================================================
--- libcxx/test/CMakeLists.txt
+++ libcxx/test/CMakeLists.txt
@@ -46,7 +46,7 @@
 # directory.
 if (NOT LIBCXX_CXX_ABI_LIBRARY_PATH)
   set(LIBCXX_CXX_ABI_LIBRARY_PATH "${LIBCXX_LIBRARY_DIR}" CACHE PATH
-      "The path to libc++abi library.")
+      "The path to libc++abi library." FORCE)
 endif()
 
 set(LIBCXX_TARGET_INFO "libcxx.test.target_info.LocalTI" CACHE STRING


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69169.225621.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20191018/408afcf3/attachment.bin>


More information about the libcxx-commits mailing list