From 9e27e52d4b0fee729f9a3bef710efed290ef9900 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Fri, 15 Nov 2019 08:05:29 -0500 Subject: KWSys 2019-11-15 (329d8c7c) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 329d8c7c907353999827c02a7af341e57aff90aa (master). Upstream Shortlog ----------------- Brad King (1): 2581cfd1 SystemTools: Update EnableMSVCDebugHook to simulate "Retry" --- SystemTools.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index dcf05da..39873e6 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4666,8 +4666,12 @@ void SystemTools::ClassFinalize() # include namespace KWSYS_NAMESPACE { -static int SystemToolsDebugReport(int, char* message, int*) +static int SystemToolsDebugReport(int, char* message, int* ret) { + if (ret) { + // Pretend user clicked on Retry button in popup. + *ret = 1; + } fprintf(stderr, "%s", message); fflush(stderr); return 1; // no further reporting required -- cgit v0.12 From a4c19cb895f6275c5ff1a3991a117df1ad27cf15 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 15 Nov 2019 09:23:47 -0500 Subject: Windows: Restore suppression of error report popups in CI builds On Windows, libuv uses `_CrtSetReportHook` to install a handler it uses to suppress assertions on invalid file descriptors in `_get_osfhandle`. This removes the handler we install in CI environments to suppress interactive popups. Move installation of our handler to after libuv is initialized so that our handler is actually used. Unfortunately this also removes libuv's handler and so may cause Debug builds under CI to abort on invalid file descriptors instead of simply converting them to `INVALID_HANDLE_VALUE`. If this becomes a problem we may need to modify libuv to make its hook more configurable. --- Source/CPack/cpack.cxx | 1 - Source/cmSystemTools.cxx | 2 ++ Source/cmakemain.cxx | 1 - Source/ctest.cxx | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx index d7868f3..dc31623 100644 --- a/Source/CPack/cpack.cxx +++ b/Source/CPack/cpack.cxx @@ -115,7 +115,6 @@ int main(int argc, char const* const* argv) argc = args.argc(); argv = args.argv(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(argv[0]); cmCPackLog log; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c4a4220..17d32c6 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -814,6 +814,8 @@ void cmSystemTools::InitializeLibUV() # else _fmode = _O_TEXT; # endif + // Replace libuv's report handler with our own to suppress popups. + cmSystemTools::EnableMSVCDebugHook(); #endif } diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index baf975e..d817971 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -683,7 +683,6 @@ int main(int ac, char const* const* av) ac = args.argc(); av = args.argv(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(av[0]); if (ac > 1) { diff --git a/Source/ctest.cxx b/Source/ctest.cxx index a7b11cd..a9fcc84 100644 --- a/Source/ctest.cxx +++ b/Source/ctest.cxx @@ -164,7 +164,6 @@ int main(int argc, char const* const* argv) argv = encoding_args.argv(); cmSystemTools::DoNotInheritStdPipes(); - cmSystemTools::EnableMSVCDebugHook(); cmSystemTools::InitializeLibUV(); cmSystemTools::FindCMakeResources(argv[0]); -- cgit v0.12