[libcxx-commits] [libcxx] [libc++] Fixes lit portability issues. (PR #72435)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 15 15:51:53 PST 2023


================
@@ -29,7 +29,13 @@ def appendToSubstitution(substitutions, key, value):
     return [(k, v + " " + value) if k == key else (k, v) for (k, v) in substitutions]
 
 
-std = getSubstitution("%{cxx_std}", config)
+# External users of the LLVM test suite might not have set the substitutions.
+std = ""
+try:
+    std = getSubstitution("%{cxx_std}", config)
+except:
+    pass
----------------
ldionne wrote:

Oh, hmmm yeah that's quite a setup you folks have there. Normally, the intended way to use the test suite is to provide only this config file: https://github.com/llvm/llvm-project/blob/main/libcxx/test/configs/ibm-libc%2B%2B-shared.cfg.in (for example).

You set up the flags that are required for your stdlib, compiler, platform, etc, and then everything else should follow from that. I'm not sure why you're doing something significantly different here but I'd like to understand (and perhaps we can change a few things so that you folks can drop your custom format). As it stands, IIUC you basically use the contents of our test suite but almost none of our "Lit setup", and I think supporting that reliably is pretty much a lost battle.

The raw string regexes are definitely a non-controversial improvement. This change here I'm not like "over my dead body" against, but I think it does beg the question of how the test suite is actually being consumed and we should figure out the answer to that (and agree on what we want to support).

https://github.com/llvm/llvm-project/pull/72435


More information about the libcxx-commits mailing list