Subject: bug#70031: closed (Re: [PATCH v2 00/65] Use CMake in build-system/cmake.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 09 Jul 2025 18:25:02 +0000

Your bug report

#70031: [core-updates PATCH 00/19] Use CMake in build-system/cmake.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
70031: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70031
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [PATCH v2 00/65] Use CMake in build-system/cmake.
From: Greg Hogan <[email-masked]>
To: [email-masked]
Date: Wed, 9 Jul 2025 14:23:55 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On Tue, Oct 22, 2024 at 2:10 PM Greg Hogan <[email-masked]> wrote:
>
> This update follows the original submission in March based on a mailing
> list discussion from 3+ years ago regarding cmake-build-system tests not
> running in parallel.
>   https://lists.gnu.org/archive/html/guix-devel/2021-10/msg00055.html
>
> Additional improvements have made, allowing packages to use CMake
> features by default or by configuration rather than rewriting phases:
>
> 1) Tests can run in parallel. Make (from the gnu-build-system) treats
> ctest as a single target so cannot parallelize tests. By directly
> running ctest the tests are run with optional parallelism.
>
> 2) Alternative generators, namely Ninja. When configured with an
> alternative generator the CMake build, check, and install commands will
> use that generator and the package need not replace each phase. This is
> now simply accomplished with a #:generator argument.
>
> 3) Adds a #:test-exclude parameter to cmake-build-system, updates
> several packages to use this, and forces CMake to disable parallelism
> when :#test-parallelism is #false. Both changes were recommended by
> Zheng Junjie.
>
> 4) The CMake variable BUILD_TESTING is now set to the value of the build
> system's 'tests?' field which allows packages to optionally skip
> building tests.  Furthermore, the CMake variables are stored into and
> loaded via a 'cache' file to prevent warnings about unused variables.
>
> 5) Updates CMake and pins packages with CMake as a native-input to use
> cmake-minimal.
>
> Greg Hogan (65):
>   build-system/cmake: Parallelize tests using ctest.
>   build-system/cmake: Add generator fields.
>   build-system/qt: Add generator fields.
>   build-system/cmake: Add generator.
>   build-system/cmake: Add build.
>   build-system/cmake: Add install.
>   build-system/cmake: Add test-exclude fields.
>   build-system/qt: Add test-exclude fields.
>   build-system/cmake: Add test exclusion.
>   build-system/cmake: Optionally build tests.
>   build-system/cmake: Include ninja.
>   build-system/qt: Include ninja.
>   gnu: astroid: Remove custom phases.
>   gnu: rdma-core: Remove custom phases.
>   gnu: fish: Fix tests.
>   gnu: igraph: Fix tests.
>   gnu: inkscape: Fix tests.
>   gnu: inkscape/stable: Fix tests.
>   gnu: kirigami: Fix tests.
>   gnu: kirigami-5: Disable tests.
>   gnu: vigra: Fix tests.
>   gnu: cpp-httplib: Disable parallel tests.
>   gnu: evolution-data-server: Disable parallel tests.
>   gnu: kservice: Disable parallel tests.
>   gnu: libical: Disable parallel tests.
>   gnu: libmedfile: Disable parallel tests.
>   gnu: mbedtls-lts: Disable parallel tests.
>   gnu: scotch: Disable parallel tests.
>   gnu: srt: Disable parallel tests.
>   gnu: vulkan-loader: Disable parallel tests.
>   gnu: websocketpp: Disable parallel tests.
>   gnu: dbus-cxx: Use #:test-exclude.
>   gnu: hotspot: Use #:test-exclude.
>   gnu: kconfig-5: Use #:test-exclude.
>   gnu: nextcloud-client: Use #:test-exclude.
>   gnu: pdal: Use :#test-exclude and disable parallel tests.
>   gnu: qxmpp: Use #:test-exclude.
>   gnu: simgear: Use #:test-exclude.
>   gnu: cmake: Update to 3.30.5.
>   gnu: asymptote: Pin CMake dependency.
>   gnu: conan: Pin CMake dependency.
>   gnu: entangle: Pin CMake dependency.
>   gnu: go-mvdan-cc-editorconfig: Pin CMake dependency.
>   gnu: libdecor: Pin CMake dependency.
>   gnu: liblxi: Pin CMake dependency.
>   gnu: lxi-tools: Pin CMake dependency.
>   gnu: pantheon-calculator: Pin CMake dependency.
>   gnu: pantheon-calendar: Pin CMake dependency.
>   gnu: python-awkward-cpp: Pin CMake dependency.
>   gnu: python-contourpy: Pin CMake dependency.
>   gnu: python-keystone-engine: Pin CMake dependency.
>   gnu: python-lief: Pin CMake dependency.
>   gnu: python-optree: Pin CMake dependency.
>   gnu: python-pivy: Pin CMake dependency.
>   gnu: python-pytorch: Pin CMake dependency.
>   gnu: python-symengine: Pin CMake dependency.
>   gnu: raider: Pin CMake dependency.
>   gnu: siril: Pin CMake dependency.
>   gnu: soqt: Pin CMake dependency.
>   gnu: syndication-domination: Pin CMake dependency.
>   gnu: tigervnc-server: Pin CMake dependency.
>   gnu: trinityrnaseq: Pin CMake dependency.
>   gnu: unicorn: Pin CMake dependency.
>   gnu: wavbreaker: Pin CMake dependency.
>   gnu: xffm+: Pin CMake dependency.
>
>  doc/guix.texi                       |  33 +++++---
>  gnu/packages/astronomy.scm          |   2 +-
>  gnu/packages/bioinformatics.scm     |   4 +-
>  gnu/packages/calendar.scm           |   1 +
>  gnu/packages/cmake.scm              |  40 +++++-----
>  gnu/packages/cpp.scm                |   3 +-
>  gnu/packages/emulators.scm          |   4 +-
>  gnu/packages/engineering.scm        |   3 +-
>  gnu/packages/freedesktop.scm        |   2 +-
>  gnu/packages/games.scm              |   8 +-
>  gnu/packages/geo.scm                |   9 +--
>  gnu/packages/glib.scm               |  10 +--
>  gnu/packages/gnome.scm              |   5 +-
>  gnu/packages/golang-xyz.scm         |   2 +-
>  gnu/packages/graph.scm              |  10 ++-
>  gnu/packages/hardware.scm           |   4 +-
>  gnu/packages/image.scm              |  14 +++-
>  gnu/packages/inkscape.scm           |  12 ++-
>  gnu/packages/kde-frameworks.scm     |  21 +++--
>  gnu/packages/linux.scm              |  59 ++++++--------
>  gnu/packages/machine-learning.scm   |   2 +-
>  gnu/packages/mail.scm               |  38 +++------
>  gnu/packages/maths.scm              |   3 +-
>  gnu/packages/messaging.scm          |  17 ++--
>  gnu/packages/mp3.scm                |   2 +-
>  gnu/packages/networking.scm         |   3 +-
>  gnu/packages/package-management.scm |   2 +-
>  gnu/packages/pantheon.scm           |   4 +-
>  gnu/packages/photo.scm              |   2 +-
>  gnu/packages/plotutils.scm          |   2 +-
>  gnu/packages/python-xyz.scm         |  12 +--
>  gnu/packages/qt.scm                 |   2 +-
>  gnu/packages/shells.scm             |   9 +++
>  gnu/packages/sync.scm               |   7 +-
>  gnu/packages/syndication.scm        |   2 +-
>  gnu/packages/tls.scm                |   3 +-
>  gnu/packages/vnc.scm                |   2 +-
>  gnu/packages/vulkan.scm             |   1 +
>  gnu/packages/web.scm                |   3 +-
>  guix/build-system/cmake.scm         |  12 +++
>  guix/build-system/qt.scm            |  12 +++
>  guix/build/cmake-build-system.scm   | 120 +++++++++++++++++++---------
>  42 files changed, 293 insertions(+), 213 deletions(-)
>
>
> base-commit: 5b0afaca8a67402667ae620cc26eef06fbe144cb
> --
> 2.46.1

This patchset is included in the c++-team branch so I am closing the issue.

Subject: [core-updates PATCH 00/19] Use CMake in build-system/cmake.
From: Greg Hogan <[email-masked]>
To: [email-masked]
Cc: Greg Hogan <[email-masked]>
Date: Wed, 27 Mar 2024 14:49:03 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Following up on this discussion from 2+ years ago:
  https://lists.gnu.org/archive/html/guix-devel/2021-10/msg00055.html

The current cmake-build-system defers to gnu-build-system to build and
check packages. This patch adapts the cmake-build-system to use CMake
commands. The benefits include:

1) Tests can run in parallel. Make (from the gnu-build-system) treats
ctest as a single target so cannot parallelize tests. By directly
running ctest the tests are run with optional parallelism.

2) Alternative generators, namely Ninja. When configured with an
alternative generator the CMake build, check, and install commands will
use that generator and the package need not replace each phase.

The simplification can be seen in the included patch for astroid. Ninja
must still be included (both the module and native input) and the
generator specified:

  (use-modules
   (gnu packages ninja))

  (arguments
   (list #:generator "Ninja"))

  (native-inputs (list ninja))

This compares with the current requirement to override flags and phases:

  (arguments
   (list
    #:configure-flags #~(list "-GNinja")
    #:phases
    #~(modify-phases %standard-phases
        (replace 'build
          (lambda _
            (invoke "ninja" "-j" (number->string (parallel-job-count)))))
        (replace 'check
          (lambda* (#:key tests? #:allow-other-keys)
            (when tests?
              (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
              (invoke "ctest" "."))))
        (replace 'install
          (lambda _
            (invoke "ninja" "install"))))))

It would be nice to include the ninja module and ninja as a native input
by default when using the cmake-build-system, but I do not think this is
possible due to circular dependencies with Python and CMake, the two
supported build methods for Ninja.

Greg Hogan (19):
  build-system/cmake: Parallelize tests using ctest.
  build-system/cmake: Parameterize build system generator.
  build-system/cmake: Add build.
  build-system/cmake: Add install.
  gnu: libmedfile: Disable parallel tests.
  gnu: srt: Disable parallel tests.
  gnu: fish: Fix tests.
  gnu: vulkan-loader: Disable parallel tests.
  gnu: igraph: Move test target to check phase.
  gnu: inkscape: Move test target to check phase.
  gnu: vigra: Move test target to check phase.
  gnu: cpp-httplib: Disable parallel tests.
  gnu: libical: Disable parallel tests.
  gnu: astroid: Remove custom phases.
  gnu: websocketpp: Disable parallel tests.
  gnu: mbedtls-lts: Disable parallel tests.
  gnu: scotch: Disable parallel tests.
  gnu: evolution-data-server: Disable parallel tests.
  gnu: aws-c-common: Disable parallel tests.

 doc/guix.texi                     |  4 +++
 gnu/packages/c.scm                |  3 +-
 gnu/packages/calendar.scm         |  1 +
 gnu/packages/cpp.scm              |  3 +-
 gnu/packages/engineering.scm      |  3 +-
 gnu/packages/gnome.scm            |  1 +
 gnu/packages/graph.scm            |  5 +++-
 gnu/packages/image.scm            |  9 ++++--
 gnu/packages/inkscape.scm         |  8 ++++--
 gnu/packages/mail.scm             | 16 ++---------
 gnu/packages/maths.scm            |  3 +-
 gnu/packages/networking.scm       |  3 +-
 gnu/packages/shells.scm           |  5 ++++
 gnu/packages/tls.scm              |  3 +-
 gnu/packages/vulkan.scm           |  1 +
 gnu/packages/web.scm              |  3 +-
 guix/build-system/cmake.scm       |  4 +++
 guix/build/cmake-build-system.scm | 46 +++++++++++++++++++++++++------
 18 files changed, 85 insertions(+), 36 deletions(-)

base-commit: 656baadf83f2812c0ff79f4f2f0b5f1e927ed8a5
-- 
2.44.0