ctest: macOS `MallocGuardEdges` env var seems to interfere with OS detection
Consider this VTK build submission:
https://open.cdash.org/viewTest.php?onlynotrun&buildid=10040042
Notice the "OS name".
I enable the environment variable MallocGuardEdges
to check for memory overruns when tests are run. (see man malloc
on macOS). This causes a log message, for example:
% MallocGuardEdges=1 sw_vers
sw_vers(33753,0x202738f40) malloc: adding guard pages for large allocator blocks
ProductName: macOS
ProductVersion: 14.7
BuildVersion: 23H124
versus without it:
% sw_vers
ProductName: macOS
ProductVersion: 14.7
BuildVersion: 23H124
I believe this is why those 3 fields are scrambled. You should be able to look for ProductName
then take the text after it.