From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id A0F0KCshCmKGKAEAgWs5BA (envelope-from ) for ; Mon, 14 Feb 2022 10:30:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ULgPJCshCmLRhQAAauVa8A (envelope-from ) for ; Mon, 14 Feb 2022 10:30:19 +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 933903A0B6 for ; Mon, 14 Feb 2022 10:30:18 +0100 (CET) Received: from localhost ([::1]:50612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJXgX-0007YX-IA for larch@yhetil.org; Mon, 14 Feb 2022 04:30:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJXgJ-0007YA-Ip for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJXgJ-0005vc-6z for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJXgI-0006G7-Ur for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53210: [WIP PATCH 0/4] Make current-guix work when run outside a Git checkout Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 14 Feb 2022 09:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53210 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe Cc: Josselin Poiret , 53210@debbugs.gnu.org Received: via spool by 53210-submit@debbugs.gnu.org id=B53210.164483096323912 (code B ref 53210); Mon, 14 Feb 2022 09:30:02 +0000 Received: (at 53210) by debbugs.gnu.org; 14 Feb 2022 09:29:23 +0000 Received: from localhost ([127.0.0.1]:39719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXff-0006Da-Aq for submit@debbugs.gnu.org; Mon, 14 Feb 2022 04:29:23 -0500 Received: from jpoiret.xyz ([206.189.101.64]:36712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXfd-0006DS-3D for 53210@debbugs.gnu.org; Mon, 14 Feb 2022 04:29:22 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 436DB184F29; Mon, 14 Feb 2022 09:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1644830960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8UkMd1WPXQoLTdgB5a3xlEZ9q9fZ/ZyxixQ+2gatG5g=; b=IhKbznmQFdv9woUPpfb1j6/JcashcBCyF6tXVhNjBmZ6L7WLK7lA3deaASWYqCVPlsT1sh k7QGizkXYRxxhzd5dp8v9DfhWz8rYYCPQ78eqgygM8qa0rpxMXU4yquRxCWKbLRBOufv00 lnc8wdZgAPUdSw4YLmAY9QM7BI8n+VrLpoD9jtHI4LjkiSTaHLEvTEOQVgPi9J54LVlokU tsGRR1c4GFZzSp4D6aHvftvH40eJNUmdIvUxe4gtOsntjZpCncjqDorUitmPZ9LwP9yD7Z i7YGVEi3wEicFwO/POuilIXrf5u2QgAA5XNEDONSEnf6TuPHSCgy7t57WfSf4Q== Date: Mon, 14 Feb 2022 10:29:04 +0100 Message-Id: <20220214092908.16801-1-dev@jpoiret.xyz> In-Reply-To: <87lezkrgvj.fsf@gnu.org> References: <87lezkrgvj.fsf@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: ++++ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Josselin Poiret From: Josselin Poiret via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644831018; h=from:from:sender:sender:reply-to: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:dkim-signature; bh=8UkMd1WPXQoLTdgB5a3xlEZ9q9fZ/ZyxixQ+2gatG5g=; b=NXbI9gP1EqfEg3/ixK2b2hab4VVVut2hyRzc+UC1/FZNA/dqUf1BvqNC7joTQf5hqyboWQ i3375COyYG8tBtpbNBR34nE33AT97bbXI3NsgcfFpQisTo2ZniCjMmwn3WASw6OBrzZJSE 08sdjgASVTowchcz8XQ8CE/xWxxcH6wrv0HqgY3bl0EZBu/YiraZYFulzFOD6O9Xw5bcf+ 6yXU4/ebBbR2VI636yPTzs99YjnkiMKE92VDNxnHa9DMCyw7HrvQs1PJrHpJXYPc5lxMFB AMAbmUhcPVFCDtMRzdxQaSj9xObuLsXjRl1no9a4b0CQ1C+rqEyUMFkdENNo9Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644831018; a=rsa-sha256; cv=none; b=JCAO6CFLoMTxi4ZQascgWfqKZqvRi4vnFjjffQNnoTDbWnvOLn3wOnQN7Nw5aZnj+ZWJXq ef01qiiafwFyed2AzdBjZGVTWbKgpDn2B2MQMz8j/+z1FRfak3MwocbdjCVf0zcxZxuVPm QeYbb6P+zpf5K5KCVg/S3q6frll2sBsmd00i2ZNy9WbImK37l3rERdHR7OyO2VyRGpvAqh BrKIVy6U9V37YDJT2wV+zw4OkTey4yLj0JQe8O0gxu4BYPh7+KKQnawOVWjZQmGcX811Jc 2G7Y6r1yL+boyYnimLvk3N3tjZ6Pc6XXjeFqak+n0AaOISMH3LdSmzVeZqOYhA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=IhKbznmQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=IhKbznmQ; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 933903A0B6 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: KaUT57q/2Y5f Hello everyone, I've been working on this for a bit, trying to find the best approach. First, let me try to summarize the different ways in which Guix can be run, and how it is built: * From a `guix pull` profile. This is the most common. The `guix pull` profile's manifest file holds specific metadata describing the channels that were used to build the generation, which can be fetched by `(current-channels)` from (guix describe). * From a built Guix inside the store, outside a `guix pull` profile. This is what happens when the user hasn't `guix pull`ed yet after a Guix System installation, for example. Here, the only available metadata is the one embedded in (guix config) by the build process, and (current-channels) returns that one. * From a Git checkout. Here, there is no build metadata at all. Furthermore, there are two ways to build Guix: either through the `guix` package definition, which uses the Makefile, or through `build-aux/build-self.scm` which uses `guix/self.scm`. Here, I use the second method, since it's how the current guix is most likely built. This means that, with proper care, all the derivations already have their output in the store. This is only a WIP as there are some unresolved things: I've disabled authentication, since I'm currently testing my own unsigned patches. Should we indiscriminately enable it? This would cause some issues for people that have their own 'guix channel. Maybe we could enable authentication if the channel URL is the default one? Also, when I tried to replace the guix in the installer by (current-guix), it ended up building the Guix derivation multiple times, even though the package is memoized and the package->derivation process should be cached. There's a bit of rift between what the ci uses (renamed here to channel-profile-build-system) and what current-guix uses, since the former builds a profile as a package, whereas the latter simply builds the derivation for the 'guix channel. This avoids creating profile collisions when the package is added to the system profile, but it also means we don't get the package cache generation. Best, Josselin Poiret (4): gnu: ci: Move generic channel building code. gnu: Rename channel-build-system and channel-source->package. gnu: current-guix: Support when running outside a checkout. gnu: package-management: Memoize current-guix. etc/system-tests.scm | 3 +- gnu/ci.scm | 40 +------------------ gnu/packages/package-management.scm | 60 +++++++++++++++++++++++------ guix/channels.scm | 51 ++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 52 deletions(-) -- 2.34.0