From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yM2bD7cAt2S90AAASxT56A (envelope-from ) for ; Tue, 18 Jul 2023 23:14:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8OFfD7cAt2T9SwAAauVa8A (envelope-from ) for ; Tue, 18 Jul 2023 23:14:31 +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 CF7E04AD03 for ; Tue, 18 Jul 2023 23:14:30 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=cf3onIfV; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689714871; 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-to: 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=HsIpixdFG9DYqMEgqX933gIGcwC43v0NY0Qi9YtSLbo=; b=hw6IA0Rpqw8i0ELkVCm/z5HWLytkJYt142XHWlbk6I6ztxpJazNtVGTbKNYEoIIcvhezWQ cIOerAt+6RjEoHXdsCtEmLPunQayUlfBeGiVU8/bcVxyAtXoM0fxxMn0DANSV3LYsCagWc cjLCGEfsP91AYYbi3UFruYNqLSk4u5pnQXbCXIsCEyZ4hTFriq/tRaAZYGYdAz6y4bfiSq DxcIiOIx7tUSuLsdz3Y0GdKo1YXfAXARNWc7iUmRX053zd0QQixriXrwxD9QnshEo7LRED hVZGBvQKC3iQT4lPuH46iLHaOcuCxNdHvTnDsWeUhvW9WG/Y2VjqIVThlIMSSQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1689714871; a=rsa-sha256; cv=none; b=XHX5sM8G5IuSdK0W/or2c/SzBiDBx66yX0RYdq3rY/FFPY9TTxbAvysy/dCASvaWQONEJv Aew60whJI107HjCv+uL1f6YyjM6vEbhcR0ucQWxTzIpL+QS4vl/RsKbO14I4Dafk9+/Vzl R4CHbK1294dkj6QcmYJAKxb1S5gXsZU0jA8igOaQQyAspyrIrDeR/WCU9l2wBz4TApQsTV nQ4HR9sLx5Ls5XIPzUROek0nck/DlsRWYFifLwdqU0iL9l6ZktrBkNwshRMIh+s5b4uDwP Csht5dNRx65+MVrcxwBVPl3gzOp4wJavhGKfS7FuhVbQ8dK13TM7ANkjjRr57g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=cf3onIfV; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLs1J-0003w8-6g; Tue, 18 Jul 2023 17:14:09 -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 1qLs1D-0003vG-Dy for guix-patches@gnu.org; Tue, 18 Jul 2023 17:14:03 -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 1qLs1D-0003Xk-5s for guix-patches@gnu.org; Tue, 18 Jul 2023 17:14:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qLs1C-0005YM-NN for guix-patches@gnu.org; Tue, 18 Jul 2023 17:14:02 -0400 Subject: bug#61949: [PATCH] pack: Move common build code to (guix build pack). Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Tue, 18 Jul 2023 21:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 61949 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 61949-done@debbugs.gnu.org, Christopher Baines , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Josselin Poiret , Ricardo Wurmus Mail-Followup-To: 61949@debbugs.gnu.org, maxim.cournoyer@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 61949-done@debbugs.gnu.org id=D61949.168971483621319 (code D ref 61949); Tue, 18 Jul 2023 21:14:02 +0000 Received: (at 61949-done) by debbugs.gnu.org; 18 Jul 2023 21:13:56 +0000 Received: from localhost ([127.0.0.1]:54443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLs16-0005Xn-4M for submit@debbugs.gnu.org; Tue, 18 Jul 2023 17:13:56 -0400 Received: from mail-ua1-x932.google.com ([2607:f8b0:4864:20::932]:46586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qLs12-0005XX-8M for 61949-done@debbugs.gnu.org; Tue, 18 Jul 2023 17:13:54 -0400 Received: by mail-ua1-x932.google.com with SMTP id a1e0cc1a2514c-794af22ed66so2297275241.1 for <61949-done@debbugs.gnu.org>; Tue, 18 Jul 2023 14:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689714826; x=1692306826; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=HsIpixdFG9DYqMEgqX933gIGcwC43v0NY0Qi9YtSLbo=; b=cf3onIfVymS06+J4D9dO56oQcI/XwHDsQkXk66yOOnmvuNNSSYRn6gXMzFqggR2Bok bXU1BjI5OrmNTj4plNYE4dlkLkQS6jBO0h/YVjndHeJovz68PCpqasryAC0HSGa3/Hvi v7Z68Slrn0pD2sHo+MBJggMd2C4bn09f8u5L+L5i9EraJpncvblsWzRIqkFNyGS8WQRD 93tJuvtq9cGe5h7b6MLccv9lNlZ9Tp9L5YtbsKEBYN36JRrchu4ulKvw9hE+2LudT7O+ moeryi0j70NpdqgO+J247qeT5o0dB8ELPdJnltplb1PRYQAL/p+yiqEzP/ZiGhssMbW5 Yr3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689714826; x=1692306826; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HsIpixdFG9DYqMEgqX933gIGcwC43v0NY0Qi9YtSLbo=; b=EdoOzNGzwJrzjLPg4YvUnealftD4RLRpDpty/TW4owhHLmRISIeqiyOG0rg+GhZjBQ 5zo7pbg8kpuTVOI5HkWIV65A3OXszCjcII1uQc8qQI0fce8+moQfW3H+9uIrqvZ4lso9 CzWBRBJm9GDOkHtJePDoehECwBP4dB4nl7bghpJNZvEaZ2Mi6LHWm3Lxi5mNi7VD5rsM 3l6dItaRxe50ZNK5gEvSriZB8SfR2xc4aIZUulN3biEVlOZyoWGU3/mabFY4k6Vh18eX krPLENq6vOYk/409XqxduezCHymiykj77fupSp0XP2YWQYNtkZe8DiNmaRGIh9LhoGPG WKiA== X-Gm-Message-State: ABy/qLZZp6BQWwjjcbvhObXCEAvgIogabBfctbExceURgHHyywCtnEqQ 02S6i/QtA36ThEDLnh4y6NE= X-Google-Smtp-Source: APBJJlEtGkoxuVj/DGfe3B9PTupega+ZApBPlAX4hM3gCe+sX+IgKj/9ClayQUdS+DcnUqHRWLCZRg== X-Received: by 2002:a67:fa47:0:b0:443:3e1f:7e00 with SMTP id j7-20020a67fa47000000b004433e1f7e00mr520089vsq.6.1689714826392; Tue, 18 Jul 2023 14:13:46 -0700 (PDT) Received: from raisin ([2607:fad8:4:6::984a]) by smtp.gmail.com with ESMTPSA id u17-20020a0ca711000000b00623813aa1d5sm1001875qva.89.2023.07.18.14.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 14:13:45 -0700 (PDT) From: Maxim Cournoyer References: <20230304031523.24102-1-maxim.cournoyer@gmail.com> <20230306191421.3726-1-maxim.cournoyer@gmail.com> <87y1jxqs10.fsf_-_@gnu.org> Date: Tue, 18 Jul 2023 17:13:44 -0400 In-Reply-To: <87y1jxqs10.fsf_-_@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 03 Jul 2023 11:10:51 +0200") Message-ID: <87bkg8udmf.fsf@gmail.com> 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-Spam-Score: -2.06 X-Spam-Score: -2.06 X-Migadu-Queue-Id: CF7E04AD03 X-Migadu-Scanner: mx1.migadu.com X-TUID: LmWctg9pr0m8 Hi Ludo! Ludovic Court=C3=A8s writes: > Hi Maxim and all, > > Maxim Cournoyer skribis: > >> The rationale is to reduce the number of derivations built per pack to i= deally >> one, to minimize storage requirements. The number of derivations had go= ne up >> with 68380db4 ("pack: Extract populate-profile-root from >> self-contained-tarball/builder.") as a side effect to improving code reu= se. >> >> * 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 accordingl= y. > > Sorry for dropping the ball! Thanks for picking it up again :-) [...] >> (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. Done. >> + ,@(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) ls= t))) > #~(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 for this! I had to use it for tests/guix-pack.sh to pass, but it still would work for the first test in tests/pack.scm (after modifying it to use the test store as it used to), so I've left tests/pack.scm The change is now installed, thanks for the review! --=20 Thanks, Maxim