GNU bug report logs -
#79577
[PATCH] monad-repl: Add "build-options" command.
Previous Next
To reply to this bug, email your comments to 79577 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
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#79577; Package
guix-patches.
(Sun, 05 Oct 2025 13:23:03 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.
(Sun, 05 Oct 2025 13:23:03 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
There currently was no way to disable build offload for ,build from inside the
REPL. Since offloaded builds sometimes do not error report entirely
correctly, it is useful to be able to switch to local builds.
This commit adds new ,build-options meta command, which allows to specify
build options, including #:offload?.
* guix/monad-repl.scm (%build-options): New variable.
(evaluate/print-with-store, package-argument-command): Use it.
(build-options): New meta command to set it.
* doc/guix.texi (Using Guix Interactively): Document it.
---
doc/guix.texi | 10 ++++++++++
guix/monad-repl.scm | 35 +++++++++++++++++++++++++++--------
2 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3fd2a13968..5c82445619 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13204,6 +13204,16 @@ Using Guix Interactively
output file name(s).
@end deffn
+@deffn {REPL command} build-options @var{options}
+Set build options for rest of the REPL commands to @var{options}. Must
+be a list of keywords with values accepted by procedure
+@code{(@@ (guix store) set-build-options)}. An example would be:
+
+@example
+,build-options '(#:offload? #f)
+@end example
+@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 d6b39112b7..60bdd029f5 100644
--- a/guix/monad-repl.scm
+++ b/guix/monad-repl.scm
@@ -1,3 +1,5 @@
+;;; Copyright (C) 2024 Tomas Volf <~@wolfsden.cz>
+;;; SPDX-License-Identifier: AGPL-3.0-only
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014-2016, 2022-2023 Ludovic Courtès <ludo <at> gnu.org>
;;;
@@ -81,13 +83,18 @@ (define %build-verbosity
;; Current build verbosity level.
1)
+(define %build-options
+ ;; Additional build options.
+ '())
+
(define* (evaluate/print-with-store mvalue #:key build?)
"Run monadic value MVALUE in the store monad and print its value."
(with-store store
- (set-build-options store
- #:print-build-trace #t
- #:print-extended-build-trace? #t
- #:multiplexed-build-output? #t)
+ (apply set-build-options store
+ #:print-build-trace #t
+ #:print-extended-build-trace? #t
+ #:multiplexed-build-output? #t
+ %build-options)
(with-status-verbosity %build-verbosity
(let* ((guile (or (%guile-for-build)
(default-guile-derivation store)))
@@ -130,6 +137,17 @@ (define-meta-command ((build guix) repl (form))
(evaluate/print-with-store (lower-object (repl-eval repl form))
#:build? #t))
+(define-meta-command ((build-options guix) repl (opts))
+ "build-options OPTIONS
+Set build options to OPTIONS. Print previous value (to allow easy restore).
+
+Must be a list of keywords with values accepted by procedure
+(@ (guix store) set-build-options). An example would be:
+
+ ,build-options '(#:offload? #f)"
+ (repl-print repl %build-options)
+ (set! %build-options (repl-eval repl opts)))
+
(define-meta-command ((enter-store-monad guix) repl)
"enter-store-monad
Enter a REPL for values in the store monad."
@@ -172,10 +190,11 @@ (define (package-argument-command repl form keyword default)
(define phases
(parameterize ((%graft? #f))
(with-store store
- (set-build-options store
- #:print-build-trace #t
- #:print-extended-build-trace? #t
- #:multiplexed-build-output? #t)
+ (apply set-build-options store
+ #:print-build-trace #t
+ #:print-extended-build-trace? #t
+ #:multiplexed-build-output? #t
+ %build-options)
(run-with-store store
(mlet %store-monad ((exp (bag->derivation bag*)))
(if (gexp? exp)
--
2.51.0
Information 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#79577; Package
guix-patches.
(Sun, 05 Oct 2025 23:50:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 79577 <at> debbugs.gnu.org (full text, mbox):
There currently was no way to disable build offload for ,build from inside the
REPL. Since offloaded builds sometimes do not error report entirely
correctly, it is useful to be able to switch to local builds.
This commit adds new ,build-options meta command, which allows to specify
build options, including #:offload?.
* guix/monad-repl.scm (%build-options): New variable.
(evaluate/print-with-store, package-argument-command): Use it.
(build-options): New meta command to set it.
* doc/guix.texi (Using Guix Interactively): Document it.
---
doc/guix.texi | 10 ++++++++++
guix/monad-repl.scm | 34 ++++++++++++++++++++++++++--------
2 files changed, 36 insertions(+), 8 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 3fd2a13968..5c82445619 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13204,6 +13204,16 @@ Using Guix Interactively
output file name(s).
@end deffn
+@deffn {REPL command} build-options @var{options}
+Set build options for rest of the REPL commands to @var{options}. Must
+be a list of keywords with values accepted by procedure
+@code{(@@ (guix store) set-build-options)}. An example would be:
+
+@example
+,build-options '(#:offload? #f)
+@end example
+@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 d6b39112b7..db4fe3c699 100644
--- a/guix/monad-repl.scm
+++ b/guix/monad-repl.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014-2016, 2022-2023 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2025 Tomas Volf <~@wolfsden.cz>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -81,13 +82,18 @@ (define %build-verbosity
;; Current build verbosity level.
1)
+(define %build-options
+ ;; Additional build options.
+ '())
+
(define* (evaluate/print-with-store mvalue #:key build?)
"Run monadic value MVALUE in the store monad and print its value."
(with-store store
- (set-build-options store
- #:print-build-trace #t
- #:print-extended-build-trace? #t
- #:multiplexed-build-output? #t)
+ (apply set-build-options store
+ #:print-build-trace #t
+ #:print-extended-build-trace? #t
+ #:multiplexed-build-output? #t
+ %build-options)
(with-status-verbosity %build-verbosity
(let* ((guile (or (%guile-for-build)
(default-guile-derivation store)))
@@ -130,6 +136,17 @@ (define-meta-command ((build guix) repl (form))
(evaluate/print-with-store (lower-object (repl-eval repl form))
#:build? #t))
+(define-meta-command ((build-options guix) repl (opts))
+ "build-options OPTIONS
+Set build options to OPTIONS. Print previous value (to allow easy restore).
+
+Must be a list of keywords with values accepted by procedure
+(@ (guix store) set-build-options). An example would be:
+
+ ,build-options '(#:offload? #f)"
+ (repl-print repl %build-options)
+ (set! %build-options (repl-eval repl opts)))
+
(define-meta-command ((enter-store-monad guix) repl)
"enter-store-monad
Enter a REPL for values in the store monad."
@@ -172,10 +189,11 @@ (define (package-argument-command repl form keyword default)
(define phases
(parameterize ((%graft? #f))
(with-store store
- (set-build-options store
- #:print-build-trace #t
- #:print-extended-build-trace? #t
- #:multiplexed-build-output? #t)
+ (apply set-build-options store
+ #:print-build-trace #t
+ #:print-extended-build-trace? #t
+ #:multiplexed-build-output? #t
+ %build-options)
(run-with-store store
(mlet %store-monad ((exp (bag->derivation bag*)))
(if (gexp? exp)
--
2.51.0
Information forwarded
to
guix-patches <at> gnu.org:
bug#79577; Package
guix-patches.
(Mon, 06 Oct 2025 09:09:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 79577 <at> debbugs.gnu.org (full text, mbox):
Hi,
Tomas Volf <~@wolfsden.cz> writes:
> There currently was no way to disable build offload for ,build from inside the
> REPL. Since offloaded builds sometimes do not error report entirely
> correctly, it is useful to be able to switch to local builds.
>
> This commit adds new ,build-options meta command, which allows to specify
> build options, including #:offload?.
>
> * guix/monad-repl.scm (%build-options): New variable.
> (evaluate/print-with-store, package-argument-command): Use it.
> (build-options): New meta command to set it.
> * doc/guix.texi (Using Guix Interactively): Document it.
Applied, thanks!
Information forwarded
to
guix-patches <at> gnu.org:
bug#79577; Package
guix-patches.
(Tue, 07 Oct 2025 00:56:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 79577 <at> debbugs.gnu.org (full text, mbox):
Hi,
Ludovic Courtès <ludo <at> gnu.org> writes:
> Hi,
>
> Tomas Volf <~@wolfsden.cz> writes:
>
>> There currently was no way to disable build offload for ,build from inside the
>> REPL. Since offloaded builds sometimes do not error report entirely
>> correctly, it is useful to be able to switch to local builds.
>>
>> This commit adds new ,build-options meta command, which allows to specify
>> build options, including #:offload?.
>>
>> * guix/monad-repl.scm (%build-options): New variable.
>> (evaluate/print-with-store, package-argument-command): Use it.
>> (build-options): New meta command to set it.
>> * doc/guix.texi (Using Guix Interactively): Document it.
Would there be a way to set these options to a default of my choosing?
I want to see the build log most of the time, when hacking on a package,
for example.
Or perhaps the verbosity should be set higher by default for this, as
it's meant for interactive usage?
--
Thanks,
Maxim
Information forwarded
to
guix-patches <at> gnu.org:
bug#79577; Package
guix-patches.
(Tue, 07 Oct 2025 09:48:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 79577 <at> debbugs.gnu.org (full text, mbox):
Hi,
Maxim Cournoyer <maxim <at> guixotic.coop> writes:
>>> This commit adds new ,build-options meta command, which allows to specify
>>> build options, including #:offload?.
>>>
>>> * guix/monad-repl.scm (%build-options): New variable.
>>> (evaluate/print-with-store, package-argument-command): Use it.
>>> (build-options): New meta command to set it.
>>> * doc/guix.texi (Using Guix Interactively): Document it.
>
> Would there be a way to set these options to a default of my choosing?
For sure, you can do that from .guile.
> I want to see the build log most of the time, when hacking on a package,
> for example.
I too want to see the logs! For that reason, I have the following in my
.guile (inside a guard checking that we are in guix repl):
--8<---------------cut here---------------start------------->8---
(display "Increasing build verbosity...\n")
(set! (@@ (guix monad-repl) %build-verbosity) 3)
--8<---------------cut here---------------end--------------->8---
>
> Or perhaps the verbosity should be set higher by default for this, as
> it's meant for interactive usage?
Maybe? I find that the increased verbosity works for me, but can
definitely see arguments for the current default. So no strong opinion.
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
This bug report was last modified 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.