Guix version rendered as 0.0-git in info manual

  • Open
  • quality assurance status badge
Details
5 participants
  • Arun Isaac
  • Bengt Richter
  • Efraim Flashner
  • Ludovic Courtès
  • zimoun
Owner
unassigned
Submitted by
Arun Isaac
Severity
normal
A
A
Arun Isaac wrote on 5 Jul 2020 09:59
(address . bug-guix@gnu.org)
877dviv1d0.fsf@systemreboot.net
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
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl8BiF4ACgkQLiXui2GA
K7MnsAgAiI974Rx8d1/zY013tfam96NoHc/3d/+5t9UHbYU2LW9uBPtI04v4PIVq
p+nmtbqlxf2zD4KBEiWueDb2rD9cWKUat4xyAfvEq9t/JgCytkFt2vQvkEvsWGUC
q8tLp/UbQxOxXx0lfVxXwptvP0gnt6eWzYfRsCXSWs1lS3/HennJbBMKbMEWEBTl
KE/pA+p9Ftgb2QgiYf1MsnfdkgPC3KH3Ah8CFKhsUcRIpsCPs2SL2mhCtzXkUmjL
HsdGB+8lAbrOTZMprPonIokA+ZN7dpXDXfceQBv2R6tjMiZIh5vH8gLwSwC1O6sH
PAMdUcPEJBpSHIql/Ysw5jRwMqwglA==
=bNkq
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 10 Jul 2020 00:29
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 42212@debbugs.gnu.org)
878sfs9vak.fsf@gnu.org
Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

Toggle quote (5 lines)
> 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’.
A
A
Arun Isaac wrote on 15 Jul 2020 23:42
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 42212@debbugs.gnu.org)
871rlczc8i.fsf@systemreboot.net
Toggle quote (7 lines)
> 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?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl8PeE0ACgkQLiXui2GA
K7NcEQf+PRJ3V00qNk2xvwI+YxaYQTmphSAXwgqwjY6kuy5/UHQ63NyviUf6rmvt
5hmcyE148NL2EaRFgzbkNSvczIdmYoAFYeIijsAsQm2toNL9Sr06bRIbrVeE4pwW
BBaAMr4V3sqBy6akjfd3ffh4IcbZMbiK/pKOcg87z+b7u++YYq3gKUvXqoXqT/+T
ulmTRkkKEuT/LzsQKAgVDwSgnLMEWIPorkTS9krgmDI2hYjSrdn9u1rDEn39o/8N
8SqkWDK58XbiAW6kqes5bQzsIm+Q4wEPALcq728NWRrz5hceRYXrG+3YLghwI8Un
S5CzNKqnuED6attEqcjSB2DHwSqVuw==
=6RFp
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 16 Jul 2020 01:26
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 42212@debbugs.gnu.org)
87tuy8741o.fsf@gnu.org
Hi,

Arun Isaac <arunisaac@systemreboot.net> skribis:

Toggle quote (11 lines)
>> 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’.
B
B
Bengt Richter wrote on 16 Jul 2020 02:46
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20200716004600.GA3021@LionPure
On +2020-07-16 03:12:37 +0530, Arun Isaac wrote:
Toggle quote (12 lines)
>
> > 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 ;)
Toggle snippet (2 lines)
readlink -f /var/guix/profiles/per-user/{$USER,root}/current-guix/manifest|xargs grep -m1 -A1 guix
get you? Anything useful?

On my other laptop, it got me (again copied/...elided from other screen)
Toggle snippet (7 lines)
/gnu/store/.../manifest: (("guix"
/gnu/store/.../manifest- "87850c0"
--
/gnu/store/.../manifest: (("guix"
/gnu/store/.../manifest- "0.16.0"

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
B
B
Bengt Richter wrote on 16 Jul 2020 07:08
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 42212@debbugs.gnu.org)
20200716050842.GA3527@LionPure
On +2020-07-16 02:46:00 +0200, Bengt Richter wrote:
Toggle quote (35 lines)
> 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.

Toggle quote (9 lines)
>
> HTH
> --
> Regards,
> Bengt Richter
>
>
>

--
Regards,
Bengt Richter
Z
Z
zimoun wrote on 16 Jul 2020 11:37
(name . Ludovic Courtès)(address . ludo@gnu.org)
86lfjjztpm.fsf@gmail.com
Hi,

On Fri, 10 Jul 2020 at 00:29, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (13 lines)
> Arun Isaac <arunisaac@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?


Toggle quote (3 lines)
> 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].


All the best,
simon

ps:
Sorry Ludo for the double sending, I missed the "reply all".
L
L
Ludovic Courtès wrote on 16 Jul 2020 11:48
(name . zimoun)(address . zimon.toutoune@gmail.com)
87imen7pud.fsf@gnu.org
Hi,

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

Toggle quote (16 lines)
> On Fri, 10 Jul 2020 at 00:29, Ludovic Courtès <ludo@gnu.org> wrote:
>> Arun Isaac <arunisaac@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’.
Z
Z
zimoun wrote on 16 Jul 2020 12:06
(name . Bengt Richter)(address . bokr@bokr.com)
86eepbzscg.fsf@gmail.com
Dear Bengt,

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

Toggle quote (4 lines)
> 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:

Toggle snippet (14 lines)
(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))))

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

All the best,
simon
Z
Z
zimoun wrote on 16 Jul 2020 12:19
(name . Ludovic Courtès)(address . ludo@gnu.org)
86blkfzrrb.fsf@gmail.com
On Thu, 16 Jul 2020 at 11:48, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (9 lines)
>>> 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". :-)


Cheers,
simon
E
E
Efraim Flashner wrote on 16 Jul 2020 21:36
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200716193629.GJ10256@E5400
On Fri, Jul 10, 2020 at 12:29:39AM +0200, Ludovic Courtès wrote:
Toggle quote (21 lines)
> Hi Arun,
>
> Arun Isaac <arunisaac@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@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
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl8QrDoACgkQQarn3Mo9
g1GpohAAr8Awujfha3JKucAgotFzbi0HB1cuDI1v5Q+7c5fF/OFepZS/QsoDCgxO
zvgtfAq2fPSu9t8yIrO8ytqruRDvbrmM/uz36Pq201R2EK4txz9QILoaP5OdhkME
c0S27efDgSsp+JLZxnTB7QzRbmOq5SvbBc/P4dOWr862zrk3ROAimfxz/PGeSqr6
ls+NfDs35wcv5W5sA5T3xI0WY9SekcUeKeopo3eSjZEmTzwJGya258XHse/X9UBe
E9/Pf7Q9MitRmyEgS4VJxudAxQjKtBJwM3QAd79QWAFMEYV1WZQmQSWcaWsyCiCy
gYOrTu+Y2CkASuDEtQb6aPPcWPkVeNaoGMXOwSXAlYBRqGycOh7HAhi+bUxXM1FB
1bpYnkwTzrYqKpmtiOUbWRPwgvBqMwth8eBlyYS9YmY79fMmvuC32WH1/OlXdTua
1C1D2RNs17Lx+2mYmXbyte8glDMVzDL2od/C1IE78Dh98y7VxyUK2fBdVfqKT1qE
JR3xyIe/nS/ajSwx2abreHtD1UasJK2zirbqtA2tJbwrZO5h+Rz2aJ0P7Y6ajVGx
iEbjGVNHmWzpJpwIKDs6Q+2UWaivaaXlrO7pAJxsKPHUZAggs0NVf3FfEWngLrBQ
UvLzGgrdQ9dLaALB8mrNWfrHtV/En30Q/onlar+wEYf2Wv60qiM=
=Lc88
-----END PGP SIGNATURE-----


A
A
Arun Isaac wrote on 18 Jul 2020 01:55
[PATCH 0/1] Use nearest tag as the version string in documentation.
20200717235503.19809-1-arunisaac@systemreboot.net
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
A
A
Arun Isaac wrote on 18 Jul 2020 01:55
[PATCH 1/1] self: Use nearest tag as the version string in documentation.
20200717235503.19809-2-arunisaac@systemreboot.net
* 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(-)

Toggle diff (86 lines)
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@gnu.org>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac@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@gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac@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
L
L
Ludovic Courtès wrote on 20 Jul 2020 10:13
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
87r1t6zjrl.fsf@gnu.org
Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> skribis:

Toggle quote (5 lines)
> * 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:

Toggle quote (12 lines)
> + ;; 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’.
A
A
Arun Isaac wrote on 20 Jul 2020 10:36
(name . Ludovic Courtès)(address . ludo@gnu.org)
87y2ney44f.fsf@systemreboot.net
Toggle quote (3 lines)
> 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?

Toggle quote (4 lines)
> 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?

Toggle quote (5 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl8VV6EACgkQLiXui2GA
K7PmqAf/S2ttkVBAnJnydeHPje3CBRwdu/cF2UaIDQgQXdvgcC3bf/VkdI8MXcd/
d9th3ahuaQ63prz7JH1EnvF9QuVGRhjTo1D1C1GF5gEpLQNLdGO07S0YS4J0h5TJ
JXd1mSJGVOrW/fYbGDL3YbWXNhbFTk6HJiWhkwdebvlhVDjYoYV83GafHwdGMkLG
6Df6bs6eoR2D8aQc+0rZPcZYGjpcIJc/bkOlwuMAbd13YD14meC349JNwDMcZvlJ
pT6HUGcDqcIZ27bEuAjOmbkxcKFnPnm3pQOUmptNTIqEIzVHvoYv/dpMYOlYI8lH
onpYAgQglPt33tr7/AJC9VTKLTXKHA==
=/GWM
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 20 Jul 2020 14:32
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
87ft9mqsd2.fsf@gnu.org
Arun Isaac <arunisaac@systemreboot.net> skribis:

Toggle quote (6 lines)
>> 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. :-)

Toggle quote (11 lines)
>> 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.

Toggle quote (7 lines)
>> 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’.
Z
Z
zimoun wrote on 20 Jul 2020 15:42
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAJ3okZ2ohPcjc7YzPtoE_b-euFHFNOMNCCteJRKtPBn6_uvuDA@mail.gmail.com
Hi,

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

Toggle quote (11 lines)
> > 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
...
guix-manual 4.4MiB

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

Toggle quote (8 lines)
> 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
A
A
Arun Isaac wrote on 28 Jul 2020 01:13
[PATCH v2 0/1] Use nearest tag as the version string in documentation
20200727231332.10489-1-arunisaac@systemreboot.net
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
A
A
Arun Isaac wrote on 28 Jul 2020 01:13
[PATCH v2 1/1] Use nearest tag as the version string in documentation.
20200727231332.10489-2-arunisaac@systemreboot.net
* 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(-)

Toggle diff (66 lines)
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@gnu.org>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac@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@gnu.org>
+;;; Copyright © 2020 Arun Isaac <arunisaac@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
?