Commit a4c19cb8 authored by Brad King's avatar Brad King

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.
parent 0b9f1cc9
......@@ -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;
......
......@@ -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
}
......
......@@ -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) {
......
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment