GNU bug report logs - #43101
[PATCH] Add version number in release ISO

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Sat, 29 Aug 2020 13:46:02 UTC

Severity: normal

Tags: patch

Done: Julien Lepiller <julien <at> lepiller.eu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 43101 in the body.
You can then email your comments to 43101 AT debbugs.gnu.org in the normal way.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sat, 29 Aug 2020 13:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 29 Aug 2020 13:46:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add version number in release ISO
Date: Sat, 29 Aug 2020 15:44:45 +0200
[Message part 1 (text/plain, inline)]
Hi,

I've recently proposed a patch to libosinfo database, and they
suggested that we add the version number to the ISO label, so the tool
can differentiate and identify the ISOs. See
https://gitlab.com/libosinfo/osinfo-db/-/merge_requests/202

The first patch adds the --label option to guix system, and it sets the
label for the boot partition.  The second patch simply uses it and adds
a --label option to the release target in the Makefile.
[0001-guix-system-Add-label-option.patch (text/x-patch, attachment)]
[0002-Makefile.am-Set-iso-label.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sun, 30 Aug 2020 13:48:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH] Add version number in release ISO
Date: Sun, 30 Aug 2020 15:47:04 +0200
Hi,

Julien Lepiller <julien <at> lepiller.eu> skribis:

> I've recently proposed a patch to libosinfo database, and they
> suggested that we add the version number to the ISO label, so the tool
> can differentiate and identify the ISOs. See
> https://gitlab.com/libosinfo/osinfo-db/-/merge_requests/202

Good idea.

>>From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Sat, 29 Aug 2020 15:34:56 +0200
> Subject: [PATCH 1/2] guix: system: Add `--label' option.
>
> * guix/scripts/system.scm (%options): Add `--label'.

Please describe the other changes (to ‘system-derivation-for-action’,
etc.)

> +        (partitions (match (image-partitions base-image)
> +                      ((boot others ...)
> +                       (cons
> +                         ((@ (gnu image) partition)
> +                           (inherit boot)
> +                           (label (or label (partition-label boot))))

Please include (gnu image) and avoid ‘@’.

> +  (display (G_ "
> +      --label=LABEL      for 'disk-image', label disk image with LABEL"))

Make sure to add it to doc/guix.texi as well.

>>From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Sat, 29 Aug 2020 15:36:40 +0200
> Subject: [PATCH 2/2] Makefile.am: Set iso label.
>
> * Makefile.am (release): Add version number in disk image label.

LGTM.

Thank you!  :-)

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sun, 30 Aug 2020 14:36:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH] Add version number in release ISO
Date: Sun, 30 Aug 2020 10:35:24 -0400

Le 30 août 2020 09:47:04 GMT-04:00, "Ludovic Courtès" <ludo <at> gnu.org> a écrit :
>Hi,
>
>Julien Lepiller <julien <at> lepiller.eu> skribis:
>
>> I've recently proposed a patch to libosinfo database, and they
>> suggested that we add the version number to the ISO label, so the
>tool
>> can differentiate and identify the ISOs. See
>> https://gitlab.com/libosinfo/osinfo-db/-/merge_requests/202
>
>Good idea.
>
>>>From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00
>2001
>> From: Julien Lepiller <julien <at> lepiller.eu>
>> Date: Sat, 29 Aug 2020 15:34:56 +0200
>> Subject: [PATCH 1/2] guix: system: Add `--label' option.
>>
>> * guix/scripts/system.scm (%options): Add `--label'.
>
>Please describe the other changes (to ‘system-derivation-for-action’,
>etc.)
>
>> +        (partitions (match (image-partitions base-image)
>> +                      ((boot others ...)
>> +                       (cons
>> +                         ((@ (gnu image) partition)
>> +                           (inherit boot)
>> +                           (label (or label (partition-label
>boot))))
>
>Please include (gnu image) and avoid ‘@’.

(gnu image) is already imported, but conflicts with another module for partition, leading to a compilation error. What should I do?

>
>> +  (display (G_ "
>> +      --label=LABEL      for 'disk-image', label disk image with
>LABEL"))
>
>Make sure to add it to doc/guix.texi as well.
>
>>>From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00
>2001
>> From: Julien Lepiller <julien <at> lepiller.eu>
>> Date: Sat, 29 Aug 2020 15:36:40 +0200
>> Subject: [PATCH 2/2] Makefile.am: Set iso label.
>>
>> * Makefile.am (release): Add version number in disk image label.
>
>LGTM.

I'll add the architecture in there too, as per discussion in the osinfo-db MR.

>
>Thank you!  :-)
>
>Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sun, 30 Aug 2020 15:06:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH] Add version number in release ISO
Date: Sun, 30 Aug 2020 17:05:27 +0200
Hello Julien,

Thanks for this patch!

>>Please include (gnu image) and avoid ‘@’.
>
> (gnu image) is already imported, but conflicts with another module for partition, leading to a compilation error. What should I do?

You can maybe write something like:

--8<---------------cut here---------------start------------->8---
#:use-module ((srfi srfi-1) #:hide (partition))
--8<---------------cut here---------------end--------------->8---

> I'll add the architecture in there too, as per discussion in the osinfo-db MR.

Do you think it could be useful to add the same mechanism to ISO images
built by the CI? In that case, you could maybe use the same mechanism in
(gnu ci) and label the boot partition with %guix-version?

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sun, 30 Aug 2020 15:12:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH] Add version number in release ISO
Date: Sun, 30 Aug 2020 11:11:08 -0400
[Message part 1 (text/plain, inline)]
Yes, it makes sense! I'll send a patch for that too. Thank you!

Le 30 août 2020 11:05:27 GMT-04:00, Mathieu Othacehe <othacehe <at> gnu.org> a écrit :
>
>Hello Julien,
>
>Thanks for this patch!
>
>>>Please include (gnu image) and avoid ‘@’.
>>
>> (gnu image) is already imported, but conflicts with another module
>for partition, leading to a compilation error. What should I do?
>
>You can maybe write something like:
>
>--8<---------------cut here---------------start------------->8---
>#:use-module ((srfi srfi-1) #:hide (partition))
>--8<---------------cut here---------------end--------------->8---
>
>> I'll add the architecture in there too, as per discussion in the
>osinfo-db MR.
>
>Do you think it could be useful to add the same mechanism to ISO images
>built by the CI? In that case, you could maybe use the same mechanism
>in
>(gnu ci) and label the boot partition with %guix-version?
>
>Thanks,
>
>Mathieu
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Sun, 30 Aug 2020 19:53:01 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH v2] Add version number in release ISO
Date: Sun, 30 Aug 2020 21:52:30 +0200
[Message part 1 (text/plain, inline)]
Here's v2 of the patch series. I've added one patch to (gnu ci) to set
the version number in generated ISOs, and fixed other issues in the
previous version of the patches.

Le Sun, 30 Aug 2020 11:11:08 -0400,
Julien Lepiller <julien <at> lepiller.eu> a écrit :

> Yes, it makes sense! I'll send a patch for that too. Thank you!
> 
> Le 30 août 2020 11:05:27 GMT-04:00, Mathieu Othacehe
> <othacehe <at> gnu.org> a écrit :
> >
> >Hello Julien,
> >
> >Thanks for this patch!
> >  
> >>>Please include (gnu image) and avoid ‘@’.  
> >>
> >> (gnu image) is already imported, but conflicts with another module
> >>  
> >for partition, leading to a compilation error. What should I do?
> >
> >You can maybe write something like:
> >
> >--8<---------------cut here---------------start------------->8---
> >#:use-module ((srfi srfi-1) #:hide (partition))
> >--8<---------------cut here---------------end--------------->8---
> >  
> >> I'll add the architecture in there too, as per discussion in the  
> >osinfo-db MR.
> >
> >Do you think it could be useful to add the same mechanism to ISO
> >images built by the CI? In that case, you could maybe use the same
> >mechanism in
> >(gnu ci) and label the boot partition with %guix-version?
> >
> >Thanks,
> >
> >Mathieu  

[0001-guix-system-Add-label-option.patch (text/x-patch, attachment)]
[0002-gnu-ci-Set-label-in-iso9660-jobs.patch (text/x-patch, attachment)]
[0003-Makefile.am-Set-iso-label.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Mon, 31 Aug 2020 06:20:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH v2] Add version number in release ISO
Date: Mon, 31 Aug 2020 08:18:44 +0200
Hey Julien,

Thanks for the v2 :)

>                    (inherit iso9660-image)
> -                  (operating-system installation-os))))
> +                  (operating-system installation-os)
> +                  (partitions (match (image-partitions iso9660-image)
> +                                ((boot others ...)
> +                                 (cons
> +                                   (partition
> +                                     (inherit boot)
> +                                     (label (string-append "GUIX_" system "_"
> +                                                           %guix-version)))
> +                                   others)))))))

We could maybe factorize this in something like:

--8<---------------cut here---------------start------------->8---
(define (image-with-label image label)
...)
--8<---------------cut here---------------end--------------->8---

that would be put in (gnu system image).

Otherwise, looks fine to me :)

Thanks again,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Mon, 31 Aug 2020 12:13:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: Mathieu Othacehe <othacehe <at> gnu.org>, 43101 <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH v2] Add version number in release ISO
Date: Mon, 31 Aug 2020 14:12:25 +0200
Hi!

Julien Lepiller <julien <at> lepiller.eu> skribis:

> From a502fa70b0230d3f91ddf05410f24a1f4fcad521 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien <at> lepiller.eu>
> Date: Sat, 29 Aug 2020 15:34:56 +0200
> Subject: [PATCH 1/3] guix: system: Add `--label' option.
>
> * guix/scripts/system.scm (%options): Add `--label'.
> (system-derivation-for-action): Take a #:label key to set volume ID.
> (perform-action): Take a #:label key.
> (%default-options): Add default label value.
> (process-action): Pass label value from command-line to perform-action.
> ---
>  doc/guix.texi           |  4 +++-
>  guix/scripts/system.scm | 27 ++++++++++++++++++++++-----

Please mention the doc/guix.texi changes as well in the log.  :-)

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -28836,7 +28836,9 @@ the @option{--image-size} option is ignored in the case of
>  @code{docker-image}.
>  
>  You can specify the root file system type by using the
> -@option{--file-system-type} option.  It defaults to @code{ext4}.
> +@option{--file-system-type} option.  It defaults to @code{ext4}.  When its
> +value is @code{iso9660}, the @option{--label} option can be used to specify
> +a volume ID with @code{disk-image}.

Could you also add an @item for --label, just like we have for the other
options?

I’m also fine with what Mathieu suggests.

OK for me with changes along these lines!

Thank you,
Ludo’.




Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Mon, 31 Aug 2020 14:15:02 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Mon, 31 Aug 2020 14:15:02 GMT) Full text and rfc822 format available.

Message #31 received at 43101-done <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: 43101-done <at> debbugs.gnu.org
Subject: Re: [bug#43101] [PATCH v2] Add version number in release ISO
Date: Mon, 31 Aug 2020 16:13:46 +0200
Le Mon, 31 Aug 2020 08:18:44 +0200,
Mathieu Othacehe <othacehe <at> gnu.org> a écrit :

> Hey Julien,
> 
> Thanks for the v2 :)
> 
> >                    (inherit iso9660-image)
> > -                  (operating-system installation-os))))
> > +                  (operating-system installation-os)
> > +                  (partitions (match (image-partitions
> > iso9660-image)
> > +                                ((boot others ...)
> > +                                 (cons
> > +                                   (partition
> > +                                     (inherit boot)
> > +                                     (label (string-append "GUIX_"
> > system "_"
> > +
> > %guix-version)))
> > +                                   others)))))))  
> 
> We could maybe factorize this in something like:
> 
> --8<---------------cut here---------------start------------->8---
> (define (image-with-label image label)
> ...)
> --8<---------------cut here---------------end--------------->8---
> 
> that would be put in (gnu system image).
> 
> Otherwise, looks fine to me :)
> 
> Thanks again,
> 
> Mathieu

Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Thu, 03 Sep 2020 11:11:02 GMT) Full text and rfc822 format available.

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

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: 43101 <at> debbugs.gnu.org
Cc: julien <at> lepiller.eu
Subject: Re: bug#43101: [PATCH v2] Add version number in release ISO
Date: Thu, 03 Sep 2020 13:10:34 +0200
Hello Julien,

> Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
> 7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!

It seems that the new ISO labels are hitting a 32 characters limit, see:
https://ci.guix.gnu.org/log/alcb138l3gk5hzb0s2idgbkx5kg9n1ja-iso9660-image.

I would propose to truncate the commit hash to 7 characters. Could you
have a look?

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#43101; Package guix-patches. (Thu, 03 Sep 2020 12:12:01 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 43101 <at> debbugs.gnu.org
Subject: Re: bug#43101: [PATCH v2] Add version number in release ISO
Date: Thu, 3 Sep 2020 14:10:53 +0200
Le Thu, 03 Sep 2020 13:10:34 +0200,
Mathieu Othacehe <othacehe <at> gnu.org> a écrit :

> Hello Julien,
> 
> > Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
> > 7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!  
> 
> It seems that the new ISO labels are hitting a 32 characters limit,
> see:
> https://ci.guix.gnu.org/log/alcb138l3gk5hzb0s2idgbkx5kg9n1ja-iso9660-image.
> 
> I would propose to truncate the commit hash to 7 characters. Could you
> have a look?
> 
> Thanks,
> 
> Mathieu

Thanks for the heads up, I pushed another commit to reduce the number
of characters as 7596ae1034a6878ecbe9e65a642a1434a78b1cf0




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 02 Oct 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 200 days ago.

Previous Next


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