From patchwork Wed Mar 27 14:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Hogan X-Patchwork-Id: 2405 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4207727BBEA; Wed, 27 Mar 2024 14:50:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A32CB27BBE9 for ; Wed, 27 Mar 2024 14:50:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpUbN-0008Dp-1Z; Wed, 27 Mar 2024 10:50:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpUbK-0008D8-NT for guix-patches@gnu.org; Wed, 27 Mar 2024 10:50:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpUbK-0007Pw-DB for guix-patches@gnu.org; Wed, 27 Mar 2024 10:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpUbK-0000d4-1b for guix-patches@gnu.org; Wed, 27 Mar 2024 10:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70031] [core-updates PATCH 00/19] Use CMake in build-system/cmake. Resent-From: Greg Hogan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 27 Mar 2024 14:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70031 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70031@debbugs.gnu.org Cc: Greg Hogan X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17115509682334 (code B ref -1); Wed, 27 Mar 2024 14:50:01 +0000 Received: (at submit) by debbugs.gnu.org; 27 Mar 2024 14:49:28 +0000 Received: from localhost ([127.0.0.1]:38059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpUam-0000bZ-7c for submit@debbugs.gnu.org; Wed, 27 Mar 2024 10:49:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:39194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpUai-0000bL-47 for submit@debbugs.gnu.org; Wed, 27 Mar 2024 10:49:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpUac-0005oa-JI for guix-patches@gnu.org; Wed, 27 Mar 2024 10:49:18 -0400 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpUaa-0007JX-9X for guix-patches@gnu.org; Wed, 27 Mar 2024 10:49:18 -0400 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6e6d089cad0so2010337a34.3 for ; Wed, 27 Mar 2024 07:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=greghogan-com.20230601.gappssmtp.com; s=20230601; t=1711550954; x=1712155754; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=BHvZJlrM2vOPPsn1u6r+5+UGf6KH2T9O/Z6z4eHQCXw=; b=g1dbj1KGTG0wPRfjch3lYnX3UXjhqU+Zkx6a3itHFXirmB7JyUWYejyukPMR7aCoFo Q/fYjM4gCBVrS+2+Xk0JfGyE4oha4rFsJGNrd/IlDZTFBi3AoOtqQTCtf8/zXtN6kbG/ od46NgsAuxAbnur0T5vbW1LniSeuGS7oTmj16FQsejuJnWMhR42+ZGBU3yymWxInAUyk 2n6TY2XxCm0jyojHZmsN0rkCs2oYem/jFjz7S1GWtdNU2SMIVt3qRDoatI1NWkWPm3Ik 6XSmqb682fehgUP9ns3bRB0O//mUNZFXsTtHVQc9xz/+WI/IdAk5c5tRHOJ5Gh12TD8n 9bMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711550954; x=1712155754; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=BHvZJlrM2vOPPsn1u6r+5+UGf6KH2T9O/Z6z4eHQCXw=; b=ewXS3ijS3hcvXRxcip9rNG7hlsWu9gzqtKCDoS/bwheNBrXljyJDAg1kBq8op5v+wP 8wwgODLR29TwQKAg9ZvDXaTiKpoivLkGHclvVlTTo/S4bWvwewfk+5ifq7tRvkNLnUe4 F9VOpHzMuC7SGfwHl3Ago4wfoK+Q5NKZgLmvMSc8g1LZDhtKW0zwOJanvMWioPm+ps94 bIhHfmFkxyDUAk8ZGkgd40qMFumI0JAyMGHe1QxO216c6B4xza81AIcjHknayOTh4OYP ZNs0eIJt0LC3FHlq/xvfNWMwL4MFATQ29x4f/UFXpJUv6oTMwYFVTsT2pRUK7qyPYeJI UgKw== X-Gm-Message-State: AOJu0Yy1BOe+RQO6MH5AZT6TLfO3uD5x/Q82zVKIemGtCXF/DUjEBdaR jNNvpmolT3hJ1ozK77QngeVL/M/zAWC9LTiVH30BE6n/60nN+989vZWrghexrASpuVdqRwmUFig / X-Google-Smtp-Source: AGHT+IFsyjBaa5FQBHfJeWjZE4hgrNgr1uY55ZLttd68i37lcSyoXdXDAIm0Sh/Za5qqnNWIxXxXiw== X-Received: by 2002:a9d:6b91:0:b0:6e6:75fb:74a3 with SMTP id b17-20020a9d6b91000000b006e675fb74a3mr176048otq.14.1711550954024; Wed, 27 Mar 2024 07:49:14 -0700 (PDT) Received: from ip-10-114-89-186.evoforge.org (ec2-52-70-167-183.compute-1.amazonaws.com. [52.70.167.183]) by smtp.gmail.com with ESMTPSA id t10-20020a05620a004a00b00789ecd8e2absm3932971qkt.5.2024.03.27.07.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 07:49:13 -0700 (PDT) From: Greg Hogan Date: Wed, 27 Mar 2024 14:49:03 +0000 Message-ID: X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Received-SPF: none client-ip=2607:f8b0:4864:20::32b; envelope-from=code@greghogan.com; helo=mail-ot1-x32b.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches 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