On Sat, Oct 9, 2021 at 3:56 AM Liliana Marie Prikler < liliana.prikler@gmail.com> wrote: > for the purposes of GNU Guix, #:parallel-build? and #:parallel-tests? > are distinct flags and the latter (if implemented) would apply to the > check phase. Our cmake-build-system in this case defers to gnu-build- > system, which ought to insert -jN as you described. > On Thu, Oct 21, 2021 at 3:30 PM Ludovic Courtès wrote: > Does CMake generate makefiles targets that would allow tests to run in > parallel? How does that even work in CMake? > Hi Liliana and Ludo’, The cmake-build-system does defer to gnu-build-system, which calls `make test -jN`; however, CMake generated Makefile specifies 'test' as a single target (the Ninja generator suffers from the same issue) so `ctest` is run without parallelism. To run CMake tests with parallelism the cmake-build-system should directly call `ctest` with the configured parallelism (same '-jN' argument). The cmake-build-system's check method is essentially untouched from March, 2013 (commit c6bded8a) so this issue has existed from the beginning. I made an inelegant patch to my local guix repo, essentially replacing cmake-build-system:check with a copy of gnu-build-system:check and changing 'apply invoke "make" test-target' to 'apply invoke "ctest"'. This works, although the package I was working on requires parallel tests to be disabled. Once the expectation is set that code will be run serially it is difficult to change the default to parallel execution. It seems that we should at a minimum document the issue in cmake-build-system:check. We could patch cmake-build-system to enable test parallelism and explicitly disable that setting for packages which succeed before but fail after making the change. What do you think? Greg