From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mBtzBk2bW19ucAAA0tVLHw (envelope-from ) for ; Fri, 11 Sep 2020 15:44:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KPetAE2bW190QwAAbx9fmQ (envelope-from ) for ; Fri, 11 Sep 2020 15:44:13 +0000 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 99AAE9404CA for ; Fri, 11 Sep 2020 15:44:12 +0000 (UTC) Received: from localhost ([::1]:42478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGlDf-0004Zv-DC for larch@yhetil.org; Fri, 11 Sep 2020 11:44:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGlDX-0004Wk-Io for guix-patches@gnu.org; Fri, 11 Sep 2020 11:44:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGlDV-0001Ml-Lo for guix-patches@gnu.org; Fri, 11 Sep 2020 11:44:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kGlDV-0007vF-KG for guix-patches@gnu.org; Fri, 11 Sep 2020 11:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43193] [PATCH] guix: Add --with-dependency-source option Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 11 Sep 2020 15:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43193 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jesse Gibbons Cc: 43193@debbugs.gnu.org Received: via spool by 43193-submit@debbugs.gnu.org id=B43193.159983900630402 (code B ref 43193); Fri, 11 Sep 2020 15:44:01 +0000 Received: (at 43193) by debbugs.gnu.org; 11 Sep 2020 15:43:26 +0000 Received: from localhost ([127.0.0.1]:45193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGlCv-0007uI-PV for submit@debbugs.gnu.org; Fri, 11 Sep 2020 11:43:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGlCu-0007u5-8g for 43193@debbugs.gnu.org; Fri, 11 Sep 2020 11:43:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41634) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGlCp-0001IW-01; Fri, 11 Sep 2020 11:43:19 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=39618 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kGlCn-0005cf-2N; Fri, 11 Sep 2020 11:43:18 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <9c3a00ba-19bf-a8e9-8803-d150e91f1b6e@gmail.com> <87y2lige5l.fsf@gnu.org> <7f52c72f-c280-b585-d1ad-ca012f804910@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 26 Fructidor an 228 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: Fri, 11 Sep 2020 17:43:09 +0200 In-Reply-To: <7f52c72f-c280-b585-d1ad-ca012f804910@gmail.com> (Jesse Gibbons's message of "Thu, 10 Sep 2020 23:16:28 -0600") Message-ID: <87wo10s4j6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) 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" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: IsHqpCLeOq20 Hi, Jesse Gibbons skribis: >> Could you: >> >> 1. adjust doc/guix.texi accordingly? That is, if we rename this new >> option to =E2=80=98--with-source=E2=80=99, simply add a note stati= ng that it=E2=80=99s >> recursive. > I included this in the attached patch. >> 2. add a test to tests/guix-build.sh? There are already --with-source >> tests in other files. You can mimic them, essentially to make sure >> the option has an effect. >> 3. optionally add an entry as a separate commit to >> etc/news.scm. I can do that for you if you want. >> > Do you still think the tests should be updated and this change should > be announced in the news file? I'm willing to do these. Yes, please. There=E2=80=99s should be a test that checks that --with-sour= ce works for non-leaf packages. A new entry would also be nice. > From 2786da1e7011c59f08fc150dfa284f35bc0ed093 Mon Sep 17 00:00:00 2001 > From: Jesse Gibbons > Date: Thu, 3 Sep 2020 17:45:08 -0600 > Subject: [PATCH 1/1] guix: Make --with-source option recursive > > * guix/scripts/build.scm: (transform-package-inputs/source): new > function > (evaluate-source-replacement-specs): new function > (%transformations): change with-source to use > evaluate-source-replacement-specs > > *doc/guix.texi (Package Transformation Options): Document it. Nitpick: There are spacing and capitalization issues. Please see =E2=80=98= git log=E2=80=99 for examples. > +++ b/doc/guix.texi > @@ -9129,7 +9129,8 @@ without having to type in the definitions of packag= e variants > @itemx --with-source=3D@var{package}=3D@var{source} > @itemx --with-source=3D@var{package}@@@var{version}=3D@var{source} > Use @var{source} as the source of @var{package}, and @var{version} as > -its version number. > +its version number. This replacement is applied recursively on all > +dependencies only if PACKAGE is specified. s/PACKAGE/@var{package}/ However, the semantics are a bit =E2=80=9Cweird=E2=80=9D. I would just do = the recursive replacement thing unconditionally. WDYT? > +(define (transform-package-inputs/source replacement-specs) > + "Return a procedure that, when passed a package, replaces its direct > +dependencies according to REPLACEMENT-SPECS. REPLACEMENT-SPECS is a lis= t of > +strings like \"guile=3D/path/to/source\" or > +\"guile=3Dhttps://www.example.com/guile-source.tar.gz\" meaning that, any > +dependency on a package called \"guile\" must be replaced with a depende= ncy on a > +\"guile\" built with the source at the specified location." > + (match (string-tokenize (car replacement-specs) %not-equal) > + ((spec url) s/url/file/ since it=E2=80=99s a file name. > + (lambda (store obj) > + (let* ((replacements (evaluate-source-replacement-specs replaceme= nt-specs > + (lambda (= old url) > + (packag= e-with-source store old url)))) > + (rewrite (package-input-rewriting/spec replacements)) > + (rewrite* (lambda (obj) > + (rewrite obj)))) > + (if (package? obj) > + (rewrite* obj) > + obj)))) > + ((url) > + (transform-package-source replacement-specs)))) So maybe drop the second clause for non-recursive replacement, and drop =E2=80=98transform-package-source=E2=80=99 as well. Thanks! Ludo=E2=80=99.