Reland [lldb] Explicitly use the configuration architecture when building test execut...
authorRaphael Isemann <teemperor@gmail.com>
Thu, 22 Oct 2020 13:10:22 +0000 (15:10 +0200)
committerRaphael Isemann <teemperor@gmail.com>
Thu, 5 Nov 2020 14:13:48 +0000 (15:13 +0100)
This originally broke the TestQuoting which explicitly called buildDefault
instead of calling build() and marking the test as no_debug_info_test.
TestQuoting has been rewritten by now and is using `build`, so this should now
pass on all platforms.

Original summary:

The Darwin builder currently assumes in `getArchCFlags` that the passed `arch`
value is an actual string it can string.join with vendor/os/version/env strings:

```
   triple = '-'.join([arch, vendor, os, version, env])
```

However this is not true for most tests as we just pass down the `arch=None`
default value from `TestBase.build`. This causes that if we actually end up in
this function we just error out when concatenating `None` with the other actual
strings of vendor/os/version/env. What we should do instead is check that if
there is no test-specific architecture that we fall back to the configuration's
architecture value.

It seems we already worked around this in `builder.getArchSpec` by explicitly
falling back to the architecture specified in the configuration.

This patch just moves this fallback logic to the top `build` function so that it
affects all functions called from `TestBase.build`.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D89056

lldb/packages/Python/lldbsuite/test/builders/builder.py
lldb/packages/Python/lldbsuite/test/lldbtest.py

index fbfa867..6c95842 100644 (file)
@@ -93,11 +93,7 @@ class Builder:
         Helper function to return the key-value string to specify the architecture
         used for the make system.
         """
-        arch = architecture if architecture else None
-        if not arch and configuration.arch:
-            arch = configuration.arch
-
-        return ("ARCH=" + arch) if arch else ""
+        return ("ARCH=" + architecture) if architecture else ""
 
     def getCCSpec(self, compiler):
         """
index 81110f9..73007ca 100644 (file)
@@ -2607,6 +2607,9 @@ FileCheck output:
         """Platform specific way to build the default binaries."""
         module = builder_module()
 
+        if not architecture and configuration.arch:
+            architecture = configuration.arch
+
         dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
         if self.getDebugInfo() is None:
             return self.buildDefault(architecture, compiler, dictionary)