From patchwork Sat Jan 18 12:07:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: iyzsong--- via Guix-patches via X-Patchwork-Id: 37144 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 E6FDD27BBEA; Sat, 18 Jan 2025 12:04:24 +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=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED 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 EF43827BBE2 for ; Sat, 18 Jan 2025 12:04:21 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tZ7Yf-0001na-Rs; Sat, 18 Jan 2025 07:04:09 -0500 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 1tZ7Yd-0001mq-Kp for guix-patches@gnu.org; Sat, 18 Jan 2025 07:04:07 -0500 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 1tZ7Yc-0006Z8-V7; Sat, 18 Jan 2025 07:04:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=ZmsgbtiB6x1jEdkSIH2N9aU0y1Fs67ts9rum6zi4D28=; b=t8QaDde+bLhpV90pfJdMG+0jQjvSp8E2ojhsLL/PoamspEAz/8g3TxN9woqrgKkS/jvAo9X1JTbgZNmQB5O0Zq0H77OE+Clf2YbRmmvyMT3slScpDOV6DigwbbHKm7mnisSjtnLao8R9YEG3iw/6/LhANhxTWiGooCDjLkYuKNoWIbWBchEOTYgQylmjeRY8+yJNn+aIdgvmA3UVn2dVjhwq1ZG3QfmQXjeefqlXA09nLNLegkMtqAlJ+w3dCnWLyZHJA5MN3k9hBZK+WSQPl40y+2UQTrnpbCNGDuSDskLwSPsL2AP+1zYn9Sbapq/LVRKoU69aJhYZxXeN6Mq7Ug==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tZ7YY-0001IU-B0; Sat, 18 Jan 2025 07:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75647] [PATCH v2 1/2] profiles: Add #:build? argument to lower-manifest-entry. References: In-Reply-To: Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 18 Jan 2025 12:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75647 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75647@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 75647-submit@debbugs.gnu.org id=B75647.17372018264947 (code B ref 75647); Sat, 18 Jan 2025 12:04:02 +0000 Received: (at 75647) by debbugs.gnu.org; 18 Jan 2025 12:03:46 +0000 Received: from localhost ([127.0.0.1]:40573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tZ7YI-0001Hi-16 for submit@debbugs.gnu.org; Sat, 18 Jan 2025 07:03:46 -0500 Received: from mail.envs.net ([5.199.136.28]:45480) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tZ7YE-0001HU-27 for 75647@debbugs.gnu.org; Sat, 18 Jan 2025 07:03:43 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id BC05E38A2BDE; Sat, 18 Jan 2025 12:03:40 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TpzRECg69z8J; Sat, 18 Jan 2025 12:03:37 +0000 (UTC) Received: from localhost (unknown [112.44.106.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Sat, 18 Jan 2025 12:03:37 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 178dc350; Sat, 18 Jan 2025 12:07:06 +0000 (UTC) Date: Sat, 18 Jan 2025 20:07:00 +0800 Message-ID: <367d0f5cffef102e3e4cdbaabcc093e94a74b180.1737201981.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 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: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: iyzsong--- via Guix-patches via 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 From: 宋文武 * guix/profiles.scm (lower-manifest-entry): Add #:build? keyword argument. Change-Id: Ifb86d581156034897377f3614fac67b7748e0ec3 --- guix/profiles.scm | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) base-commit: 87045f0982bd7aebb07b380cbf322651227546f4 diff --git a/guix/profiles.scm b/guix/profiles.scm index a28cf872cf..0f47268541 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2013 Nikita Karetnikov ;;; Copyright © 2014, 2016 Alex Kost ;;; Copyright © 2015 Mark H Weaver -;;; Copyright © 2015 Sou Bunnbu +;;; Copyright © 2015, 2025 宋文武 ;;; Copyright © 2016, 2017, 2018, 2019, 2021, 2022 Ricardo Wurmus ;;; Copyright © 2016 Chris Marusich ;;; Copyright © 2017 Huang Ying @@ -308,9 +308,10 @@ (define (manifest-entry-lookup manifest) ((_ . entry) entry) (#f #f)))) -(define* (lower-manifest-entry entry system #:key target) +(define* (lower-manifest-entry entry system #:key target + (build? #f)) "Lower ENTRY for SYSTEM and TARGET such that its 'item' field is a store -file name." +file name. When BUILD? is true, build the entry before returning." (define (recurse entry) (mapm/accumulate-builds (lambda (entry) (lower-manifest-entry entry system @@ -319,12 +320,20 @@ (define* (lower-manifest-entry entry system #:key target) (let ((item (manifest-entry-item entry))) (if (string? item) - (with-monad %store-monad + (mbegin %store-monad + (build (list item)) + (if build? + (build (list item)) + (return #t)) (return entry)) - (mlet %store-monad ((drv (lower-object item system + (mlet* %store-monad ((drv (lower-object item system #:target target)) + (dependencies (recurse entry)) - (output -> (manifest-entry-output entry))) + (output -> (manifest-entry-output entry)) + (built (if build? + (built-derivations (list (cons drv output))) + (return #t)))) (return (manifest-entry (inherit entry) (item (derivation->output-path drv output))