[PATCH] guix install: Add '--manifest' option.

  • Done
  • quality assurance status badge
Details
3 participants
  • Liliana Marie Prikler
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Ludovic Courtès
Severity
normal
L
L
Ludovic Courtès wrote on 17 Jul 2022 12:20
(address . guix-patches@gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
20220717102035.9150-1-ludo@gnu.org
* guix/scripts/install.scm (show-help, %options): Add "--manifest".
* tests/guix-package-aliases.sh" Test "guix install -m".
---
guix/scripts/install.scm | 8 ++++++--
tests/guix-package-aliases.sh | 16 +++++++++++++---
2 files changed, 19 insertions(+), 5 deletions(-)

Hi!

I think it’s convenient and quite natural to be able to type:

guix install -m manifest.scm

Hence this patch. Objections? :-)

Thanks,
Ludo’.

Toggle diff (73 lines)
diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
index 63e625f266..0d24d7c956 100644
--- a/guix/scripts/install.scm
+++ b/guix/scripts/install.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,6 +33,9 @@ (define (show-help)
This is an alias for 'guix package -i'.\n"))
(display (G_ "
-p, --profile=PROFILE use PROFILE instead of the user's default profile"))
+ (display (G_ "
+ -m, --manifest=FILE create a new profile generation with the manifest
+ from FILE"))
;; '--bootstrap' not shown here.
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
@@ -61,7 +64,8 @@ (define %options
;; Preserve some of the 'guix package' options.
(append (filter (lambda (option)
(any (cut member <> (option-names option))
- '("profile" "dry-run" "verbosity" "bootstrap")))
+ '("profile" "dry-run" "verbosity" "bootstrap"
+ "manifest")))
%package-options)
%transformation-options
diff --git a/tests/guix-package-aliases.sh b/tests/guix-package-aliases.sh
index 311838b768..99cb9176cd 100644
--- a/tests/guix-package-aliases.sh
+++ b/tests/guix-package-aliases.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
@@ -28,9 +28,10 @@ readlink_base ()
}
profile="t-profile-$$"
-rm -f "$profile"
+manifest="t-manifest-$$"
+rm -f "$profile" "$manifest"
-trap 'rm -f "$profile" "$profile-"[0-9]*' EXIT
+trap 'rm -f "$profile" "$profile-"[0-9]* "$manifest"' EXIT
guix install --bootstrap guile-bootstrap -p "$profile"
test -x "$profile/bin/guile"
@@ -55,6 +56,15 @@ guix remove --bootstrap guile-bootstrap -p "$profile"
! test -x "$profile/bin/guile"
test `guix package -p "$profile" -I | wc -l` -eq 0
+# Installing from a manifest.
+cat > "$manifest" <<EOF
+(specifications->manifest '("guile-bootstrap"))
+EOF
+guix install -p "$profile" -m "$manifest" --bootstrap
+test -x "$profile/bin/guile"
+guix remove --bootstrap guile-bootstrap -p "$profile"
+! test -x "$profile/bin/guile"
+
! guix remove -p "$profile" this-is-not-installed --bootstrap
! guix remove -i guile-bootstrap -p "$profile" --bootstrap
--
2.36.1
L
L
Liliana Marie Prikler wrote on 19 Jul 2022 12:01
dfe98b1254828d8b2f4f90bf9d38284d7e5d02f0.camel@ist.tugraz.at
Am Sonntag, dem 17.07.2022 um 12:20 +0200 schrieb Ludovic Courtès:
Toggle quote (14 lines)
> * guix/scripts/install.scm (show-help, %options): Add "--manifest".
> * tests/guix-package-aliases.sh" Test "guix install -m".
> ---
>  guix/scripts/install.scm      |  8 ++++++--
>  tests/guix-package-aliases.sh | 16 +++++++++++++---
>  2 files changed, 19 insertions(+), 5 deletions(-)
>
> Hi!
>
> I think it’s convenient and quite natural to be able to type:
>
>   guix install -m manifest.scm
>
> Hence this patch.  Objections?  :-)
I think the semantics of `guix install -m' are somewhat unclear. It
can mean both "add all of manifest to what I already have installed"
and "use manifest exactly as the manifest". The latter is equivalent
to `guix package -m' (which has clearer semantics here) and also the
implementation chosen IIUC. Personally, I don't think I'd want
"install" to remove packages.

Cheers
L
L
Ludovic Courtès wrote on 21 Jul 2022 11:09
(name . Liliana Marie Prikler)(address . liliana.prikler@ist.tugraz.at)(address . 56612@debbugs.gnu.org)
87r12en865.fsf@gnu.org
Hi,

Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> skribis:

Toggle quote (22 lines)
> Am Sonntag, dem 17.07.2022 um 12:20 +0200 schrieb Ludovic Courtès:
>> * guix/scripts/install.scm (show-help, %options): Add "--manifest".
>> * tests/guix-package-aliases.sh" Test "guix install -m".
>> ---
>>  guix/scripts/install.scm      |  8 ++++++--
>>  tests/guix-package-aliases.sh | 16 +++++++++++++---
>>  2 files changed, 19 insertions(+), 5 deletions(-)
>>
>> Hi!
>>
>> I think it’s convenient and quite natural to be able to type:
>>
>>   guix install -m manifest.scm
>>
>> Hence this patch.  Objections?  :-)
> I think the semantics of `guix install -m' are somewhat unclear. It
> can mean both "add all of manifest to what I already have installed"
> and "use manifest exactly as the manifest". The latter is equivalent
> to `guix package -m' (which has clearer semantics here) and also the
> implementation chosen IIUC. Personally, I don't think I'd want
> "install" to remove packages.

Right. To me, ‘-m’ is always declarative: you get what the manifest
prescribes, nothing else; this is how it’s currently documented.

Do you think it could be interpreted as “add all of manifest to what I
already have installed”?

Ludo’.
T
T
Tobias Geerinckx-Rice wrote on 21 Jul 2022 12:37
Re: [bug#56612] [PATCH] guix install: Add '--manifest' option.
(name . Ludovic Courtès)(address . ludo@gnu.org)
87mtd2g370@nckx
Ludovic Courtès ???
Toggle quote (4 lines)
> Do you think it could be interpreted as “add all of manifest to
> what I
> already have installed”?

It can; I did. I was going to raise the same objection as
Liliana. ‘guix package -m’ does not have this problem, ‘guix
install -m’ does.

Kind regards,

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

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCYtks0w0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW1513EA/2P7iDjTg2wQsQJ1XnSs5fIALOwXowZUUpLqi1Pd
j5yvAPsHMC7nUcjAt8MeZA8w+VOKlattPQ8p+HDxyO9S8GcBCg==
=pAYG
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 22 Jul 2022 22:58
Re: bug#56612: [PATCH] guix install: Add '--manifest' option.
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87wnc4g8z3.fsf_-_@gnu.org
Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (8 lines)
> Ludovic Courtès ???
>> Do you think it could be interpreted as “add all of manifest to what
>> I
>> already have installed”?
>
> It can; I did. I was going to raise the same objection as Liliana.
> ‘guix package -m’ does not have this problem, ‘guix install -m’ does.

OK, interesting. I guess we can drop the idea then.

Thanks for your feedback!

Ludo’.
L
L
Ludovic Courtès wrote on 22 Jul 2022 22:59
control message for bug #56612
(address . control@debbugs.gnu.org)
87v8rog8yr.fsf@gnu.org
tags 56612 wontfix
close 56612
quit
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 56612
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