-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[libcxx] [test] Merge the MinGW static/shared test config files #111759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These were split in 0e8208e, with the only functional difference between them at the time being `--prepend_env PATH=%{lib-dir}` in the static config and `--prepend_env PATH=%{install-prefix}/bin` in the shared library config. However this difference is unnecessary - the static library config doesn't need any `--prepend_env` argument at all. Before 0e8208e, both configurations used the same config file, where the `--prepend_env` argument was unnecessary but benign in the static case. Reduce the unnecessary config duplication in this case, and return these configs to using one single config file for both setups.
@llvm/pr-subscribers-libcxx Author: Martin Storsjö (mstorsjo) ChangesThese were split in 0e8208e, with the only functional difference between them at the time being However this difference is unnecessary - the static library config doesn't need any Reduce the unnecessary config duplication in this case, and return these configs to using one single config file for both setups. Full diff: https://github.com/llvm/llvm-project/pull/111759.diff 3 Files Affected:
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index f1942e963ccc31..75c926f5432aea 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -131,11 +131,7 @@ option(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-gcc.cfg.in")
elseif(MINGW)
- if (LIBCXX_ENABLE_SHARED)
- set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-mingw.cfg.in")
- else()
- set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-static-mingw.cfg.in")
- endif()
+ set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-mingw.cfg.in")
elseif(WIN32) # clang-cl
if (LIBCXX_ENABLE_SHARED)
set(LIBCXX_DEFAULT_TEST_CONFIG "llvm-libc++-shared-clangcl.cfg.in")
diff --git a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
similarity index 92%
rename from libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
rename to libcxx/test/configs/llvm-libc++-mingw.cfg.in
index 8868f0cadd2aa2..01c4d58ca05f96 100644
--- a/libcxx/test/configs/llvm-libc++-shared-mingw.cfg.in
+++ b/libcxx/test/configs/llvm-libc++-mingw.cfg.in
@@ -1,5 +1,5 @@
# This testing configuration handles running the test suite against LLVM's libc++
-# using a DLL with MinGW/Clang on Windows.
+# using either a DLL or a static library, with MinGW/Clang on Windows.
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
diff --git a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in b/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
deleted file mode 100644
index fb2f9065898a54..00000000000000
--- a/libcxx/test/configs/llvm-libc++-static-mingw.cfg.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This testing configuration handles running the test suite against LLVM's libc++
-# using a static library with MinGW/Clang on Windows.
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-config.substitutions.append(('%{flags}', ''))
-config.substitutions.append(('%{compile_flags}',
- '-nostdinc++ -I %{target-include-dir} -I %{include-dir} -I %{libcxx-dir}/test/support'
-))
-config.substitutions.append(('%{link_flags}',
- '-nostdlib++ -L %{lib-dir} -lc++'
-))
-config.substitutions.append(('%{exec}',
- '%{executor} --execdir %T --prepend_env PATH=%{lib-dir} -- '
-))
-
-import os, site
-site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.config
-libcxx.test.config.configure(
- libcxx.test.params.DEFAULT_PARAMETERS,
- libcxx.test.features.DEFAULT_FEATURES,
- config,
- lit_config
-)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the simplification. I'm not certain why I ended up duplicating it, I guess I didn't know both could work with the same config. I'd swear this was in reaction to a CI failure, but I'm probably mistaken if this patch passes CI.
IIRC, the shared case required changing the path (but as the static case doesn’t use that path, it didn’t break and require changing), so you probably, understandably, thought it needed to stay as it was. I’ll merge once we have a green enough CI run of it :-) |
…#111759) These were split in 0e8208e, with the only functional difference between them at the time being `--prepend_env PATH=%{lib-dir}` in the static config and `--prepend_env PATH=%{install-prefix}/bin` in the shared library config. However this difference is unnecessary - the static library config doesn't need any `--prepend_env` argument at all. Before 0e8208e, both configurations used the same config file, where the `--prepend_env` argument was unnecessary but benign in the static case. Reduce the unnecessary config duplication in this case, and return these configs to using one single config file for both setups.
These were split in 0e8208e, with the only functional difference between them at the time being
--prepend_env PATH=%{lib-dir}
in the static config and--prepend_env PATH=%{install-prefix}/bin
in the shared library config.However this difference is unnecessary - the static library config doesn't need any
--prepend_env
argument at all. Before 0e8208e, both configurations used the same config file, where the--prepend_env
argument was unnecessary but benign in the static case.Reduce the unnecessary config duplication in this case, and return these configs to using one single config file for both setups.