From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8ElzAm9V42NBbQAAbAwnHQ (envelope-from ) for ; Wed, 08 Feb 2023 08:55:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MCWuAW9V42MkWAEAG6o9tA (envelope-from ) for ; Wed, 08 Feb 2023 08:55:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BAD3511DCC for ; Wed, 8 Feb 2023 08:55:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPfIO-0000g1-7a; Wed, 08 Feb 2023 02:55:12 -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 1pPfIG-0000f2-FR for guix-patches@gnu.org; Wed, 08 Feb 2023 02:55:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPfIE-0002PG-H9; Wed, 08 Feb 2023 02:55:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pPfIE-0000Aj-08; Wed, 08 Feb 2023 02:55:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61363] [PATCH 2/2] self: Apply grafts to the outputs of the guix derivation. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Wed, 08 Feb 2023 07:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61363 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61363@debbugs.gnu.org Cc: ludo@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by 61363-submit@debbugs.gnu.org id=B61363.1675842848585 (code B ref 61363); Wed, 08 Feb 2023 07:55:01 +0000 Received: (at 61363) by debbugs.gnu.org; 8 Feb 2023 07:54:08 +0000 Received: from localhost ([127.0.0.1]:54685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPfHL-00009H-Jt for submit@debbugs.gnu.org; Wed, 08 Feb 2023 02:54:08 -0500 Received: from mira.cbaines.net ([212.71.252.8]:42178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPfHJ-000092-JQ for 61363@debbugs.gnu.org; Wed, 08 Feb 2023 02:54:06 -0500 Received: from localhost (unknown [IPv6:2a02:1808:280:f63d:f055:17e:cfb4:3]) by mira.cbaines.net (Postfix) with ESMTPSA id D08DF16D3C for <61363@debbugs.gnu.org>; Wed, 8 Feb 2023 07:54:04 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id d7e7ca6f for <61363@debbugs.gnu.org>; Wed, 8 Feb 2023 07:54:03 +0000 (UTC) From: Christopher Baines Date: Wed, 8 Feb 2023 08:54:03 +0100 Message-Id: <20230208075403.11788-2-mail@cbaines.net> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230208075403.11788-1-mail@cbaines.net> References: <20230208075403.11788-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1675842926; a=rsa-sha256; cv=none; b=joG0VwiphbMtb54pDu1C4DSHGFmOZiS8InasRBx0q60zWGmLmCyNIiJIZudjESCzryTsSY XxBpyzV3n7lmTsi8jgM2M3qBxbxG/ZEQHnz43Kl2QnnQM/N/3DPI1xH9SAYVppm4cVFz3r pAsR5fT5tWfjpGsKF4qWVH+O5+czx2zbLU28SV2H+f9kO02XI+BaDrdVzIXmvmzA4wmhxL hLmctF/HxFpK6/7JP9xv2opYPJ4iyJIE5JY+ePaVeNyxuyG799zDAPgLSqOMG0AhNE8doX mqIvCybeS2KCCXGn+cnDmdajqbM3ga7UR893or/dwAh2NP8XE4NR9JLjtgG95w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1675842926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=a8BjGia399LyCqkNBLvU1Rkrs7veRFVfGv1GY4r5534=; b=Rh3g6sz/84az0Zp+zEKfLNd1E6UELPTfZl25itj0ovbDIxuL1TYniqZ+3uBqAmMIm9FRqI mcNsas2ldLEWB6p5nyv5Ho2uZxXve8MrEPC2BjJ/htuk+9mzw3pyDRbqAOZjkoL+NW0pou uS/hH3/owcYxWJ81Yuvpv+u8rGjXv2FtO+56B+44qyhwHfyEGfOIQDY5rqOTd5r9wsX2MI EIjeEqD8x/ZvefGmpfe103wcXufbJdUnKLdSs9cjR3gkMqu3nd++zCK7FBaxAyH2HXeXXb eo8UebDSrGCj89hJlex43ObbQkXjuHfWAgqffFL3Po9Dg7eQJMEd5WFVm7syAw== X-Migadu-Queue-Id: BAD3511DCC X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Spam-Score: -2.89 X-Spam-Score: -2.89 X-TUID: eNS2THhZuCcw Rather than having grafts apply to the derivation itself. This moves grafting here to work like grafting for packages, where you can think of the grafted outputs as a transformed variant of the ungrafted outputs. I'm looking at this as it'll allow the Guix Data Service to compute the derivations without grafts, and for these to be useful for substitutes regardless of whether users are using grafts. * guix/self.scm (compiled-guix, guix-derivation): Add a #:graft? keyword argument, to control grafting when computing the guix derivation. * build-aux/build-self.scm (build-program): Call guix-derivation with #:graft? (%graft?) to make the compute-guix-derivation script use or not use grafts as desired. --- build-aux/build-self.scm | 4 ++- guix/self.scm | 65 ++++++++++++++++++++++++++-------------- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index 02822a2ee8..6d0037f20c 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -353,7 +353,9 @@ (define fake-git #:channel-metadata '#$channel-metadata #:pull-version - #$pull-version) + #$pull-version + #:graft? + #$(%graft?)) #:system system)) derivation-file-name)))))) #:module-path (list source)))) diff --git a/guix/self.scm b/guix/self.scm index 93019e1c64..c944dbe9ce 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -752,7 +752,8 @@ (define* (compiled-guix source #:key (gzip (specification->package "gzip")) (bzip2 (specification->package "bzip2")) (xz (specification->package "xz")) - (guix (specification->package "guix"))) + (guix (specification->package "guix")) + (graft? #t)) "Return a file-like object that contains a compiled Guix." (define guile-avahi (specification->package "guile-avahi")) @@ -802,6 +803,12 @@ (define dependencies guile-json guile-semver guile-ssh guile-sqlite3 guile-lib guile-zlib guile-lzlib guile-zstd))) + (define packages + (cons* gzip + bzip2 + xz + dependencies)) + (define *core-modules* (scheme-node "guix-core" '((guix) @@ -1022,28 +1029,35 @@ (define (built-modules node-subset) guile-lzma dependencies) #:guile guile-for-build - #:guile-version guile-version))) - (whole-package name modules dependencies - #:command command - #:guile guile-for-build - - ;; Include 'guix-daemon'. XXX: Here we inject an - ;; older snapshot of guix-daemon, but that's a good - ;; enough approximation for now. - #:daemon (module-ref (resolve-interface - '(gnu packages - package-management)) - 'guix-daemon) - - #:info (info-manual source) - #:miscellany (miscellaneous-files source) - #:guile-version guile-version))) + #:guile-version guile-version)) + (obj + (whole-package name modules dependencies + #:command command + #:guile guile-for-build + + ;; Include 'guix-daemon'. XXX: Here we inject + ;; an older snapshot of guix-daemon, but + ;; that's a good enough approximation for now. + #:daemon (module-ref (resolve-interface + '(gnu packages + package-management)) + 'guix-daemon) + + #:info (info-manual source) + #:miscellany (miscellaneous-files source) + #:guile-version guile-version))) + (if graft? + (explicit-grafting obj packages) + obj))) ((= 0 pull-version) ;; Legacy 'guix pull': return the .scm and .go files as one ;; directory. - (built-modules (lambda (node) - (list (node-source node) - (node-compiled node))))) + (let ((obj (built-modules (lambda (node) + (list (node-source node) + (node-compiled node)))))) + (if graft? + (explicit-grafting obj packages) + obj))) (else ;; Unsupported 'guix pull' version. #f))) @@ -1273,7 +1287,8 @@ (define (process-directory directory files output) (define* (guix-derivation source version #:optional (guile-version (effective-version)) #:key (pull-version 0) - channel-metadata) + channel-metadata + (graft? #t)) "Return, as a monadic value, the derivation to build the Guix from SOURCE for GUILE-VERSION. Use VERSION as the version string. Use CHANNEL-METADATA as the channel metadata sexp to include in (guix config). @@ -1310,7 +1325,11 @@ (define guile #:pull-version pull-version #:guile-version (if (>= pull-version 1) "3.0" guile-version) - #:guile-for-build guile))) + #:guile-for-build guile + #:graft? graft?))) (if guix - (lower-object guix) + (if graft? + (lower-object guix) + (without-grafting + (lower-object guix))) (return #f))))) -- 2.38.1