[libcxx-commits] [libcxx] [libcxx] Add `LIBCXX_HAS_TERMINAL_AVAILABLE` CMake option to disable `print` terminal checks (PR #99259)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Aug 5 12:54:11 PDT 2024
================
@@ -199,7 +199,7 @@ _LIBCPP_HIDE_FROM_ABI inline bool __is_terminal([[maybe_unused]] FILE* __stream)
// the behavior in the test. This is not part of the public API.
# ifdef _LIBCPP_TESTING_PRINT_IS_TERMINAL
return _LIBCPP_TESTING_PRINT_IS_TERMINAL(__stream);
-# elif _LIBCPP_AVAILABILITY_HAS_PRINT == 0
+# elif _LIBCPP_AVAILABILITY_HAS_PRINT == 0 || defined(_LIBCPP_HAS_NO_TERMINAL)
----------------
ldionne wrote:
When you run the test suite with `LIBCXX_HAS_NO_TERMINAL`, I assume you see at least a few tests failing, right? At least some tests for `std::print` should be failing. We would need to add something similar to https://github.com/llvm/llvm-project/blob/d1b294029004e7c3220ed46e2b06addd32490745/libcxx/utils/libcxx/test/features.py#L383 so that the test suite can recognize the lack of a terminal and `XFAIL` or `UNSUPPORTED` the right tests based on it.
For ultimate consistency, I think I would request that you actually add a new CI job for this setting. You can look at what we're doing in e.g. https://github.com/llvm/llvm-project/blob/d1b294029004e7c3220ed46e2b06addd32490745/libcxx/utils/ci/run-buildbot#L467 and then https://github.com/llvm/llvm-project/blob/d1b294029004e7c3220ed46e2b06addd32490745/.github/workflows/libcxx-build-and-test.yaml#L148
In practice, it's probably way overkill to add an actual CI configuration just for this tiny setting, but this is what we've been doing and I'd like us to be consistent. I will make it a priority to figure out a story for merging some of these CI jobs together -- I think we probably want to have a nightly build with all the individual configurations, but have the per-PR CI only run a few merged configurations. But anyway, I'll handle that part, you only need to add a new job like we've done for the other carve-outs like this.
https://github.com/llvm/llvm-project/pull/99259
More information about the libcxx-commits
mailing list