GNU bug report logs - #79594
[PATCH] monad-repl: Add "build-graft" command.

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Tue, 7 Oct 2025 09:54:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

To reply to this bug, email your comments to 79594 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix <at> cbaines.net, gabriel <at> erlikon.ch, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, maxim <at> guixotic.coop, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Tue, 07 Oct 2025 09:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to guix <at> cbaines.net, gabriel <at> erlikon.ch, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, maxim <at> guixotic.coop, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org. (Tue, 07 Oct 2025 09:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: guix-patches <at> gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH] monad-repl: Add "build-graft" command.
Date: Tue,  7 Oct 2025 11:53:40 +0200
Grafts are not always required when just exploring in the REPL, and they do
take time, so this commit adds easy way to disable them.

* guix/monad-repl.scm (build-graft): New meta command.
* doc/guix.texi (Using Guix Interactively): Document it.
---
 doc/guix.texi       | 5 +++++
 guix/monad-repl.scm | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 7162a5f06b..7e6a0d465a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13214,6 +13214,11 @@ Using Guix Interactively
 @end example
 @end deffn
 
+@deffn {REPL command} build-graft @var{graft?}
+Set whether grafts should be performed as part of the build.  Equivalent
+to @code{--no-grafts} argument to @code{guix build}.
+@end deffn
+
 @deffn {REPL command} lower @var{object}
 Lower @var{object} into a derivation or store file name and return it.
 @end deffn
diff --git a/guix/monad-repl.scm b/guix/monad-repl.scm
index db4fe3c699..92f015a3b7 100644
--- a/guix/monad-repl.scm
+++ b/guix/monad-repl.scm
@@ -147,6 +147,11 @@ (define-meta-command ((build-options guix) repl (opts))
   (repl-print repl %build-options)
   (set! %build-options (repl-eval repl opts)))
 
+(define-meta-command ((build-graft guix) repl (graft?))
+  "build-graft GRAFT?
+Set whether grafts should be performed."
+  (%graft? (repl-eval repl graft?)))
+
 (define-meta-command ((enter-store-monad guix) repl)
   "enter-store-monad
 Enter a REPL for values in the store monad."
-- 
2.51.0





Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Sat, 29 Nov 2025 17:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Sat, 29 Nov 2025 18:01:23 +0100
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

> Grafts are not always required when just exploring in the REPL, and they do
> take time, so this commit adds easy way to disable them.
>
> * guix/monad-repl.scm (build-graft): New meta command.
> * doc/guix.texi (Using Guix Interactively): Document it.

Apologies for the delay!

This sounds like a useful REPL command to me.

> +(define-meta-command ((build-graft guix) repl (graft?))
> +  "build-graft GRAFT?
> +Set whether grafts should be performed."

Nitpicking, but I would tend to call the command “graft”: “Define
whether to graft package replacements.”

WDYT?

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Sun, 30 Nov 2025 21:06:02 GMT) Full text and rfc822 format available.

Message #11 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Sun, 30 Nov 2025 22:04:58 +0100
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi Tomas,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>> Grafts are not always required when just exploring in the REPL, and they do
>> take time, so this commit adds easy way to disable them.
>>
>> * guix/monad-repl.scm (build-graft): New meta command.
>> * doc/guix.texi (Using Guix Interactively): Document it.
>
> Apologies for the delay!

No worries, I am aware most of the focus is on Codeberg these days. :)

>
> This sounds like a useful REPL command to me.
>
>> +(define-meta-command ((build-graft guix) repl (graft?))
>> +  "build-graft GRAFT?
>> +Set whether grafts should be performed."
>
> Nitpicking, but I would tend to call the command “graft”: “Define
> whether to graft package replacements.”
>
> WDYT?

The build-graft seemed consistent with already added build-options
command and (still waiting to be sent) build-mode command.  In absence
of any name-spacing support in Guile's meta-commands, I like the common
build- prefix.

But it is your call, so just let me know if I should sent v2 with the
rename.  I care more about getting this merged than what exact name this
does have. :)

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.




Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Thu, 11 Dec 2025 09:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Thu, 11 Dec 2025 10:38:07 +0100
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

>> Nitpicking, but I would tend to call the command “graft”: “Define
>> whether to graft package replacements.”
>>
>> WDYT?
>
> The build-graft seemed consistent with already added build-options
> command and (still waiting to be sent) build-mode command.  In absence
> of any name-spacing support in Guile's meta-commands, I like the common
> build- prefix.

I agree that lack of namespacing means we should be cautious, though in
practice I know of few REPL extensions (Goblins, Fibers, and Guix are
those that come to mind) and the likelihood of name clashes is small.

The name “build-options” comes from the fact that it sets or returns the
build options, literally; the “build-” prefix is not for namespacing.

The name “build-graft” would thus follow a different pattern; I was
suggesting “graft” as the very (to graft or not to graft :-)).

> But it is your call, so just let me know if I should sent v2 with the
> rename.  I care more about getting this merged than what exact name this
> does have. :)

Heh. :-)  So I’d rather be in favor of “graft” for the command name, and
in favor of getting it merged too!

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Wed, 17 Dec 2025 09:39:07 GMT) Full text and rfc822 format available.

Message #17 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Simon Tournier <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>, Tomas Volf <~@wolfsden.cz>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Wed, 17 Dec 2025 08:57:39 +0100
Hi,

Oh nice low-hanging fruit patch! :-)

On Thu, 11 Dec 2025 at 10:38, Ludovic Courtès <ludo <at> gnu.org> wrote:

> Heh. :-)  So I’d rather be in favor of “graft” for the command name, and
> in favor of getting it merged too!

For what my opinion is worth here, I also prefer “graft”.  Or maybe
“graft?” is that’s possible since the metacommand takes a boolean,
right?

Cheers,
simon




Information forwarded to guix <at> cbaines.net, gabriel <at> erlikon.ch, ludo <at> gnu.org, maxim <at> guixotic.coop, morgan.arnold <at> proton.me, ngraves <at> ngraves.fr, rutherther <at> ditigal.xyz, zimon.toutoune <at> gmail.com, guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Wed, 17 Dec 2025 12:50:02 GMT) Full text and rfc822 format available.

Message #20 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: 79594 <at> debbugs.gnu.org
Cc: Tomas Volf <~@wolfsden.cz>
Subject: [PATCH v2] monad-repl: Add "graft?" command.
Date: Wed, 17 Dec 2025 13:47:38 +0100
Grafts are not always required when just exploring in the REPL, and they do
take time, so this commit adds easy way to disable them.

* guix/monad-repl.scm (build-graft): New meta command.
* doc/guix.texi (Using Guix Interactively): Document it.
---
v2: Rename to `graft?'.

 doc/guix.texi       | 5 +++++
 guix/monad-repl.scm | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 5171b3395f2..a2e2a8e5dfd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13265,6 +13265,11 @@ Using Guix Interactively
 @end example
 @end deffn

+@deffn {REPL command} graft? @var{graft?}
+Set whether grafts should be performed as part of the build.  Equivalent
+to @code{--no-grafts} argument to @code{guix build}.
+@end deffn
+
 @deffn {REPL command} lower @var{object}
 Lower @var{object} into a derivation or store file name and return it.
 @end deffn
diff --git a/guix/monad-repl.scm b/guix/monad-repl.scm
index f4863c0c5c1..dcb00988fe8 100644
--- a/guix/monad-repl.scm
+++ b/guix/monad-repl.scm
@@ -149,6 +149,11 @@ (define-meta-command ((build-options guix) repl (opts))
   (repl-print repl %build-options)
   (set! %build-options (repl-eval repl opts)))

+(define-meta-command ((graft? guix) repl (graft?))
+  "build-graft GRAFT?
+Set whether grafts should be performed."
+  (%graft? (repl-eval repl graft?)))
+
 (define-meta-command ((enter-store-monad guix) repl)
   "enter-store-monad
 Enter a REPL for values in the store monad."
--
2.52.0




Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Wed, 17 Dec 2025 12:58:01 GMT) Full text and rfc822 format available.

Message #23 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Simon Tournier <zimon.toutoune <at> gmail.com>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Wed, 17 Dec 2025 13:56:57 +0100
[Message part 1 (text/plain, inline)]
Simon Tournier <zimon.toutoune <at> gmail.com> writes:

> On Thu, 11 Dec 2025 at 10:38, Ludovic Courtès <ludo <at> gnu.org> wrote:
>
>> Heh. :-)  So I’d rather be in favor of “graft” for the command name, and
>> in favor of getting it merged too!
>
> For what my opinion is worth here, I also prefer “graft”.  Or maybe
> “graft?” is that’s possible since the metacommand takes a boolean,
> right?

I was thinking about that possibility, but expected it to not work.
After this nudge I gave it a try, and it seems to work:

--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,graft? #t
scheme@(guix-user)> ,graft? #f
--8<---------------cut here---------------end--------------->8---

So I have sent v2 using the `graft?' name.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Wed, 17 Dec 2025 13:12:02 GMT) Full text and rfc822 format available.

Message #26 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, Tobias Geerinckx-Rice <me <at> tobias.gr>,
 Maxim Cournoyer <maxim <at> guixotic.coop>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Gabriel Wicki <gabriel <at> erlikon.ch>, 79594 <at> debbugs.gnu.org,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#79594] [PATCH] monad-repl: Add "build-graft" command.
Date: Wed, 17 Dec 2025 14:11:44 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi Tomas,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>>> Nitpicking, but I would tend to call the command “graft”: “Define
>>> whether to graft package replacements.”
>>>
>>> WDYT?
>>
>> The build-graft seemed consistent with already added build-options
>> command and (still waiting to be sent) build-mode command.  In absence
>> of any name-spacing support in Guile's meta-commands, I like the common
>> build- prefix.
>
> I agree that lack of namespacing means we should be cautious, though in
> practice I know of few REPL extensions (Goblins, Fibers, and Guix are
> those that come to mind) and the likelihood of name clashes is small.
>
> The name “build-options” comes from the fact that it sets or returns the
> build options, literally; the “build-” prefix is not for namespacing.
>
> The name “build-graft” would thus follow a different pattern; I was
> suggesting “graft” as the very (to graft or not to graft :-)).

Since you first build the base package, and after that do the grafting,
it was posed as a question build-graft[ed-version?], but I use `graft'
as a verb too, so yeah, I see what you mean.

>
>> But it is your call, so just let me know if I should sent v2 with the
>> rename.  I care more about getting this merged than what exact name this
>> does have. :)
>
> Heh. :-)  So I’d rather be in favor of “graft” for the command name, and
> in favor of getting it merged too!

I took the liberty to go with Simon's suggestion, but if you do not like
it, I will send v3.

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#79594; Package guix-patches. (Wed, 17 Dec 2025 17:55:01 GMT) Full text and rfc822 format available.

Message #29 received at 79594 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: Nicolas Graves <ngraves <at> ngraves.fr>,
 Simon Tournier <zimon.toutoune <at> gmail.com>,
 Morgan Arnold <morgan.arnold <at> proton.me>, Gabriel Wicki <gabriel <at> erlikon.ch>,
 79594 <at> debbugs.gnu.org, Rutherther <rutherther <at> ditigal.xyz>,
 Christopher Baines <guix <at> cbaines.net>, Maxim Cournoyer <maxim <at> guixotic.coop>
Subject: Re: [bug#79594] [PATCH v2] monad-repl: Add "graft?" command.
Date: Wed, 17 Dec 2025 18:34:49 +0100
Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

> Grafts are not always required when just exploring in the REPL, and they do
> take time, so this commit adds easy way to disable them.
>
> * guix/monad-repl.scm (build-graft): New meta command.
> * doc/guix.texi (Using Guix Interactively): Document it.
> ---
> v2: Rename to `graft?'.

Applied, thanks!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 17 Dec 2025 17:55:02 GMT) Full text and rfc822 format available.

Notification sent to Tomas Volf <~@wolfsden.cz>:
bug acknowledged by developer. (Wed, 17 Dec 2025 17:55:02 GMT) Full text and rfc822 format available.

Message #34 received at 79594-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Tomas Volf <~@wolfsden.cz>
Cc: 79594-done <at> debbugs.gnu.org
Subject: Re: [bug#79594] [PATCH v2] monad-repl: Add "graft?" command.
Date: Wed, 17 Dec 2025 18:35:32 +0100
Tomas Volf <~@wolfsden.cz> skribis:

> Grafts are not always required when just exploring in the REPL, and they do
> take time, so this commit adds easy way to disable them.
>
> * guix/monad-repl.scm (build-graft): New meta command.
> * doc/guix.texi (Using Guix Interactively): Document it.
> ---
> v2: Rename to `graft?'.

Closing.




This bug report was last modified 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.