vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[catch2] Update to 3.1.0

Open RT2Code opened this issue 2 years ago • 5 comments

Update catch2 from 3.0.1 to 3.1.0. Changelog : https://github.com/catchorg/Catch2/releases/tag/v3.1.0

RT2Code avatar Jul 19 '22 23:07 RT2Code

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?

RT2Code avatar Jul 20 '22 01:07 RT2Code

@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

JonLiu1993 avatar Jul 20 '22 02:07 JonLiu1993

@RT222, ping for response.

JonLiu1993 avatar Aug 09 '22 06:08 JonLiu1993

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.

RT2Code avatar Aug 09 '22 15:08 RT2Code

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 )

quyykk avatar Aug 09 '22 22:08 quyykk

Thanks @quyykk, I added a patch based on your suggestion to disable the Bazel reporter on UWP. The port builds with success everywhere now.

RT2Code avatar Sep 01 '22 16:09 RT2Code

Thanks!

JavierMatosD avatar Sep 02 '22 17:09 JavierMatosD