Skip to content

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 23, 2025

This removes a weird interconnection between libc++'s own build and the configuration of the test suite, which should be disjoint. After this patch, Google Benchmark gets built using the same flags used for the rest of the test suite, which provides additional flexibility.

This removes a weird interconnection between libc++'s own build
and the configuration of the test suite, which should be disjoint.
After this patch, Google Benchmark gets built using the same flags
used for the rest of the test suite, which provides additional
flexibility.
Copy link

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r origin/main...HEAD libcxx/utils/libcxx/test/config.py libcxx/utils/libcxx/test/format.py

⚠️
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing origin/main to the base branch/commit you want to compare against.
⚠️

View the diff from darker here.
--- format.py	2025-09-23 18:52:07.000000 +0000
+++ format.py	2025-09-23 18:55:10.036861 +0000
@@ -346,19 +346,28 @@
                         test.getFullName()
                     ),
                 )
             # TODO: %{libcxx-dir} is not a base substitution
             # TODO: We're building Google Benchmark for every test, which is super wasteful
-            configure = ['cmake', '-S', '%{libcxx-dir}/../third-party/benchmark', '-B', '%T/gbench-build']
-            configure += ['-D', 'CMAKE_INSTALL_PREFIX=%T/gbench']
-            configure += ['-D', 'CMAKE_CXX_COMPILER=%{cxx}']
-            configure += ['-D', 'CMAKE_BUILD_TYPE=Release']
-            configure += ['-D', 'CMAKE_CXX_FLAGS="%{flags} %{compile_flags} %{link_flags} -Wno-error"']
-            configure += ['-D', 'BENCHMARK_ENABLE_TESTING=OFF']
-            configure += ['-D', 'BENCHMARK_ENABLE_WERROR=OFF']
-            configure += ['-D', 'BENCHMARK_INSTALL_DOCS=OFF']
-            build = ['cmake', '--build', '%T/gbench-build', '--target', 'install']
+            configure = [
+                "cmake",
+                "-S",
+                "%{libcxx-dir}/../third-party/benchmark",
+                "-B",
+                "%T/gbench-build",
+            ]
+            configure += ["-D", "CMAKE_INSTALL_PREFIX=%T/gbench"]
+            configure += ["-D", "CMAKE_CXX_COMPILER=%{cxx}"]
+            configure += ["-D", "CMAKE_BUILD_TYPE=Release"]
+            configure += [
+                "-D",
+                'CMAKE_CXX_FLAGS="%{flags} %{compile_flags} %{link_flags} -Wno-error"',
+            ]
+            configure += ["-D", "BENCHMARK_ENABLE_TESTING=OFF"]
+            configure += ["-D", "BENCHMARK_ENABLE_WERROR=OFF"]
+            configure += ["-D", "BENCHMARK_INSTALL_DOCS=OFF"]
+            build = ["cmake", "--build", "%T/gbench-build", "--target", "install"]
 
             steps = [
                 "rm -rf %T/gbench %T/gbench-build",
                 "%dbg(CONFIGURING GBENCH) " + " ".join(configure),
                 "%dbg(BUILDING GBENCH) " + " ".join(build),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant