From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yIG+LvGQomStbQEASxT56A (envelope-from ) for ; Mon, 03 Jul 2023 11:12:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4PPaLfGQomTwTAEAG6o9tA (envelope-from ) for ; Mon, 03 Jul 2023 11:12:17 +0200 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 6ACC78C05 for ; Mon, 3 Jul 2023 11:12:17 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=WyBQ15Ut; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688375537; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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:dkim-signature; bh=6VCdE6WVninkT4c4fIEBMetEk7rHDEE8XFucjD2VIuM=; b=mvNnHPX59nHjwRl7Y1rty1Jdm7uyZH+hxLKJlQjSiuW01RPOXPXduxQVFRlHeJiugI3zpe /kZESpLdxrbyaK2FEY7QkMaCzinh9VDpAdVSVffp5UoS583ByMs8TUB703qC15T4N4rhT/ 6dAxX8b0OYyBEBtgjYvkoJRfGkc1ztM+h5lanTNzSuXTKnRBP2ctGXu1xKfeAwLifaY3Mh 7efZ/2Ao/zLHVUY3SHuTR9Qzi2zjwGsi3D7y6vvUqGCJr/KVOXNUUouwMvCUQFd1qq/VEP 4vnq9EPJwHAlzdNcxoJaRidsNgeSDnXn9e3kD/fzfExZNKUbOIcpqfEFsY+sVw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=WyBQ15Ut; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1688375537; a=rsa-sha256; cv=none; b=alE7tRK/8x8R8vB3or2kXfYaJKUvtFQrkLN0EFztb8nYkyj0995NnRyKLCCAxEXMwnM4DN mfmKjkYEpao6F90pRgjywZR3IsRu68mRD2h1aRJeOKNRvu4825QRZmnD93nRN1AOL8agJF mNOsaN+UVHRYAw8HVtyWWBcHi9YteXeKsXpU8m8Mpqhib9LoJ5rU6/3DMNmx1PcOiP5v5P z38ISnc8wolcdFUJnv2UtxNIwIH0OVdVWrBWGrOHkuHCOSMim0hi4fbeho4VEHf5+zYbDQ Sg39VgBudk1XXiObUw9VAIVqHfOBVx3FrBdl4dAjuFT2U/gPoRpfLqbsCtriXQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGFbH-00016E-T2; Mon, 03 Jul 2023 05:12:03 -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 1qGFbG-000165-EX for guix-patches@gnu.org; Mon, 03 Jul 2023 05:12:02 -0400 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 1qGFbG-0002dc-5l for guix-patches@gnu.org; Mon, 03 Jul 2023 05:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qGFbF-0003OQ-NK for guix-patches@gnu.org; Mon, 03 Jul 2023 05:12:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#61949] [PATCH] pack: Move common build code to (guix build pack). Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 03 Jul 2023 09:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61949 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 61949@debbugs.gnu.org, Christopher Baines , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Josselin Poiret , Ricardo Wurmus Received: via spool by 61949-submit@debbugs.gnu.org id=B61949.168837547312981 (code B ref 61949); Mon, 03 Jul 2023 09:12:01 +0000 Received: (at 61949) by debbugs.gnu.org; 3 Jul 2023 09:11:13 +0000 Received: from localhost ([127.0.0.1]:33125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGFaS-0003NI-Dd for submit@debbugs.gnu.org; Mon, 03 Jul 2023 05:11:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qGFaN-0003Mz-09 for 61949@debbugs.gnu.org; Mon, 03 Jul 2023 05:11:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGFaH-0002YB-DT; Mon, 03 Jul 2023 05:11:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=6VCdE6WVninkT4c4fIEBMetEk7rHDEE8XFucjD2VIuM=; b=WyBQ15Uty+1rFYy9xK3s 9nr0YairQqnQMD4lPSy7m6hiNHoi+rQM5qsqAyuxMWljK3+cfkNp6To4jGfrYdI9U8uWShyNDTdog kiTiIbO+RGbYYrUlcDHesviNVCKVzQqihVN/H+GkRMry4lnmXhdTo9BPu9D8csysp+XO8ojl9MM9n 6ZYduL98PMOMLcb1CdIlkHrinjlO5jVcs6vzSwIZQjauwrU/K/9gSH0My8+WHOftippxKehqalsFX QbvLiDanQM8p1uZQJsRtQfwDhjnlexfQvEDMVrkgbLSz+bXqAFc0xlpzHGYJYK548LIogamDN/Z8k pI29sWO8TRMDnw==; Received: from [89.207.171.77] (helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGFaE-0002rX-O5; Mon, 03 Jul 2023 05:11:01 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20230304031523.24102-1-maxim.cournoyer@gmail.com> <20230306191421.3726-1-maxim.cournoyer@gmail.com> Date: Mon, 03 Jul 2023 11:10:51 +0200 In-Reply-To: <20230306191421.3726-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Mon, 6 Mar 2023 14:14:21 -0500") Message-ID: <87y1jxqs10.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.26 X-Spam-Score: -3.26 X-Migadu-Queue-Id: 6ACC78C05 X-TUID: ArqyuA89Uh8Y Hi Maxim and all, Maxim Cournoyer skribis: > The rationale is to reduce the number of derivations built per pack to id= eally > one, to minimize storage requirements. The number of derivations had gon= e up > with 68380db4 ("pack: Extract populate-profile-root from > self-contained-tarball/builder.") as a side effect to improving code reus= e. > > * guix/scripts/pack.scm (guix): Add commentary comment. > (populate-profile-root, self-contained-tarball/builder): Extract to... > * guix/build/pack.scm (populate-profile-root): ... this, and... > (build-self-contained-tarball): ... that, adjusting for use on the build = side. > (assert-utf8-locale): New procedure. > (self-contained-tarball, debian-archive, rpm-archive): Adjust accordingly. Sorry for dropping the ball! > Changes in v2: > - Drop '!' from populate-profile-root! > - Move top commentary comment below define-module block > - Move expressions after definitions for Guile 2.0 compatibility > - Remove #:target and #:archiver from build-self-contained-tarball I believe the only outstanding issue for me is the ability to run tests without relying on an external store. > (define* (self-contained-tarball name profile > #:key target > (profile-name "guix-profile") > @@ -367,16 +240,40 @@ (define* (self-contained-tarball name profile > (warning (G_ "entry point not supported in the '~a' format~%") > 'tarball)) >=20=20 > + (define database > + (and localstatedir? > + (file-append (store-database (list profile)) > + "/db/db.sqlite"))) > + > (gexp->derivation (string-append name ".tar" > (compressor-extension compressor)) > - (self-contained-tarball/builder profile > - #:profile-name profile-name > - #:target target > - #:localstatedir? localstatedir? > - #:deduplicate? deduplicate? > - #:symlinks symlinks > - #:compressor compressor > - #:archiver archiver))) > + (with-extensions (list guile-gcrypt) > + (with-imported-modules `(((guix config) =3D> ,(make-config.scm)) You can remove (guix config) here since it=E2=80=99s unused. > + ,@(source-module-closure > + `((guix build pack) > + (guix build utils)) > + #:select? not-config?)) I figured that, to allow tests to run without an external store, we need to change it like this: (gexp->derivation (string-append name ".tar" (compressor-extension compressor)) (with-extensions (if deduplicate? (list guile-gcrypt) '()) (with-imported-modules (let ((lst (source-module-closure `((guix build pack) (guix build utils)) #:select? not-config?))) (if deduplicate? lst (delete '(guix store deduplication) lst)= )) #~(begin (use-modules (guix build pack) (guix build utils)) =E2=80=A6)))) Quite some boilerplate given that #:deduplicate? is always #f in practice. So maybe it=E2=80=99s not worth the trouble, after all. I=E2=80=99ll let you rebase and adjust as you see fit, but it LGTM! Thanks, Ludo=E2=80=99.