From patchwork Wed May 15 16:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 27513 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 B3B1F27BBE9; Wed, 15 May 2024 18:01:28 +0100 (BST) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=unavailable 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 6F44527BBE2 for ; Wed, 15 May 2024 18:01:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7HzH-0001tn-4k; Wed, 15 May 2024 13:00:19 -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 1s7Hz5-0001p8-QN for guix-patches@gnu.org; Wed, 15 May 2024 13:00:09 -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 1s7Hz3-0007GG-Vf for guix-patches@gnu.org; Wed, 15 May 2024 13:00:07 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7Hz4-0007CL-8v; Wed, 15 May 2024 13:00:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70962] [PATCH 10/14] gnu: make-linux-libre*: Run install targets in parallel. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: leo@famulari.name, me@tobias.gr, w@wmeyer.eu, guix-patches@gnu.org Resent-Date: Wed, 15 May 2024 17:00:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70962 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70962@debbugs.gnu.org Cc: Maxim Cournoyer , Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer X-Debbugs-Original-Xcc: Leo Famulari , Tobias Geerinckx-Rice , Wilko Meyer Received: via spool by 70962-submit@debbugs.gnu.org id=B70962.171579237127514 (code B ref 70962); Wed, 15 May 2024 17:00:06 +0000 Received: (at 70962) by debbugs.gnu.org; 15 May 2024 16:59:31 +0000 Received: from localhost ([127.0.0.1]:43171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyU-00079d-SA for submit@debbugs.gnu.org; Wed, 15 May 2024 12:59:31 -0400 Received: from mail-yb1-f172.google.com ([209.85.219.172]:50652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7HyR-00078f-MK for 70962@debbugs.gnu.org; Wed, 15 May 2024 12:59:28 -0400 Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-dbed0710c74so6118196276.1 for <70962@debbugs.gnu.org>; Wed, 15 May 2024 09:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715792300; x=1716397100; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3qLIJiKjlqDr6/0rhoK1uneVr/IFtt8EnXKUNj+2b/Q=; b=JlI3i5Jq+prP4TYeBbwegOfFzBIIRHo1Kdk0KN9aL2DbQ76EV+TAaBOzoeiHdBYCfk uzwEs+/Y6VXsC4ljxI73OmgFhW0xzbx+Tz3X+C52FgwLj7hxlWEI4+WrN8OkfTHAjZYU cAV73f+wkDPwgmBIOmMah/4S5vJnV1M/zWoBNjrvmt61UviZWEFYG18KHmVfaTi1oVp8 wWcscZ8xx6Qy0MR594RXTynUI7FBpn5nEPjH7HhExgIcokRjxy68Et3RnQTTcJblyhD7 R/OGWZhsOGncWQ4aVc3vM6w2YI3P3cec2e0zXP/eR4U661Tk1exUgvuui9HSQbV8/AOd 1tKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715792300; x=1716397100; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3qLIJiKjlqDr6/0rhoK1uneVr/IFtt8EnXKUNj+2b/Q=; b=haKJx3KVkoyD/7W7JvyKkoDmGeT7puq5wQ7csLa9vBWKo5Gip+hGfnuddFr0Zr/hQ3 8LGhhQn2JiXfuST+lIs8KmCLM34SvFsRq/+RKgKG5ij6x9qkJbWZimGVPH0rsegPuPR6 KVdNdK37GsS3dHue5yVgoRLX4u2twu2b2+XtSwYtEZMp/GTqc48tKuCLhBNC6nWBMxy3 pw4N5Ey9NTZVbcOiXekPB4uAQK1+YHbWem+wqyNq7Qr1LtfmkVO/OGg0c0WyfsvD+sjF pZRjaFPpY/ThQJO80EuXkNAi76aCFqcxgo0Nphchg9GQ/ToAQoQRfnmQoL9OtfihED9O rm/A== X-Gm-Message-State: AOJu0YwwK1LgV8bweBpyDO8l0ZAJxjz1d9jqQ6m9JPzJ2j6iQnTRdbn2 HAJ7sy9UpSwd77T3iyjW5ACjeabbI6DP3gNuLBQBdohHER9VtHo7s4bJ/w== X-Google-Smtp-Source: AGHT+IGrMwWwh+OKnrxYFTaGNIlMrjHN5mHy4EqvK6yj3ke+PfJLbpdZSyPNWMvIPiBkonLEwo5vpA== X-Received: by 2002:a25:8102:0:b0:dc2:41de:b744 with SMTP id 3f1490d57ef6-dee4f338307mr14184974276.32.1715792299928; Wed, 15 May 2024 09:58:19 -0700 (PDT) Received: from localhost.localdomain (dsl-205-233-125-107.b2b2c.ca. [205.233.125.107]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f194871sm66068896d6.59.2024.05.15.09.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 09:58:19 -0700 (PDT) From: Maxim Cournoyer Date: Wed, 15 May 2024 12:57:20 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> References: <7cf609dcf83c85b6897c9fb9af46ce8a854a15c8.1715791830.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 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 This reduces the total build time by about 20%. * gnu/packages/linux.scm (make-linux-libre*) [phases] {install}: Ensure that -jN is used for the install targets. Also honor make flags. Change-Id: Ib3f4fdcbdeab736315a91eafa8d6d1dff5b89884 --- gnu/packages/linux.scm | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 5386a263cd..4547ab525f 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1049,9 +1049,15 @@ (define* (make-linux-libre* version gnu-revision source supported-systems (close-port port)) (invoke "make" "oldconfig")))) (replace 'install - (lambda _ + (lambda* (#:key make-flags parallel-build? #:allow-other-keys) (let ((moddir (string-append #$output "/lib/modules")) - (dtbdir (string-append #$output "/lib/dtbs"))) + (dtbdir (string-append #$output "/lib/dtbs")) + (make-flags + (append make-flags + (list "-j" + (if parallel-build? + (number->string (parallel-job-count)) + "1"))))) ;; Install kernel image, kernel configuration and link map. (for-each (lambda (file) (install-file file #$output)) (find-files "." "^(\\.config|bzImage|zImage|Image\ @@ -1059,22 +1065,23 @@ (define* (make-linux-libre* version gnu-revision source supported-systems ;; Install device tree files (unless (null? (find-files "." "\\.dtb$")) (mkdir-p dtbdir) - (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir) - "dtbs_install")) + (apply invoke "make" + (string-append "INSTALL_DTBS_PATH=" dtbdir) + "dtbs_install" make-flags)) ;; Install kernel modules (mkdir-p moddir) - (invoke "make" - ;; Disable depmod because the Guix system's module - ;; directory is an union of potentially multiple - ;; packages. It is not possible to use depmod to - ;; usefully calculate a dependency graph while - ;; building only one of them. - "DEPMOD=true" - (string-append "MODULE_DIR=" moddir) - (string-append "INSTALL_PATH=" #$output) - (string-append "INSTALL_MOD_PATH=" #$output) - "INSTALL_MOD_STRIP=1" - "modules_install") + (apply invoke "make" + ;; Disable depmod because the Guix system's module + ;; directory is an union of potentially multiple + ;; packages. It is not possible to use depmod to + ;; usefully calculate a dependency graph while building + ;; only one of them. + "DEPMOD=true" + (string-append "MODULE_DIR=" moddir) + (string-append "INSTALL_PATH=" #$output) + (string-append "INSTALL_MOD_PATH=" #$output) + "INSTALL_MOD_STRIP=1" + "modules_install" make-flags) (let* ((versions (filter (lambda (name) (not (string-prefix? "." name))) (scandir moddir))) @@ -1096,7 +1103,7 @@ (define* (make-linux-libre* version gnu-revision source supported-systems elfutils ;needed to enable CONFIG_STACK_VALIDATION flex bison - util-linux ;needed for hexdump + util-linux ;needed for hexdump ;; These are needed to compile the GCC plugins. gmp mpfr