My cmake builds on GitHub Actions with Cygwin have recently started timing out at 6 hours, when they used to take 10 minutes or so.
I’ve been looking at it, and the difference in output is:
last working build:
2021-10-27T01:22:00.2370158Z /home/runneradmin
2021-10-27T01:22:00.7132038Z -- The C compiler identification is GNU 11.2.0
2021-10-27T01:22:01.1511976Z -- The CXX compiler identification is GNU 11.2.0
2021-10-27T01:22:01.3345115Z -- Detecting C compiler ABI info
2021-10-27T01:22:01.4569110Z -- Detecting C compiler ABI info - failed
2021-10-27T01:22:01.4579158Z -- Check for working C compiler: /usr/bin/cc
2021-10-27T01:22:01.8781617Z -- Check for working C compiler: /usr/bin/cc - works
First failing build:
2021-10-31T11:02:09.8670109Z /home/runneradmin
2021-10-31T11:02:10.4093577Z -- The C compiler identification is GNU 11.2.0
2021-10-31T11:02:10.9970469Z -- The CXX compiler identification is GNU 11.2.0
2021-10-31T11:02:11.2962653Z -- Detecting C compiler ABI info
2021-10-31T16:58:56.5710031Z ##[error]The operation was canceled.
2021-10-31T16:58:56.6550538Z Post job cleanup.
So the Cmake step “Detecting C compiler ABI info” is never completing.
I’ve logged details in this issue in my project - with links to build logs:
The output, in a branch where I have disabled most of the project to get faster feedback, currently is giving:
cmake version 3.20.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
Error: The operation was canceled.
What can I do to debug this problem, or has anyone seen it and already fixed it, please?
This is how I would try to get more information if it was at my desk (not part of a CI build).
Delete the entire binary directory and start fresh. Then on the initial run use --debug-trycompile. This will keep all the project files for the ABI info and other tests.
Also the CMakeFiles/CMakeError.log file should capture the compiler output when the ABI test fails.
I added the --debug-trycompile argument, but didn’t get any extra console output.
What I don’t understand is how, in a GitHub Actions job where the Cmake command hangs until the entire job times out, I can can examine the contents of any log files?
The errors you’d see would not get printed to any output for capture. They get put directly into the CMakeErrors.txt. You could try --trace-expand and similar options. If your system capture standard error than there is a good chance you’ll get details on what is happening. --trace-expand will show in great detail the commands leading up to the point of error.
It looks like CMake is hanging in the middle of the try_compile at 2021-12-01T17:45:20.3501162Z.
What’s confusing to me is the Called from: lines from 2021-12-01T17:45:20.3507424Z and later.
They don’t show what CMake command is being executed! The output -- The CXX compiler identification is GNU 11.2.0 and -- Detecting C compiler ABI info are from message commands well before the try_compile command.
When try_compile runs its given an infinite timeout when spawning the build tool to build the project. I think the build tool console output gets redirected back to CMake so we cannot see what goes wrong.
The timeout 10 cmake ... invocation prints the “Timed out” message.
But this explains why you don’t get a CMakeError.log file. CMake doesn’t generate an error until after returning from a failed try_compile.
All that being said. If you use find you should see the project that CMake generates for the try_compile. You should be able to run make in that directory and see if it can build the project or if make is the program that is hanging.