Can ctest be run on read only file system

Hey, hope it finds you guys well.

Recently we are trying to run ctest on read-only file system(kind of a sim farm) and it hits below error. Searching on the internet does not find any related topics. Wonder if it’s doable? Is there a flag for me to turn off the temp write when calling ctest?
possible related code piece: https://gitlab.kitware.com/cmake/cmake/-/blob/master/Source/CTest/cmCTestTestHandler.cxx#L1953

13:15:06  WARNING: Failed to assemble tests:
13:15:06  Error assembling ***/buildsystem/tests/cmake/library
13:15:06  java.util.concurrent.ExecutionException: ***.UniverseTestAssemblerImpl$TestAssemblyException: Non-zero return code while assembling tests for codebase ***/cmake/library and universe ***: Test listing failed: 1 stderr: (CMake Error: Cannot open file for write: /build/build/ts/buildsystem/tests/cmake/library/c/build/Testing/Temporary/LastTest.log.tmp
13:15:06  CMake Error: : System Error: Read-only file system
13:15:06  cmakectest: Unable list tests: Command '['/build/build/ext/public/cmake/dist/bin/ctest', '--show-only=json-v1']' returned non-zero exit status 8.
13:15:06  Errors encountered during test discovery; cannot continue.
13:15:06  Build failed with exit code 1
13:15:06  ) stdout: (), caused by:

Thanks
Haocheng Liu

Hi Haocheng!

Can you see what path it is trying to write (strace?). I suspect it is a log file of some kind that may be prepped in main or somewhere similarly high-level.

It is trying to open Testing/Temporary/LastTest.log.tmp within the build directory in write mode (even though we’re passing --show-only!).

It seems that this file is only cared about if something went wrong. It seems that --output-on-failure will suppress this behavior. Does that flag work?

hey Ben! Don’t forget send my regards to depp if he still remembers me🤔

Leif knows much more about the issue than me. Please see his response

I thought that would just cause failing tests’ output to be printed, but in this case we aren’t running any tests, just listing them. But I’ll try that and get back to you.