GNU bug report logs - #42212
Guix version rendered as 0.0-git in info manual

Previous Next

Package: guix;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Sun, 5 Jul 2020 08:00:02 UTC

Severity: normal

To reply to this bug, email your comments to 42212 AT debbugs.gnu.org.

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

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


Report forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Sun, 05 Jul 2020 08:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Arun Isaac <arunisaac <at> systemreboot.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 05 Jul 2020 08:00:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: bug-guix <at> gnu.org
Subject: Guix version rendered as 0.0-git in info manual
Date: Sun, 05 Jul 2020 13:29:23 +0530
[Message part 1 (text/plain, inline)]
In the info manual, the Guix version is rendered as 0.0-git. For
example, in "(guix) The Store", see "The ability to connect to remote
build daemons is considered experimental as of 0.0-git". I am running
the Guix standalone system. Any idea what's going wrong?

Thanks,
Arun
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 09 Jul 2020 22:30:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Fri, 10 Jul 2020 00:29:39 +0200
Hi Arun,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> In the info manual, the Guix version is rendered as 0.0-git. For
> example, in "(guix) The Store", see "The ability to connect to remote
> build daemons is considered experimental as of 0.0-git". I am running
> the Guix standalone system. Any idea what's going wrong?

Nothing!  :-)

The “0.0-git” string comes from (guix self).  As noted there, we can’t
really afford to change the version string at each commit, or we’d have
to rebuild the manual at each commit.

We could perhaps choose a more meaningful version string, though, maybe
by looking at the closest tag or something.

Thoughts?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Wed, 15 Jul 2020 21:43:01 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 03:12:37 +0530
[Message part 1 (text/plain, inline)]
> The “0.0-git” string comes from (guix self).  As noted there, we can’t
> really afford to change the version string at each commit, or we’d have
> to rebuild the manual at each commit.
>
> We could perhaps choose a more meaningful version string, though, maybe
> by looking at the closest tag or something.

That sounds good, and `git describe` could provide us with the closest
tag. Unfortunately, (git) doesn't seem to be available during `guix
pull`. I'm trying to come up with workarounds. Do you have any ideas?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Wed, 15 Jul 2020 23:28:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 01:26:59 +0200
Hi,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

>> The “0.0-git” string comes from (guix self).  As noted there, we can’t
>> really afford to change the version string at each commit, or we’d have
>> to rebuild the manual at each commit.
>>
>> We could perhaps choose a more meaningful version string, though, maybe
>> by looking at the closest tag or something.
>
> That sounds good, and `git describe` could provide us with the closest
> tag. Unfortunately, (git) doesn't seem to be available during `guix
> pull`. I'm trying to come up with workarounds. Do you have any ideas?

I’m not sure exactly.  (guix self) receives a commit ID as #:version
(though it doesn’t have to; it can be a random string too, as in
‘build-aux/compile-as-derivation.scm’).

Maybe when (guix channels) ‘build-from-source’ invokes ‘build’, it could
pass it an optional short version identifier guaranteed to rarely
change.  (There’s a (git describe) module in Guile-Git that might be
helpful.)

That version identifier must then be passed from
‘build-aux/build-self.scm’ all the way to ‘info-manual’ in (guix self).

Thoughts?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 00:47:01 GMT) Full text and rfc822 format available.

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

From: Bengt Richter <bokr <at> bokr.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 42212 <at> debbugs.gnu.org,
 zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 02:46:00 +0200
On +2020-07-16 03:12:37 +0530, Arun Isaac wrote:
> 
> > The “0.0-git” string comes from (guix self).  As noted there, we can’t
> > really afford to change the version string at each commit, or we’d have
> > to rebuild the manual at each commit.
> >
> > We could perhaps choose a more meaningful version string, though, maybe
> > by looking at the closest tag or something.
> 
> That sounds good, and `git describe` could provide us with the closest
> tag. Unfortunately, (git) doesn't seem to be available during `guix
> pull`. I'm trying to come up with workarounds. Do you have any ideas?

What does (copied from another laptop screen by hand, typos possible ;)
--8<---------------cut here---------------start------------->8---
readlink -f /var/guix/profiles/per-user/{$USER,root}/current-guix/manifest|xargs grep -m1 -A1 guix
--8<---------------cut here---------------end--------------->8---
get you? Anything useful?

On my other laptop, it got me (again copied/...elided from other screen)
--8<---------------cut here---------------start------------->8---
/gnu/store/.../manifest: (("guix"
/gnu/store/.../manifest-   "87850c0"
--
/gnu/store/.../manifest: (("guix"
/gnu/store/.../manifest-   "0.16.0"
--8<---------------cut here---------------end--------------->8---

You can see that's ancient, so IDK if the same command will work for you.
"guix -V" there still shows 0.16.0 (which version should that show, BTW?)

I don't know how these versions correspond to what pull creates,
but zimoun is a whiz on that stuff, so maybe he will chime in :)
(I Cc'd him to raise the probability :)

HTH
-- 
Regards,
Bengt Richter




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 05:10:02 GMT) Full text and rfc822 format available.

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

From: Bengt Richter <bokr <at> bokr.com>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 07:08:42 +0200
On +2020-07-16 02:46:00 +0200, Bengt Richter wrote:
> On +2020-07-16 03:12:37 +0530, Arun Isaac wrote:
> > 
> > > The “0.0-git” string comes from (guix self).  As noted there, we can’t
> > > really afford to change the version string at each commit, or we’d have
> > > to rebuild the manual at each commit.
> > >
> > > We could perhaps choose a more meaningful version string, though, maybe
> > > by looking at the closest tag or something.
> > 
> > That sounds good, and `git describe` could provide us with the closest
> > tag. Unfortunately, (git) doesn't seem to be available during `guix
> > pull`. I'm trying to come up with workarounds. Do you have any ideas?
> 
> What does (copied from another laptop screen by hand, typos possible ;)
> --8<---------------cut here---------------start------------->8---
> readlink -f /var/guix/profiles/per-user/{$USER,root}/current-guix/manifest|xargs grep -m1 -A1 guix
> --8<---------------cut here---------------end--------------->8---
> get you? Anything useful?
> 
> On my other laptop, it got me (again copied/...elided from other screen)
> --8<---------------cut here---------------start------------->8---
> /gnu/store/.../manifest: (("guix"
> /gnu/store/.../manifest-   "87850c0"
> --
> /gnu/store/.../manifest: (("guix"
> /gnu/store/.../manifest-   "0.16.0"
> --8<---------------cut here---------------end--------------->8---
> 
> You can see that's ancient, so IDK if the same command will work for you.
> "guix -V" there still shows 0.16.0 (which version should that show, BTW?)
> 
> I don't know how these versions correspond to what pull creates,
> but zimoun is a whiz on that stuff, so maybe he will chime in :)
> (I Cc'd him to raise the probability :)

Sorry, I seem not to have succeeded with the Cc: to zimoun
Or it's been scrubbed out of the headers.
Ah, do I faintly remember that one needs a special incantation?
Sorry, I will look into it.

> 
> HTH
> -- 
> Regards,
> Bengt Richter
> 
> 
> 

-- 
Regards,
Bengt Richter




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 09:38:01 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 11:37:25 +0200
Hi,

On Fri, 10 Jul 2020 at 00:29, Ludovic Courtès <ludo <at> gnu.org> wrote:
> Arun Isaac <arunisaac <at> systemreboot.net> skribis:
>
>> In the info manual, the Guix version is rendered as 0.0-git. For
>> example, in "(guix) The Store", see "The ability to connect to remote
>> build daemons is considered experimental as of 0.0-git". I am running
>> the Guix standalone system. Any idea what's going wrong?
>
> Nothing!  :-)
>
> The “0.0-git” string comes from (guix self).  As noted there, we can’t
> really afford to change the version string at each commit, or we’d have
> to rebuild the manual at each commit.

Why is it an issue if the manual is substituted?


> We could perhaps choose a more meaningful version string, though, maybe
> by looking at the closest tag or something.

For example, when I pull I have something like:

   /gnu/store/…-guix-1b2141743-modules.drv

so why this commit ID could not be reused in the manual?  For example,
the devel version of the manual contains the commit ID, see [1].

1: https://guix.gnu.org/manual/devel/en/guix.html#The-Store

All the best,
simon

ps:
Sorry Ludo for the double sending, I missed the "reply all".




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 09:49:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 11:48:26 +0200
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> On Fri, 10 Jul 2020 at 00:29, Ludovic Courtès <ludo <at> gnu.org> wrote:
>> Arun Isaac <arunisaac <at> systemreboot.net> skribis:
>>
>>> In the info manual, the Guix version is rendered as 0.0-git. For
>>> example, in "(guix) The Store", see "The ability to connect to remote
>>> build daemons is considered experimental as of 0.0-git". I am running
>>> the Guix standalone system. Any idea what's going wrong?
>>
>> Nothing!  :-)
>>
>> The “0.0-git” string comes from (guix self).  As noted there, we can’t
>> really afford to change the version string at each commit, or we’d have
>> to rebuild the manual at each commit.
>
> Why is it an issue if the manual is substituted?

If it has to be rebuilt at every commit, chances are you won’t get
substitutes because it has to be built on the build farm, too.  :-)

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 10:08:03 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Bengt Richter <bokr <at> bokr.com>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>,
 Ludovic Courtès <ludo <at> gnu.org>,
 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 12:06:55 +0200
Dear Bengt,

On Thu, 16 Jul 2020 at 02:46, Bengt Richter <bokr <at> bokr.com> wrote:

> readlink -f /var/guix/profiles/per-user/{$USER,root}/current-guix/manifest|xargs grep -m1 -A1 guix
>
> get you? Anything useful?

I am not sure the issue is to get the commit identifier. :-)

Otherwise, the Guix schemish way is something like:

--8<---------------cut here---------------start------------->8---
(use-modules
 (ice-9 match)
 (srfi srfi-1)
 ((guix describe) #:select (current-profile))
 ((guix config) #:select (%guix-version))
 (guix channels))

(match (current-profile)
  (#f %guix-version)   ;for lack of a better ID
  (profile
   (let ((channel (find guix-channel? (profile-channels profile))))
     (channel-commit channel))))
--8<---------------cut here---------------end--------------->8---

(From a Ludo’s hint for the last sources.json patch. :-))

All the best,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 10:20:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 12:19:36 +0200
On Thu, 16 Jul 2020 at 11:48, Ludovic Courtès <ludo <at> gnu.org> wrote:

>>> The “0.0-git” string comes from (guix self).  As noted there, we can’t
>>> really afford to change the version string at each commit, or we’d have
>>> to rebuild the manual at each commit.
>>
>> Why is it an issue if the manual is substituted?
>
> If it has to be rebuilt at every commit, chances are you won’t get
> substitutes because it has to be built on the build farm, too.  :-)

How Guix distinguish between "doc commit" and other commit?
I mean, is it not the latest Guix manual that "guix pull" pulls?  With
which guarantee / confidence?

BTW, as discussed elsewhere, it should not be possible to pull non
substituable commits by default, in the meaning: commit for which the
outputs are not already built by the build farm.  Well, put again on the
table CI as in [1] for a recent "again". :-)

1: https://lists.gnu.org/archive/html/guix-devel/2020-07/msg00074.html

Cheers,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Thu, 16 Jul 2020 19:38:01 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, 42212 <at> debbugs.gnu.org
Subject: Re: bug#42212: Guix version rendered as 0.0-git in info manual
Date: Thu, 16 Jul 2020 22:36:29 +0300
[Message part 1 (text/plain, inline)]
On Fri, Jul 10, 2020 at 12:29:39AM +0200, Ludovic Courtès wrote:
> Hi Arun,
> 
> Arun Isaac <arunisaac <at> systemreboot.net> skribis:
> 
> > In the info manual, the Guix version is rendered as 0.0-git. For
> > example, in "(guix) The Store", see "The ability to connect to remote
> > build daemons is considered experimental as of 0.0-git". I am running
> > the Guix standalone system. Any idea what's going wrong?
> 
> Nothing!  :-)
> 
> The “0.0-git” string comes from (guix self).  As noted there, we can’t
> really afford to change the version string at each commit, or we’d have
> to rebuild the manual at each commit.
> 
> We could perhaps choose a more meaningful version string, though, maybe
> by looking at the closest tag or something.
> 
> Thoughts?
> 

I looked into it a bit for my os-release file.
$ guile -L /path/to/checkout
(ins)scheme@(guile-user)> (use-modules ((guix config)))
(ins)scheme@(guile-user)> %guix-version
$1 = "1.0.1.19582-d7e9e"

$ guile -L ~/.cache/guix/pull/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq/
(ins)scheme@(guile-user)> (use-modules ((guix config)))
(ins)scheme@(guile-user)> %guix-version
$1 = "1.1.0-17.36a1925"

it seems to me that (guix config) could work

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Fri, 17 Jul 2020 23:56:01 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Efraim Flashner <efraim <at> flashner.co.il>,
 Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, Bengt Richter <bokr <at> bokr.com>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH 0/1] Use nearest tag as the version string in documentation.
Date: Sat, 18 Jul 2020 05:25:02 +0530
We can't actually use (guix config) since it doesn't have a useful version
number in this stage of the build process. See the use of make-config.scm in
build-program of build-aux/build-self.scm.

We need to use the nearest tag but that requires the git repo and we drop that
in the channel checkout. See use of dot-git? in latest-channel-instance of
(guix channels). To remedy this, I am generating .version before discarding
the git repo.

WDYT?

Arun Isaac (1):
  self: Use nearest tag as the version string in documentation.

 guix/channels.scm | 15 ++++++++++++++-
 guix/self.scm     | 11 +++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)

-- 
2.26.2





Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Fri, 17 Jul 2020 23:56:01 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Efraim Flashner <efraim <at> flashner.co.il>,
 Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, Bengt Richter <bokr <at> bokr.com>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH 1/1] self: Use nearest tag as the version string in
 documentation.
Date: Sat, 18 Jul 2020 05:25:03 +0530
* guix/channels.scm (latest-channel-instance): Write nearest tag into .version
of the checkout.
* guix/self.scm (info-manual): Use nearest tag from .version as the version
string while generating documentation.
---
 guix/channels.scm | 15 ++++++++++++++-
 guix/self.scm     | 11 +++++++----
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index bbabf654a9..d35cbc42cf 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@
   #:use-module (guix sets)
   #:use-module (guix store)
   #:use-module (guix i18n)
+  #:use-module (guix build utils)
   #:use-module ((guix utils)
                 #:select (source-properties->location
                           &error-location
@@ -56,9 +58,11 @@
   #:autoload   (guix quirks) (%quirks %patches applicable-patch? apply-patch)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 popen)
   #:use-module (ice-9 vlist)
   #:use-module ((ice-9 rdelim) #:select (read-string))
   #:use-module ((rnrs bytevectors) #:select (bytevector=?))
+  #:use-module (rnrs io ports)
   #:export (channel
             channel?
             channel-name
@@ -397,7 +401,16 @@ thus potentially malicious code.")))))))
     (when (guix-channel? channel)
       ;; Apply the relevant subset of PATCHES directly in CHECKOUT.  This is
       ;; safe to do because 'switch-to-ref' eventually does a hard reset.
-      (apply-patches checkout commit patches))
+      (apply-patches checkout commit patches)
+
+      ;; Write nearest tag into .version.
+      (with-directory-excursion checkout
+        (let ((version
+               (call-with-port
+                (open-pipe* OPEN_READ "./build-aux/git-version-gen" ".tarball-version")
+                get-string-all)))
+          (call-with-output-file ".version"
+            (cut put-string <> version)))))
 
     (let* ((name     (url+commit->name (channel-url channel) commit))
            (checkout (add-to-store store name #t "sha256" checkout
diff --git a/guix/self.scm b/guix/self.scm
index f70b1ecdd8..8c94efa7de 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -459,16 +460,18 @@ a list of extra files, such as '(\"contributing\")."
     (with-imported-modules '((guix build utils))
       #~(begin
           (use-modules (guix build utils)
+                       (rnrs io ports)
                        (ice-9 match))
 
           (mkdir #$output)
 
-          ;; Create 'version.texi'.
-          ;; XXX: Can we use a more meaningful version string yet one that
-          ;; doesn't change at each commit?
+          ;; Create 'version.texi'. Use nearest tag written in .version as the
+          ;; version string.
           (call-with-output-file "version.texi"
             (lambda (port)
-              (let ((version "0.0-git"))
+              (let* ((tag (call-with-input-file (string-append #$source "/.version")
+                            get-string-all))
+                     (version (substring tag 0 (string-index-right tag #\.))))
                 (format port "
 @set UPDATED 1 January 1970
 @set UPDATED-MONTH January 1970
-- 
2.26.2





Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 20 Jul 2020 08:14:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Bengt Richter <bokr <at> bokr.com>, Efraim Flashner <efraim <at> flashner.co.il>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: [PATCH 1/1] self: Use nearest tag as the version string in
 documentation.
Date: Mon, 20 Jul 2020 10:13:34 +0200
Hi Arun,

Arun Isaac <arunisaac <at> systemreboot.net> skribis:

> * guix/channels.scm (latest-channel-instance): Write nearest tag into .version
> of the checkout.
> * guix/self.scm (info-manual): Use nearest tag from .version as the version
> string while generating documentation.

Thanks for looking into it!  Two comments:

> +      ;; Write nearest tag into .version.
> +      (with-directory-excursion checkout
> +        (let ((version
> +               (call-with-port
> +                (open-pipe* OPEN_READ "./build-aux/git-version-gen" ".tarball-version")
> +                get-string-all)))
> +          (call-with-output-file ".version"
> +            (cut put-string <> version)))))
>  
>      (let* ((name     (url+commit->name (channel-url channel) commit))
>             (checkout (add-to-store store name #t "sha256" checkout

I would rather not call out to ‘git-version-gen’ and instead use (git
describe) or similar.

However, unless I’m mistaken, the output of ‘git-version-gen’ changes at
each commit, so we’d be rebuilding the manual at every commit, which is
what we should avoid here.

One way to avoid that would be to look at the latest commit that touch
doc/ instead of the latest commit overall (I think that’s what zimoun
was suggesting).  Roughly run ‘git describe’ on ‘git log doc/’, so to
speak.  (Using Guile-Git.)

Thoughts?

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 20 Jul 2020 08:38:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Bengt Richter <bokr <at> bokr.com>, Efraim Flashner <efraim <at> flashner.co.il>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: [PATCH 1/1] self: Use nearest tag as the version string in
 documentation.
Date: Mon, 20 Jul 2020 14:06:48 +0530
[Message part 1 (text/plain, inline)]
> I would rather not call out to ‘git-version-gen’ and instead use (git
> describe) or similar.

Sure, I'll do that. Then, perhaps we should even rewrite git-version-gen
using (git describe). It would be nice to have that in guile too. WDYT?

> However, unless I’m mistaken, the output of ‘git-version-gen’ changes at
> each commit, so we’d be rebuilding the manual at every commit, which is
> what we should avoid here.

Yes, but I discard the commit part of git-version-gen's output. I keep
only the tag part.

But, like zimoun, I didn't understand why we can't rebuild the manual
every commit. Rebuilding the manual is quite cheap. So, substituting it
shouldn't be a problem, right?

> One way to avoid that would be to look at the latest commit that touch
> doc/ instead of the latest commit overall (I think that’s what zimoun
> was suggesting).  Roughly run ‘git describe’ on ‘git log doc/’, so to
> speak.  (Using Guile-Git.)

This sounds good. I'll try it and get back to you.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 20 Jul 2020 12:33:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Bengt Richter <bokr <at> bokr.com>, Efraim Flashner <efraim <at> flashner.co.il>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: Re: [PATCH 1/1] self: Use nearest tag as the version string in
 documentation.
Date: Mon, 20 Jul 2020 14:32:41 +0200
Arun Isaac <arunisaac <at> systemreboot.net> skribis:

>> I would rather not call out to ‘git-version-gen’ and instead use (git
>> describe) or similar.
>
> Sure, I'll do that. Then, perhaps we should even rewrite git-version-gen
> using (git describe). It would be nice to have that in guile too. WDYT?

Yes, but… one thing at a time.  :-)

>> However, unless I’m mistaken, the output of ‘git-version-gen’ changes at
>> each commit, so we’d be rebuilding the manual at every commit, which is
>> what we should avoid here.
>
> Yes, but I discard the commit part of git-version-gen's output. I keep
> only the tag part.
>
> But, like zimoun, I didn't understand why we can't rebuild the manual
> every commit. Rebuilding the manual is quite cheap. So, substituting it
> shouldn't be a problem, right?

Try rebuilding the manual + translations by yourself: it takes a few
minutes (see also commit a524a31de43b330c911fb08ae02fcd880d32aa04
related commits).

Also, if you don’t build it by yourself, you have to download its
substitutes, which is also not free.

So it’s really important to rebuild only when we have to.  (guix self)
is written in that spirit.

>> One way to avoid that would be to look at the latest commit that touch
>> doc/ instead of the latest commit overall (I think that’s what zimoun
>> was suggesting).  Roughly run ‘git describe’ on ‘git log doc/’, so to
>> speak.  (Using Guile-Git.)
>
> This sounds good. I'll try it and get back to you.

Thanks!

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 20 Jul 2020 13:43:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Arun Isaac <arunisaac <at> systemreboot.net>, Bengt Richter <bokr <at> bokr.com>,
 Efraim Flashner <efraim <at> flashner.co.il>, 42212 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/1] self: Use nearest tag as the version string in
 documentation.
Date: Mon, 20 Jul 2020 15:42:40 +0200
Hi,

On Mon, 20 Jul 2020 at 14:32, Ludovic Courtès <ludo <at> gnu.org> wrote:

> > But, like zimoun, I didn't understand why we can't rebuild the manual
> > every commit. Rebuilding the manual is quite cheap. So, substituting it
> > shouldn't be a problem, right?
>
> Try rebuilding the manual + translations by yourself: it takes a few
> minutes (see also commit a524a31de43b330c911fb08ae02fcd880d32aa04
> related commits).
>
> Also, if you don’t build it by yourself, you have to download its
> substitutes, which is also not free.

Not free but still cheap enough. :-)

downloading from
https://ci.guix.gnu.org/nar/lzip/p8xbha1fl3j23q05iya43ypzhzjmyr0j-guix-manual
...
 guix-manual  4.4MiB

Especially compared to the other parts of "guix pull".

> So it’s really important to rebuild only when we have to.  (guix self)
> is written in that spirit.
>
> >> One way to avoid that would be to look at the latest commit that touch
> >> doc/ instead of the latest commit overall (I think that’s what zimoun
> >> was suggesting).  Roughly run ‘git describe’ on ‘git log doc/’, so to
> >> speak.  (Using Guile-Git.)

It was not what I was suggesting but it is the next step of my question. :-)

Naively, is it not a situation about kind of grafts?

If the last commit modifying the documentation is 1234abcd, then other
changes unrelated to documentation are committed, say commit wxyz5678,
I would expect to have that commit wxyz5678 appears in the
documentation. As it seems the case with
guix.gnu.org/manual/devel/en/.
So, the documentation should be built with the commit 1234abcd and
probably substituable, then grafted to refer to the last commit
wxyz5648 where it is required.  Even if referring to commit 1234abcd
will be already enough.

All the best,
simon




Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 27 Jul 2020 23:14:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Bengt Richter <bokr <at> bokr.com>, Efraim Flashner <efraim <at> flashner.co.il>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH v2 0/1] Use nearest tag as the version string in documentation
Date: Tue, 28 Jul 2020 04:43:30 +0530
The new guile-git based patch follows. Thanks!

Arun Isaac (1):
  Use nearest tag as the version string in documentation.

 guix/channels.scm | 13 ++++++++++++-
 guix/self.scm     | 10 ++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

-- 
2.26.2





Information forwarded to bug-guix <at> gnu.org:
bug#42212; Package guix. (Mon, 27 Jul 2020 23:14:02 GMT) Full text and rfc822 format available.

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

From: Arun Isaac <arunisaac <at> systemreboot.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Arun Isaac <arunisaac <at> systemreboot.net>
Cc: Bengt Richter <bokr <at> bokr.com>, Efraim Flashner <efraim <at> flashner.co.il>,
 42212 <at> debbugs.gnu.org, zimoun <zimon.toutoune <at> gmail.com>
Subject: [PATCH v2 1/1] Use nearest tag as the version string in documentation.
Date: Tue, 28 Jul 2020 04:43:31 +0530
* guix/channels.scm (latest-channel-instance): Write nearest tag into .version
of the checkout.
* guix/self.scm (info-manual): Use nearest tag from .version as the version
string while generating documentation.
---
 guix/channels.scm | 13 ++++++++++++-
 guix/self.scm     | 10 ++++++----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index ad2442f50e..e8941bb28e 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2018 Ricardo Wurmus <rekado <at> elephly.net>
 ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -393,7 +394,17 @@ thus potentially malicious code."))))))))
     (when (guix-channel? channel)
       ;; Apply the relevant subset of PATCHES directly in CHECKOUT.  This is
       ;; safe to do because 'switch-to-ref' eventually does a hard reset.
-      (apply-patches checkout commit patches))
+      (apply-patches checkout commit patches)
+
+      ;; Write into .version, the nearest tag without the "v" prefix.
+      (call-with-output-file (string-append checkout "/.version")
+        (lambda (port)
+          (display (substring
+                    (describe-format
+                     (describe-workdir (repository-open checkout))
+                     (make-describe-format-options #:abbreviated-size 0))
+                    1)
+                   port))))
 
     (let* ((name     (url+commit->name (channel-url channel) commit))
            (checkout (add-to-store store name #t "sha256" checkout
diff --git a/guix/self.scm b/guix/self.scm
index f70b1ecdd8..58ca4386f1 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2018, 2019, 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -459,16 +460,17 @@ a list of extra files, such as '(\"contributing\")."
     (with-imported-modules '((guix build utils))
       #~(begin
           (use-modules (guix build utils)
+                       (rnrs io ports)
                        (ice-9 match))
 
           (mkdir #$output)
 
-          ;; Create 'version.texi'.
-          ;; XXX: Can we use a more meaningful version string yet one that
-          ;; doesn't change at each commit?
+          ;; Create 'version.texi'. Use nearest tag written in .version as the
+          ;; version string.
           (call-with-output-file "version.texi"
             (lambda (port)
-              (let ((version "0.0-git"))
+              (let* ((version (call-with-input-file (string-append #$source "/.version")
+                                get-string-all)))
                 (format port "
 @set UPDATED 1 January 1970
 @set UPDATED-MONTH January 1970
-- 
2.26.2





This bug report was last modified 5 years and 24 days ago.

Previous Next


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