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 ms0.migadu.com with LMTPS id 0LcRG3eOCmJAugAAgWs5BA (envelope-from ) for ; Mon, 14 Feb 2022 18:16:39 +0100 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 UOPWE3eOCmIUOgEAG6o9tA (envelope-from ) for ; Mon, 14 Feb 2022 18:16:39 +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 7EB793840A for ; Mon, 14 Feb 2022 18:16:36 +0100 (CET) Received: from localhost ([::1]:53528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJexn-0002yo-OH for larch@yhetil.org; Mon, 14 Feb 2022 12:16:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJexQ-0002ya-Jt for bug-guix@gnu.org; Mon, 14 Feb 2022 12:16:12 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJexF-0007FV-R7 for bug-guix@gnu.org; Mon, 14 Feb 2022 12:16:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJexF-0000Zz-Kx for bug-guix@gnu.org; Mon, 14 Feb 2022 12:16:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53210: [WIP PATCH 3/4] gnu: current-guix: Support when running outside a checkout. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 14 Feb 2022 17:16:01 +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: Josselin Poiret Received: via spool by 53210-submit@debbugs.gnu.org id=B53210.16448589232181 (code B ref 53210); Mon, 14 Feb 2022 17:16:01 +0000 Received: (at 53210) by debbugs.gnu.org; 14 Feb 2022 17:15:23 +0000 Received: from localhost ([127.0.0.1]:42454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJewc-0000Z6-UO for submit@debbugs.gnu.org; Mon, 14 Feb 2022 12:15:23 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:49104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJewb-0000Yv-Gv for 53210@debbugs.gnu.org; Mon, 14 Feb 2022 12:15:21 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 19DD43DB; Mon, 14 Feb 2022 18:15:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dtBXlN-fXsUw; Mon, 14 Feb 2022 18:15:15 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 4056D2D0; Mon, 14 Feb 2022 18:15:15 +0100 (CET) From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87lezkrgvj.fsf@gnu.org> <20220214092908.16801-1-dev@jpoiret.xyz> <20220214092908.16801-4-dev@jpoiret.xyz> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 =?UTF-8?Q?Pluvi=C3=B4se?= an 230 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 14 Feb 2022 18:15:14 +0100 In-Reply-To: <20220214092908.16801-4-dev@jpoiret.xyz> (Josselin Poiret's message of "Mon, 14 Feb 2022 10:29:07 +0100") Message-ID: <87wnhxtlnh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 19DD43DB X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] 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: , Cc: Mathieu Othacehe , 53210@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-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=1644858996; 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; bh=V9+Fjbwh1lnhs5YztLvMlZO6gLxcSxOQRicIRxi2W54=; b=VX8FB+QjRgbXNMn1JN2V8lzQ3LscpfirbQg/Kf24HnJJ0XOc9SrFXrs8Hnlq/tJhqZf2iD X5ksdRhceQl41w6KK1+MvbUoWxVnxhQuu3nBCfYbnQFkcK1sKlYtBhtZ4ljhY5xUkqt7k6 ZOv5y0lT4KEghH1vBfOikEg00oVMJol+VprT6NRcCJ+S0fC0tJp3c6QQWYBn1COFwtIlCN 0oAWPHYBf2rI1v+Hbxo9Lc07plH+/2TMMZx5HztkB+M6cH/QqlxqDxDPrZ9LV7OfHSrQEI uEFslKTZJM3FeuPW26xXg+de3PnLUuUhYxQpH6Gi+MhfLafVvLKB21X4tbuCyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644858996; a=rsa-sha256; cv=none; b=Iwk0442q2JY7V5jojeDXNXBSVJnk4NzActYoVc5ekpGr/cnDfqvev0Tic1iKSJ4vD07x+h huZemDzBn8RifD3dnv70BGwr7ozDOppmnqkcG/K0lR3XTDNiJ1sI8Zfsjou9cFEB9nCau3 qXUKw7pqv/cMAivSQ+TAxzldkEPXZDPVXmmODjelpozVUGSpPZfClhvRwoVeEgvUUeAetp cpehjnqsXv4GY2zYEz9hnlFlTFBL7qBqUazI2S12mACYxcrb1m+J6WtCQHZCzwEjxc+6oE D9b0zz2z39UDrTMliLznCuxivsXLJvzmwj9dZKlL575mkoR2rl4l3eqeW6O69g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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.63 Authentication-Results: aspmx1.migadu.com; dkim=none; 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: 7EB793840A X-Spam-Score: -3.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: ao286xEVPKea Josselin Poiret skribis: > * guix/channels.scm (channel-build-system): Add build system that > turns a channel record into a package. > * gnu/packages/package-management.scm (current-guix): Use > channel-build-system. [...] > (define-public current-guix > - (let* ((repository-root (delay (canonicalize-path > - (string-append (current-source-directo= ry) > - "/../..")))) > - (select? (delay (or (git-predicate (force repository-root)) > - source-file?)))) > - (lambda () > - "Return a package representing Guix built from the current source = tree. > -This works by adding the current source tree to the store (after filteri= ng it > -out) and returning a package that uses that as its 'source'." > + (lambda () > + "Return a package representing Guix built from the currently used on= e. > +This works by either looking up profile or build metadata, and building = from > +the current Guix channel. If that metadata is missing, assume we are ru= nning > +from a Git checkout, so add the current source tree to the store (after > +filtering it out) and return a package that uses that as its 'source'." > + (let* ((guix-channel (find guix-channel? (current-channels))) > + (repository-root (canonicalize-path > + (string-append (current-source-directory) > + "/../.."))) > + (select? (or (git-predicate repository-root) > + source-file?))) We should keep these two variables as promises in the closure, to make sure we don=E2=80=99t recompute them over and over=E2=80=A6 unless =E2=80= =98lambda=E2=80=99 is changed to =E2=80=98mlambda=E2=80=99 in the same commit, which is probably the best= course of action.