* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
@ 2024-09-01 13:54 Tomas Volf
2024-09-09 14:40 ` Ludovic Courtès
2024-10-06 13:23 ` [bug#72928] [PATCH v2] " Tomas Volf
0 siblings, 2 replies; 11+ messages in thread
From: Tomas Volf @ 2024-09-01 13:54 UTC (permalink / raw)
To: 72928
Cc: Tomas Volf, Christopher Baines, Josselin Poiret,
Ludovic Courtès, Mathieu Othacehe, Simon Tournier,
Tobias Geerinckx-Rice
Instead of warning, print the profile path of the cached-channel-instance.
* guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
the profile directory.
Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
---
guix/scripts/time-machine.scm | 38 +++++++++++++++++------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index d9ce85df84..8cad457ade 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -179,22 +179,22 @@ (define-command (guix-time-machine . args)
(ref (assoc-ref opts 'ref))
(substitutes? (assoc-ref opts 'substitutes?))
(authenticate? (assoc-ref opts 'authenticate-channels?)))
- (if command-line
- (let* ((directory
- (with-store store
- (with-status-verbosity (assoc-ref opts 'verbosity)
- (with-build-handler (build-notifier #:use-substitutes?
- substitutes?
- #:verbosity
- (assoc-ref opts 'verbosity)
- #:dry-run? #f)
- (set-build-options-from-command-line store opts)
- (cached-channel-instance store channels
- #:authenticate? authenticate?
- #:reference-channels
- %reference-channels
- #:validate-channels
- validate-guix-channel)))))
- (executable (string-append directory "/bin/guix")))
- (apply execl (cons* executable executable command-line)))
- (warning (G_ "no command specified; nothing to do~%")))))))
+ (let* ((directory
+ (with-store store
+ (with-status-verbosity (assoc-ref opts 'verbosity)
+ (with-build-handler (build-notifier #:use-substitutes?
+ substitutes?
+ #:verbosity
+ (assoc-ref opts 'verbosity)
+ #:dry-run? #f)
+ (set-build-options-from-command-line store opts)
+ (cached-channel-instance store channels
+ #:authenticate? authenticate?
+ #:reference-channels
+ %reference-channels
+ #:validate-channels
+ validate-guix-channel)))))
+ (executable (string-append directory "/bin/guix")))
+ (if command-line
+ (apply execl (cons* executable executable command-line))
+ (format #t "~a\n" directory)))))))
base-commit: ef525ba96f04c6b3a5e45ab5333c9f440df81e5f
--
2.45.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-01 13:54 [bug#72928] [PATCH] time-machine: Print profile path if no command is given Tomas Volf
@ 2024-09-09 14:40 ` Ludovic Courtès
2024-09-15 20:38 ` Tomas Volf
2024-10-06 13:23 ` [bug#72928] [PATCH v2] " Tomas Volf
1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2024-09-09 14:40 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
Tobias Geerinckx-Rice, Christopher Baines, 72928
Hi,
Tomas Volf <~@wolfsden.cz> skribis:
> Instead of warning, print the profile path of the cached-channel-instance.
>
> * guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
> the profile directory.
>
> Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
[...]
> + (if command-line
> + (apply execl (cons* executable executable command-line))
> + (format #t "~a\n" directory)))))))
Maybe print ‘executable’ rather than ‘directory’?
Also perhaps add a sentence or two in the manual?
At any rate, this sounds like a useful change to me.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-09 14:40 ` Ludovic Courtès
@ 2024-09-15 20:38 ` Tomas Volf
2024-09-15 21:29 ` Ludovic Courtès
2024-10-04 15:45 ` Ludovic Courtès
0 siblings, 2 replies; 11+ messages in thread
From: Tomas Volf @ 2024-09-15 20:38 UTC (permalink / raw)
To: Ludovic Courtès
Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
Tobias Geerinckx-Rice, Christopher Baines, 72928
[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]
Hello,
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Tomas Volf <~@wolfsden.cz> skribis:
>
>> Instead of warning, print the profile path of the cached-channel-instance.
>>
>> * guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
>> the profile directory.
>>
>> Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
>
> [...]
>
>> + (if command-line
>> + (apply execl (cons* executable executable command-line))
>> + (format #t "~a\n" directory)))))))
>
> Maybe print ‘executable’ rather than ‘directory’?
Printing directory gives nice symmetry between
--8<---------------cut here---------------start------------->8---
$ $(guix build guix)/bin/guix describe
guix 9a2ddcc
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
--8<---------------cut here---------------end--------------->8---
and
--8<---------------cut here---------------start------------->8---
$ $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
guix 9a2ddcc
repository URL: https://git.savannah.gnu.org/git/guix.git
commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
--8<---------------cut here---------------end--------------->8---
And in some cases you need the store item (guix copy?), and in my
opinion it is easier to go from directory to binary than other way
around.
But just let me know which way I should do it.
>
> Also perhaps add a sentence or two in the manual?
Ah, yeah, definitely. Once previous point is clarified, I will send v2.
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-15 20:38 ` Tomas Volf
@ 2024-09-15 21:29 ` Ludovic Courtès
2024-09-20 15:49 ` Simon Tournier
2024-10-04 15:45 ` Ludovic Courtès
1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2024-09-15 21:29 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
Tobias Geerinckx-Rice, Christopher Baines, 72928
Hi,
Tomas Volf <~@wolfsden.cz> skribis:
>>> + (if command-line
>>> + (apply execl (cons* executable executable command-line))
>>> + (format #t "~a\n" directory)))))))
>>
>> Maybe print ‘executable’ rather than ‘directory’?
>
> Printing directory gives nice symmetry between
>
> $ $(guix build guix)/bin/guix describe
> guix 9a2ddcc
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
>
>
> and
>
> $ $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
> guix 9a2ddcc
> repository URL: https://git.savannah.gnu.org/git/guix.git
> commit: 9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a
>
> And in some cases you need the store item (guix copy?), and in my
> opinion it is easier to go from directory to binary than other way
> around.
Ah yes, good points, I agree. Let’s do that.
> Ah, yeah, definitely. Once previous point is clarified, I will send v2.
Green light as far as I’m concerned!
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-15 21:29 ` Ludovic Courtès
@ 2024-09-20 15:49 ` Simon Tournier
2024-09-22 14:09 ` Tomas Volf
0 siblings, 1 reply; 11+ messages in thread
From: Simon Tournier @ 2024-09-20 15:49 UTC (permalink / raw)
To: Ludovic Courtès, Tomas Volf
Cc: Mathieu Othacehe, Josselin Poiret, Tobias Geerinckx-Rice, 72928,
Christopher Baines
Hi,
On dim., 15 sept. 2024 at 23:29, Ludovic Courtès <ludo@gnu.org> wrote:
>> Printing directory gives nice symmetry between
>>
>> $ $(guix build guix)/bin/guix describe
[...]
>> $ $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
[...]
>> And in some cases you need the store item (guix copy?), and in my
>> opinion it is easier to go from directory to binary than other way
>> around.
Well, I do not have a strong opinion. And indeed the symmetry looks
nice. However, just to be sure: what’s the use case? Because
$(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
is equivalent to:
guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a -- describe
Cheers,
simon
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-20 15:49 ` Simon Tournier
@ 2024-09-22 14:09 ` Tomas Volf
2024-09-26 15:59 ` Simon Tournier
0 siblings, 1 reply; 11+ messages in thread
From: Tomas Volf @ 2024-09-22 14:09 UTC (permalink / raw)
To: Simon Tournier
Cc: Josselin Poiret, Mathieu Othacehe, Ludovic Courtès,
Tobias Geerinckx-Rice, Christopher Baines, 72928
[-- Attachment #1: Type: text/plain, Size: 2096 bytes --]
Hi,
Simon Tournier <zimon.toutoune@gmail.com> writes:
> Hi,
>
> On dim., 15 sept. 2024 at 23:29, Ludovic Courtès <ludo@gnu.org> wrote:
>
>>> Printing directory gives nice symmetry between
>>>
>>> $ $(guix build guix)/bin/guix describe
>
> [...]
>
>>> $ $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
>
> [...]
>
>>> And in some cases you need the store item (guix copy?), and in my
>>> opinion it is easier to go from directory to binary than other way
>>> around.
>
> Well, I do not have a strong opinion. And indeed the symmetry looks
> nice. However, just to be sure: what’s the use case? Because
>
>
> $(guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a)/bin/guix describe
>
> is equivalent to:
>
> guix time-machine -q --commit=9a2ddcc8f5a6f64b475eeb13a3f1034aa6a4a49a -- describe
That is true. While I think the symmetry is nice (and goes with
principle of least surprise), I am not interested in running guix this
way.
I am interested in getting the store item for the time-machined version
of guix. Currently I have two uses in mind:
1. Using `guix copy' to avoid computing the guix derivation when I need
to test something on less powerful machines. Guix does not built fast,
so this saves both time and electricity.
2. Having something to pass into guix field of guix-configuration.
Guix time-machine works great for both, since it is automatically built,
cached and automatically cleaned after some time. Only pain point is
getting the profile store path out of it. With the proposed change it
will be as simple as
--8<---------------cut here---------------start------------->8---
store_item=$(realpath $(guix time-machine -C channels.scm))
--8<---------------cut here---------------end--------------->8---
Does this sufficiently justify the existence of this functionality in
your eyes?
Have a nice day,
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-22 14:09 ` Tomas Volf
@ 2024-09-26 15:59 ` Simon Tournier
0 siblings, 0 replies; 11+ messages in thread
From: Simon Tournier @ 2024-09-26 15:59 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Mathieu Othacehe, Ludovic Courtès,
Tobias Geerinckx-Rice, Christopher Baines, 72928
Hi,
On Sun, 22 Sep 2024 at 16:09, Tomas Volf <~@wolfsden.cz> wrote:
> Does this sufficiently justify the existence of this functionality in
> your eyes?
Indeed it is boring to get the store path and this patch will simplify
my life. :-)
Cheers,
simon
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH] time-machine: Print profile path if no command is given.
2024-09-15 20:38 ` Tomas Volf
2024-09-15 21:29 ` Ludovic Courtès
@ 2024-10-04 15:45 ` Ludovic Courtès
1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2024-10-04 15:45 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Simon Tournier, Mathieu Othacehe,
Tobias Geerinckx-Rice, Christopher Baines, 72928
Hey Tomas,
Tomas Volf <~@wolfsden.cz> skribis:
> Ah, yeah, definitely. Once previous point is clarified, I will send v2.
Please feel free to send v2 anytime, now that there’s consensus.
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH v2] time-machine: Print profile path if no command is given.
2024-09-01 13:54 [bug#72928] [PATCH] time-machine: Print profile path if no command is given Tomas Volf
2024-09-09 14:40 ` Ludovic Courtès
@ 2024-10-06 13:23 ` Tomas Volf
2024-10-07 9:56 ` bug#72928: " Ludovic Courtès
2024-10-07 9:59 ` [bug#72928] " Ludovic Courtès
1 sibling, 2 replies; 11+ messages in thread
From: Tomas Volf @ 2024-10-06 13:23 UTC (permalink / raw)
To: 72928
Cc: Tomas Volf, Christopher Baines, Florian Pelz, Josselin Poiret,
Ludovic Courtès, Mathieu Othacehe, Maxim Cournoyer,
Simon Tournier, Tobias Geerinckx-Rice
Instead of warning, print the profile path of the cached-channel-instance.
* guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
the profile directory.
(show-help): Adjust usage message.
* doc/guix.texi (Invoking guix time-machine): Document it.
Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
---
Adjust usage message and document the new behavior.
doc/guix.texi | 5 ++++
guix/scripts/time-machine.scm | 44 ++++++++++++++++++-----------------
2 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 52e36e4354..72871316c8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4762,6 +4762,11 @@ Invoking guix time-machine
their dependencies, and these are controlled by the standard build
options (@pxref{Common Build Options}).
+If @command{guix time-machine} is executed without any command, it
+prints the path to the guix profile that would be used to execute the
+command. This is sometimes useful if you need to get store path for the
+profile, e.g. when you want to @command{guix copy} it.
+
@node Inferiors
@section Inferiors
diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm
index d9ce85df84..21145239d4 100644
--- a/guix/scripts/time-machine.scm
+++ b/guix/scripts/time-machine.scm
@@ -52,8 +52,10 @@ (define-module (guix scripts time-machine)
;;;
(define (show-help)
- (display (G_ "Usage: guix time-machine [OPTION] -- COMMAND ARGS...
-Execute COMMAND ARGS... in an older version of Guix.\n"))
+ (display (G_ "Usage: guix time-machine [OPTION] [-- COMMAND ARGS...]
+Execute COMMAND ARGS... in an older version of Guix.
+
+If COMMAND is not provided, print path to the time-machine profile.\n"))
(display (G_ "
-C, --channels=FILE deploy the channels defined in FILE"))
(display (G_ "
@@ -179,22 +181,22 @@ (define-command (guix-time-machine . args)
(ref (assoc-ref opts 'ref))
(substitutes? (assoc-ref opts 'substitutes?))
(authenticate? (assoc-ref opts 'authenticate-channels?)))
- (if command-line
- (let* ((directory
- (with-store store
- (with-status-verbosity (assoc-ref opts 'verbosity)
- (with-build-handler (build-notifier #:use-substitutes?
- substitutes?
- #:verbosity
- (assoc-ref opts 'verbosity)
- #:dry-run? #f)
- (set-build-options-from-command-line store opts)
- (cached-channel-instance store channels
- #:authenticate? authenticate?
- #:reference-channels
- %reference-channels
- #:validate-channels
- validate-guix-channel)))))
- (executable (string-append directory "/bin/guix")))
- (apply execl (cons* executable executable command-line)))
- (warning (G_ "no command specified; nothing to do~%")))))))
+ (let* ((directory
+ (with-store store
+ (with-status-verbosity (assoc-ref opts 'verbosity)
+ (with-build-handler (build-notifier #:use-substitutes?
+ substitutes?
+ #:verbosity
+ (assoc-ref opts 'verbosity)
+ #:dry-run? #f)
+ (set-build-options-from-command-line store opts)
+ (cached-channel-instance store channels
+ #:authenticate? authenticate?
+ #:reference-channels
+ %reference-channels
+ #:validate-channels
+ validate-guix-channel)))))
+ (executable (string-append directory "/bin/guix")))
+ (if command-line
+ (apply execl (cons* executable executable command-line))
+ (format #t "~a\n" directory)))))))
base-commit: a873666d3bf716a5ae29275efaa000eaf6d1e2a8
--
2.46.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* bug#72928: [PATCH v2] time-machine: Print profile path if no command is given.
2024-10-06 13:23 ` [bug#72928] [PATCH v2] " Tomas Volf
@ 2024-10-07 9:56 ` Ludovic Courtès
2024-10-07 9:59 ` [bug#72928] " Ludovic Courtès
1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2024-10-07 9:56 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Maxim Cournoyer, Simon Tournier,
Mathieu Othacehe, Tobias Geerinckx-Rice, Florian Pelz, 72928-done,
Christopher Baines
Tomas Volf <~@wolfsden.cz> writes:
> Instead of warning, print the profile path of the cached-channel-instance.
>
> * guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
> the profile directory.
> (show-help): Adjust usage message.
> * doc/guix.texi (Invoking guix time-machine): Document it.
>
> Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
Applied, thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#72928] [PATCH v2] time-machine: Print profile path if no command is given.
2024-10-06 13:23 ` [bug#72928] [PATCH v2] " Tomas Volf
2024-10-07 9:56 ` bug#72928: " Ludovic Courtès
@ 2024-10-07 9:59 ` Ludovic Courtès
1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2024-10-07 9:59 UTC (permalink / raw)
To: Tomas Volf
Cc: Josselin Poiret, Maxim Cournoyer, Simon Tournier,
Mathieu Othacehe, Tobias Geerinckx-Rice, Florian Pelz, 72928-done,
Christopher Baines
[-- Attachment #1: Type: text/plain, Size: 564 bytes --]
Tomas Volf <~@wolfsden.cz> skribis:
> Instead of warning, print the profile path of the cached-channel-instance.
>
> * guix/scripts/time-machine.scm (guix-time-machine)[not command-line]: Print
> the profile directory.
> (show-help): Adjust usage message.
> * doc/guix.texi (Invoking guix time-machine): Document it.
>
> Change-Id: Id2c1ded514e6c5af45af9008ad1ef91beb509177
Applied, thanks!
I took the liberty to make the cosmetic changes below to be consistent
with the style and terminology used throughout the manual.
Thanks!
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 726 bytes --]
diff --git a/doc/guix.texi b/doc/guix.texi
index e643aec19a..4aafcf9cc0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4763,9 +4763,9 @@ Invoking guix time-machine
options (@pxref{Common Build Options}).
If @command{guix time-machine} is executed without any command, it
-prints the path to the guix profile that would be used to execute the
-command. This is sometimes useful if you need to get store path for the
-profile, e.g. when you want to @command{guix copy} it.
+prints the file name of the profile that would be used to execute the
+command. This is sometimes useful if you need to get store file name of
+the profile---e.g., when you want to @command{guix copy} it.
@node Inferiors
@section Inferiors
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-10-07 10:00 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01 13:54 [bug#72928] [PATCH] time-machine: Print profile path if no command is given Tomas Volf
2024-09-09 14:40 ` Ludovic Courtès
2024-09-15 20:38 ` Tomas Volf
2024-09-15 21:29 ` Ludovic Courtès
2024-09-20 15:49 ` Simon Tournier
2024-09-22 14:09 ` Tomas Volf
2024-09-26 15:59 ` Simon Tournier
2024-10-04 15:45 ` Ludovic Courtès
2024-10-06 13:23 ` [bug#72928] [PATCH v2] " Tomas Volf
2024-10-07 9:56 ` bug#72928: " Ludovic Courtès
2024-10-07 9:59 ` [bug#72928] " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.