Fix Guix version number in pulled (=most) manuals

  • Open
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
  • Simon Tournier
Owner
unassigned
Submitted by
Tobias Geerinckx-Rice
Severity
normal
T
T
Tobias Geerinckx-Rice wrote on 22 Sep 2023 01:07
(address . guix-patches@gnu.org)
87edirt4ft.fsf@nckx
Hi all,

To avoid expensive rebuilds, (guix self) explicitly substitutes
the less than satisfying "0.0-git" as version number for the
Texinfo manual.

In some cases, that's merely ugly and confusing:

Toggle quote (3 lines)
> This document describes GNU Guix version 0.0-git, a functional
> package management tool written for the GNU system.

or

Toggle quote (5 lines)
> If you’re running Debian or a derivative such as Ubuntu, you can
> instead install the package (it might be a version older than
> 0.0-git but you can update it afterwards by running ‘guix
> pull’):

But in most cases it's worse:

Toggle quote (3 lines)
> 1. Download the binary tarball from
> ‘https://ftp.gnu.org/gnu/guix/guix-binary-0.0-git.x86_64-linux.tar.xz’,

eek

Toggle quote (4 lines)
> $ wget
> https://ftp.gnu.org/gnu/guix/guix-binary-0.0-git.x86_64-linux.tar.xz.sig
> $ gpg --verify guix-binary-0.0-git.x86_64-linux.tar.xz.sig

boo

Toggle quote (5 lines)
> An ISO-9660 installation image that can be written to a USB
> stick
> or burnt to a DVD can be downloaded from
> ‘https://ftp.gnu.org/gnu/guix/guix-system-install-0.0-git.x86_64-linux.iso’

nein

Toggle quote (2 lines)
> make sure you checked the GPG signature of ‘guix-0.0-git.tar.gz’

Imagine coming to this with a fresh mind & without our knowledge
that this is ‘obviously wrong’. After all: this is the official
upstream updater, not some random git snapshot!

(Only later will you find out the truth that it is both, but
you'll no longer care.)

Anyway. So hesitant am I to even READ future (gnu packages
package-management) versions from older Guixen that I've committed
the crime of regex, twice. Punish me by sharing your thoughts.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCZQzlRg0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15w3IA/0wVWwaF/jQDFuWUGNCYga6htHVgh1lfgaouIuQL
3rgHAP9zmtrl8bRbIpbIqkl8L8zcpEnOleNsmRgH/BpdFX/0DQ==
=j+qh
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 17 Sep 2023 02:00
[PATCH] doc: Mention it when we were pulled.
(address . 66148@debbugs.gnu.org)
dae1caae6a5355977e6fc0d94b0c16278be206d8.1694908801.git.me@tobias.gr
Now that we use the latest release VERSION even for pulled Guixes,
make it abundantly clear that this is a later build.

* guix/self.scm (info-manual): @set the PULLED flag in version.texi.
* doc/guix.texi (Top): Honour it.
---
doc/guix.texi | 5 +++--
guix/self.scm | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)

Toggle diff (66 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 39088b954b..c959cff1a1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -166,8 +166,9 @@
@node Top
@top GNU Guix
-This document describes GNU Guix version @value{VERSION}, a functional
-package management tool written for the GNU system.
+This document describes GNU Guix @inlineifset{GUIX-PULLED, from a
+@command{guix pull} after the release of} version @value{VERSION}, a
+functional package management tool written for the GNU system.
@c TRANSLATORS: You can replace the following paragraph with information on
@c how to join your own translation team and how to report issues with the
diff --git a/guix/self.scm b/guix/self.scm
index 2d11dd47a4..81c5c722e0 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -469,6 +469,10 @@ (define (info-manual source)
v)
"0.0-git")))
(format output "\
+@c There's no Texinfo command to test whether @value{UPDATED} ends in 1970 and
+@c tweak the intro to guix.texi accordingly, so we add this Guix-specific flag.
+@set GUIX-PULLED true
+
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@set EDITION ~a

base-commit: ee7c9d254117fa470686210ad2ef5e7f1ba4fefc
prerequisite-patch-id: 4df99ef206175ed2fc52016929d4b7a3413a36dc
prerequisite-patch-id: 61f4235965cf06a4a9a619afb1606c6b9f9eeaf1
prerequisite-patch-id: 4e22c12f447e759bbd52a486f25e279829c7b88f
prerequisite-patch-id: 7e6e4ab87b52996e9bb6cd8595889f21ba87e9fe
prerequisite-patch-id: 6f86f2a54f77c0e8841b6f22953c2f748e358107
prerequisite-patch-id: 7c88071ffd6af8c9de9a44ef2e745e3b111d28e7
prerequisite-patch-id: dacf336396c4f629906e4689dc2868d437179a37
prerequisite-patch-id: 35641348fcba881313d08cb85da3722ba0891264
prerequisite-patch-id: ea98f949fde81f63a309e36405b87463dc07ac50
prerequisite-patch-id: a299994eb9a52db942a5cc3a038b8bc34529c799
prerequisite-patch-id: 9ffc6d3a9be37af59ec29bfce0543cf8371edacb
prerequisite-patch-id: c489fbc8af7d431f9372d0b8bc9e4c609703680e
prerequisite-patch-id: 471c932817cc1044fd03f56e1a1f84e4ce4029a9
prerequisite-patch-id: 88f3a5981ea62ce654a48c258df09315f24ba73e
prerequisite-patch-id: 62b7b8d8b26d642f524d45e910f7685a57345d76
prerequisite-patch-id: 6ad7cb518d3f48614c97e7ef851289a8f4375306
prerequisite-patch-id: 758284e9a8f0cbc718feace3ba3575478360b88a
prerequisite-patch-id: 3fec7d86bd725207d19e77b38cba7f989af68ea3
prerequisite-patch-id: 3bd20d51aa3a07f86722c5894b85f58b96e1e798
prerequisite-patch-id: 1011132081c09cd02295c999c9af44d1191bc4b2
prerequisite-patch-id: c3b42b9e20d68f2d3522424af509bfa6c8e79ee8
prerequisite-patch-id: 760df26aee26e14249c412f32630ae6e71a3fa3e
prerequisite-patch-id: b89039b55bef0639c3679b1a5ba13b7a5593af5b
prerequisite-patch-id: 24fc8fdb82bb9287ed944673e2f922587bc49503
prerequisite-patch-id: 077e45c8081930192499bfa5c7391d882b1ad401
prerequisite-patch-id: 68aa5fda780581e44d43d179d71b1232e568bcd3
prerequisite-patch-id: f31368d6b77f811e4b1fba489492ac4d6cde0948
prerequisite-patch-id: fc4e5787813af14bc812bc61a18acd684bd319af
prerequisite-patch-id: 08f122a2c9dec498a089d665280f37191f96a1ba
prerequisite-patch-id: 8df25a01fcb36ee0616d12930524131a6cb5af40
prerequisite-patch-id: a603c66d00222e69422a06d56784dc4362cd5fcd
--
2.41.0
T
T
Tobias Geerinckx-Rice wrote on 17 Sep 2023 01:59
[PATCH v2 1/2] [Sloppy PoC] self: Use a more meaningful VERSION string for manuals.
(address . 66148@debbugs.gnu.org)
dd2fb832636c6859d7dfa1fcbd4dc3a7d6559673.1694908800.git.me@tobias.gr
* guix/self.scm (info-manual): Use the last public Guix release,
according to our own guix package.
---
gnu/packages/package-management.scm | 2 +-
guix/self.scm | 52 ++++++++++++++++++++++++-----
2 files changed, 44 insertions(+), 10 deletions(-)

Toggle diff (118 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index cbda40f78b..a7f3363f4e 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -172,7 +172,7 @@ (define (boot-guile-uri arch)
(define-public guix
;; Latest version of Guix, which may or may not correspond to a release.
;; Note: the 'update-guix-package.scm' script expects this definition to
- ;; start precisely like this.
+ ;; start precisely like this. Also match the regexps in (guix self)!
(let ((version "1.4.0")
(commit "4dfdd822102690b5687acf28365ab707b68d9476")
(revision 10))
diff --git a/guix/self.scm b/guix/self.scm
index 5c8c00e0b0..2d11dd47a4 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -418,23 +418,57 @@ (define (info-manual source)
(define examples
(file-append* source "gnu/system/examples"))
+ ;; Sniff the latest public Guix release version number from this file.
+ (define guix-package-module
+ (file-append* source "gnu/packages/package-management.scm"))
+
(define build
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils)
- (ice-9 match))
+ (ice-9 match)
+ (ice-9 rdelim)
+ (ice-9 regex))
+
+ ;; Use regular expressions rather than READ to ‘parse’ the guix
+ ;; package, in an attempt not to limit any future reader extensions.
+ (define guix-package-regexp
+ (make-regexp
+ "^\\(define[-[:alnum:]]*[[:blank:]]+guix([^[:alnum:]]|$)"))
+
+ (define guix-package-version-regexp
+ (make-regexp "\\(version[[:blank:]]*\"([^\"]*)\"\\)"))
+
+ (define (get-guix-package-version port)
+ (let loop ()
+ (let ((line (read-line port)))
+ (unless (or (eof-object? line)
+ (regexp-exec guix-package-regexp line))
+ (loop))))
+ (let loop ()
+ (let ((line (read-line port)))
+ (if (eof-object? line)
+ #f
+ (let ((rx (regexp-exec guix-package-version-regexp line)))
+ (if (eq? 2 (and=> rx match:count))
+ (match:substring rx 1)
+ (loop)))))))
(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'. We could sniff the git commit from the
+ ;; SOURCE file name, but don't: not only is the manual expensive to
+ ;; rebuild, VERSION is used almost exclusively to construct release
+ ;; URLs and the like.
(call-with-output-file "version.texi"
- (lambda (port)
- (let ((version "0.0-git"))
- (pk (find-files #$source "."))
- (punt)
- (format port "
+ (lambda (output)
+ (let* ((input (open-file #$guix-package-module "r"))
+ (version (if input
+ (let ((v (get-guix-package-version input)))
+ (close-port input)
+ v)
+ "0.0-git")))
+ (format output "\
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@set EDITION ~a

base-commit: ee7c9d254117fa470686210ad2ef5e7f1ba4fefc
prerequisite-patch-id: 4df99ef206175ed2fc52016929d4b7a3413a36dc
prerequisite-patch-id: 61f4235965cf06a4a9a619afb1606c6b9f9eeaf1
prerequisite-patch-id: 4e22c12f447e759bbd52a486f25e279829c7b88f
prerequisite-patch-id: 7e6e4ab87b52996e9bb6cd8595889f21ba87e9fe
prerequisite-patch-id: 6f86f2a54f77c0e8841b6f22953c2f748e358107
prerequisite-patch-id: 7c88071ffd6af8c9de9a44ef2e745e3b111d28e7
prerequisite-patch-id: dacf336396c4f629906e4689dc2868d437179a37
prerequisite-patch-id: 35641348fcba881313d08cb85da3722ba0891264
prerequisite-patch-id: ea98f949fde81f63a309e36405b87463dc07ac50
prerequisite-patch-id: a299994eb9a52db942a5cc3a038b8bc34529c799
prerequisite-patch-id: 9ffc6d3a9be37af59ec29bfce0543cf8371edacb
prerequisite-patch-id: c489fbc8af7d431f9372d0b8bc9e4c609703680e
prerequisite-patch-id: 471c932817cc1044fd03f56e1a1f84e4ce4029a9
prerequisite-patch-id: 88f3a5981ea62ce654a48c258df09315f24ba73e
prerequisite-patch-id: 62b7b8d8b26d642f524d45e910f7685a57345d76
prerequisite-patch-id: 6ad7cb518d3f48614c97e7ef851289a8f4375306
prerequisite-patch-id: 758284e9a8f0cbc718feace3ba3575478360b88a
prerequisite-patch-id: 3fec7d86bd725207d19e77b38cba7f989af68ea3
prerequisite-patch-id: 3bd20d51aa3a07f86722c5894b85f58b96e1e798
prerequisite-patch-id: 1011132081c09cd02295c999c9af44d1191bc4b2
prerequisite-patch-id: c3b42b9e20d68f2d3522424af509bfa6c8e79ee8
prerequisite-patch-id: 760df26aee26e14249c412f32630ae6e71a3fa3e
prerequisite-patch-id: b89039b55bef0639c3679b1a5ba13b7a5593af5b
prerequisite-patch-id: 24fc8fdb82bb9287ed944673e2f922587bc49503
prerequisite-patch-id: 077e45c8081930192499bfa5c7391d882b1ad401
prerequisite-patch-id: 68aa5fda780581e44d43d179d71b1232e568bcd3
prerequisite-patch-id: f31368d6b77f811e4b1fba489492ac4d6cde0948
prerequisite-patch-id: fc4e5787813af14bc812bc61a18acd684bd319af
prerequisite-patch-id: 08f122a2c9dec498a089d665280f37191f96a1ba
prerequisite-patch-id: 8df25a01fcb36ee0616d12930524131a6cb5af40
--
2.41.0
T
T
Tobias Geerinckx-Rice wrote on 17 Sep 2023 02:00
[PATCH v2 2/2] doc: Mention it when we were pulled.
(address . 66148@debbugs.gnu.org)
dae1caae6a5355977e6fc0d94b0c16278be206d8.1694908800.git.me@tobias.gr
Now that we use the latest release VERSION even for pulled Guixes,
make it abundantly clear that this is a later build.

* guix/self.scm (info-manual): @set the PULLED flag in version.texi.
* doc/guix.texi (Top): Honour it.
---
doc/guix.texi | 5 +++--
guix/self.scm | 4 ++++
2 files changed, 7 insertions(+), 2 deletions(-)

Toggle diff (33 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 39088b954b..c959cff1a1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -166,8 +166,9 @@
@node Top
@top GNU Guix
-This document describes GNU Guix version @value{VERSION}, a functional
-package management tool written for the GNU system.
+This document describes GNU Guix @inlineifset{GUIX-PULLED, from a
+@command{guix pull} after the release of} version @value{VERSION}, a
+functional package management tool written for the GNU system.
@c TRANSLATORS: You can replace the following paragraph with information on
@c how to join your own translation team and how to report issues with the
diff --git a/guix/self.scm b/guix/self.scm
index 2d11dd47a4..81c5c722e0 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -469,6 +469,10 @@ (define (info-manual source)
v)
"0.0-git")))
(format output "\
+@c There's no Texinfo command to test whether @value{UPDATED} ends in 1970 and
+@c tweak the intro to guix.texi accordingly, so we add this Guix-specific flag.
+@set GUIX-PULLED true
+
@set UPDATED 1 January 1970
@set UPDATED-MONTH January 1970
@set EDITION ~a
--
2.41.0
L
L
Ludovic Courtès wrote on 22 Sep 2023 15:17
Re: bug#66148: Fix Guix version number in pulled (=most) manuals
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
875y42bb40.fsf_-_@gnu.org
Hi!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (6 lines)
> Now that we use the latest release VERSION even for pulled Guixes,
> make it abundantly clear that this is a later build.
>
> * guix/self.scm (info-manual): @set the PULLED flag in version.texi.
> * doc/guix.texi (Top): Honour it.

Yeah, great initiative!

I wonder if we could avoid adding code to (guix self). For instance,
we could have (guix self) leave ‘VERSION’ undefined and in the manual
we’d have those @inlineifset{VERSION, version @value{VERSION}, revision
from @command{guix pull}}.

How does that sound?

Ludo’.
T
T
Tobias Geerinckx-Rice wrote on 22 Sep 2023 16:51
74D0DE30-C47C-47C7-8CE9-0919E8D43EE1@tobias.gr
Sounds good, but my main objection is to the bogus URLs and image file names.

I considered a simpler @set RELEASE 1.4.0 that is 'manually' updated on each stable & rc release, but prefer automation. However, I'm not familiar with the work of a release manager. If they are expected to run some script anyway, that could work.

Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.

Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.
L
L
Ludovic Courtès wrote on 25 Sep 2023 16:57
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 66148@debbugs.gnu.org)
87bkdq5mhl.fsf@gnu.org
Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (2 lines)
> Sounds good, but my main objection is to the bogus URLs and image file names.

Oh right.

Toggle quote (2 lines)
> I considered a simpler @set RELEASE 1.4.0 that is 'manually' updated on each stable & rc release, but prefer automation. However, I'm not familiar with the work of a release manager. If they are expected to run some script anyway, that could work.

Yes, it should definitely be automated.

So I guess we need something like you proposed. However, I’d go for
plain ‘read’ + ‘match’ instead of regexps. It should be good enough,
and we can make it fail-safe.

How does that sound?

Thanks,
Ludo’.
S
S
Simon Tournier wrote on 26 Sep 2023 07:59
Re: [bug#66148] Fix Guix version number in pulled (=most) manuals
(address . 66148@debbugs.gnu.org)
86a5t9jwzx.fsf@gmail.com
Hi,

On Mon, 25 Sep 2023 at 16:57, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (11 lines)
> Tobias Geerinckx-Rice <me@tobias.gr> skribis:
>
>> Sounds good, but my main objection is to the bogus URLs and image file names.
>
> Oh right.
>
>> I considered a simpler @set RELEASE 1.4.0 that is 'manually' updated
> >on each stable & rc release, but prefer automation. However, I'm not
>> familiar with the work of a release manager. If they are expected to
>> run some script anyway, that could work.

And VERSION also leads to broken URL, as with:

@url{@value{BASE-URL}/guix-system-vm-image-@value{VERSION}.x86_64-linux.qcow2}

Cheers,
simon
S
S
Simon Tournier wrote on 26 Sep 2023 07:56
86fs31jx48.fsf@gmail.com
Hi Tobias,

You can also add #66189:


On Fri, 22 Sep 2023 at 01:07, Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org> wrote:

Toggle quote (18 lines)
>> 1. Download the binary tarball from
>> ‘https://ftp.gnu.org/gnu/guix/guix-binary-0.0-git.x86_64-linux.tar.xz’,
>
> eek
>
>> $ wget
>> https://ftp.gnu.org/gnu/guix/guix-binary-0.0-git.x86_64-linux.tar.xz.sig
>> $ gpg --verify guix-binary-0.0-git.x86_64-linux.tar.xz.sig
>
> boo
>
>> An ISO-9660 installation image that can be written to a USB
>> stick
>> or burnt to a DVD can be downloaded from
>> ‘https://ftp.gnu.org/gnu/guix/guix-system-install-0.0-git.x86_64-linux.iso’
>
> nein

T
T
Tobias Geerinckx-Rice wrote on 29 Sep 2023 13:42
Re: bug#66148: Fix Guix version number in pulled (=most) manuals
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 66148@debbugs.gnu.org)
30272dc4591353e906e1c811c199faf8@tobias.gr
Hi!

On 2023-09-25 16:57, Ludovic Courtès wrote:
Toggle quote (3 lines)
> plain ‘read’ + ‘match’ instead of regexps. It should be good enough,
> and we can make it fail-safe.

You tease. How?

Fail-safe is key: I'm not a READ guru, I just know it throws on unknown
#-forms by default, which is unacceptable here.

Toggle quote (2 lines)
> How does that sound?

Alluring.

Kind regards,

T G-R

Sent from a Web browser. Excuse or enjoy my brevity.
L
L
Ludovic Courtès wrote on 1 Oct 2023 17:14
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 66148@debbugs.gnu.org)
87lecms7c0.fsf@gnu.org
Hello!

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (9 lines)
> On 2023-09-25 16:57, Ludovic Courtès wrote:
>> plain ‘read’ + ‘match’ instead of regexps. It should be good enough,
>> and we can make it fail-safe.
>
> You tease. How?
>
> Fail-safe is key: I'm not a READ guru, I just know it throws on
> unknown #-forms by default, which is unacceptable here.

In practice, the only hash extension we care about is that of (guix
gexp). If we have it loaded, we can ‘read’ the thing and be done with
it.

Now, I guess I’m starting to understand: we can’t easily have (guix
gexp) loaded in there, right?

In that case, for the purposes of extracting the ‘guix’ version number,
would it be enough to have a simplified version of those extensions (the
‘read-hash-extend’ at the bottom of gexp.scm)?… Hmm, I’m not so sure
anymore…

Ludo’.
L
L
Ludovic Courtès wrote on 14 Oct 2023 17:34
Re: [bug#66148] [PATCH] doc: Mention it when we were pulled.
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87lec5fcb6.fsf@gnu.org
Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (6 lines)
> Now that we use the latest release VERSION even for pulled Guixes,
> make it abundantly clear that this is a later build.
>
> * guix/self.scm (info-manual): @set the PULLED flag in version.texi.
> * doc/guix.texi (Top): Honour it.

Even simpler. LGTM!

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 66148@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66148
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch