vcpkg
vcpkg copied to clipboard
[catch2] Update to 3.1.0
Update catch2 from 3.0.1 to 3.1.0. Changelog : https://github.com/catchorg/Catch2/releases/tag/v3.1.0
Since this commit, if not built with Bazel support, catch2 call std::getenv. Unfortunately, UWP doesn't support this function and according to the documentation, there's no workaround for it. Should we deprecate the support of UWP for this port, or should we try to patch it?
@RT222 ,Thanks for your pr, we should try to fix it first, and if we can't fix it in the end we can explain why and drop UWP support
@RT222, ping for response.
The problem is that I have no experience with UWP whatsoever, and in any case, according to the Microsoft documentation, there's no workaround for this specific issue. Therefore, the only fix I can imagine is to revert the problematic changes with a patch, but this would be ugly and hard to maintain.
Here's a simple patch (that you could also upstream I guess). I didn't test it so no guarantees.
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 4465831d..b738edcd 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -17,6 +17,9 @@ namespace {
bool provideBazelReporterOutput() {
#ifdef CATCH_CONFIG_BAZEL_SUPPORT
return true;
+#elif defined( WINAPI_FAMILY )
+ // UWP doesn't support environment variables.
+ return false;
#else
# if defined( _MSC_VER )
Thanks @quyykk, I added a patch based on your suggestion to disable the Bazel reporter on UWP. The port builds with success everywhere now.
Thanks!