[PATCH] scripts: expose 'allow-collisions' for 'guix install'

  • Done
  • quality assurance status badge
Details
2 participants
  • Andy Tai
  • Leo Famulari
Owner
unassigned
Submitted by
Andy Tai
Severity
normal
A
A
Andy Tai wrote on 28 Feb 2023 07:28
(address . guix-patches@gnu.org)(name . Andy Tai)(address . atai@atai.org)
20230228062846.19516-1-atai@atai.org
* guix/scripts/install.scm: 'allow-collisions' option of 'package'
exposed for 'install' alias
---
guix/scripts/install.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Toggle diff (30 lines)
diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
index 63e625f266..4ab64b5b54 100644
--- a/guix/scripts/install.scm
+++ b/guix/scripts/install.scm
@@ -34,6 +34,8 @@ (define (show-help)
(display (G_ "
-p, --profile=PROFILE use PROFILE instead of the user's default profile"))
;; '--bootstrap' not shown here.
+ (display (G_ "
+ --allow-collisions do not treat collisions in the profile as an error"))
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
@@ -61,7 +63,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"
+ "allow-collisions")))
%package-options)
%transformation-options

base-commit: cb0d8100b288b5b0d130820207db17764b7d2140
prerequisite-patch-id: 2ab0872d80951bb6f8df7bc8c4211f008a5cc6b8
prerequisite-patch-id: 1fa93a6e05a30a2a3a92d11ff1d7bdf7912e2724
prerequisite-patch-id: 8027f51c310a66f545421b43e1283ed516d41afc
--
2.39.1
L
L
Leo Famulari wrote on 2 Mar 2023 21:02
(name . Andy Tai)(address . atai@atai.org)(address . 61864@debbugs.gnu.org)
ZAEA7pPbAb+yeW+5@jasmine.lan
On Mon, Feb 27, 2023 at 10:28:46PM -0800, Andy Tai wrote:
Toggle quote (3 lines)
> * guix/scripts/install.scm: 'allow-collisions' option of 'package'
> exposed for 'install' alias

I'm curious, what's the rationale for this?
A
A
Andy Tai wrote on 2 Mar 2023 21:38
(name . Leo Famulari)(address . leo@famulari.name)(address . 61864@debbugs.gnu.org)
CAJsg1E9HFXCOjg4Q9sfYDH0eDR6ooXu1eseXpmb=wZXmRzNdvQ@mail.gmail.com
I run into collisions in profile from time to time and I can resolve it via

guix package --allow-collosions -i (or -u)

so it is useful to make that available in the two "alias" commands as well

On Thu, Mar 2, 2023 at 12:02?PM Leo Famulari <leo@famulari.name> wrote:

Toggle quote (8 lines)
> On Mon, Feb 27, 2023 at 10:28:46PM -0800, Andy Tai wrote:
> > * guix/scripts/install.scm: 'allow-collisions' option of 'package'
> > exposed for 'install' alias
>
> I'm curious, what's the rationale for this?
>


--
Andy Tai, atai@atai.org, Skype: licheng.tai, Line: andy_tai, WeChat:
andytai1010
Year 2023 ??112?
????????????
????????????
Attachment: file
A
A
Andy Tai wrote on 3 Mar 2023 07:07
[PATCH v2] scripts: Expose 'allow-collisions' for 'guix install'
(address . 61864@debbugs.gnu.org)(name . Andy Tai)(address . atai@atai.org)
20230303060732.24744-1-atai@atai.org
* guix/scripts/install.scm: Expose 'allow-collisions' option
of 'package' for 'install' alias
---
guix/scripts/install.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
index 63e625f266..4ab64b5b54 100644
--- a/guix/scripts/install.scm
+++ b/guix/scripts/install.scm
@@ -34,6 +34,8 @@ (define (show-help)
(display (G_ "
-p, --profile=PROFILE use PROFILE instead of the user's default profile"))
;; '--bootstrap' not shown here.
+ (display (G_ "
+ --allow-collisions do not treat collisions in the profile as an error"))
(display (G_ "
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
(newline)
@@ -61,7 +63,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"
+ "allow-collisions")))
%package-options)
%transformation-options

base-commit: ea870a70e93e7ea93e35fa8e0afc3cfdb1b66ba2
--
2.39.1
L
L
Leo Famulari wrote on 1 Apr 2023 18:54
Re: [bug#61864] [PATCH] scripts: expose 'allow-collisions' for 'guix install'
(name . Andy Tai)(address . atai@atai.org)(address . 61864-done@debbugs.gnu.org)
ZChh1GFQnKRBITmL@jasmine.lan
On Thu, Mar 02, 2023 at 12:38:45PM -0800, Andy Tai wrote:
Toggle quote (6 lines)
> I run into collisions in profile from time to time and I can resolve it via
>
> guix package --allow-collosions -i (or -u)
>
> so it is useful to make that available in the two "alias" commands as well

I see, that makes sense. Sorry I'm slow to reply, I thought about it for
a while.

Allowing profile collisions is a risky action that can cause subtle and
hard to diagnose bugs, and it often is done without understanding the
consequences. In my experience, collisions are often allowed by people
who don't understand the negative effects of collisions, or how profiles
are constructed.

When reported, the consequent problems can take up a lot of time for the
people trying to help.

Because of those reasons, I prefer to only expose this option in `guix
package`, which is a more advanced interface. My hope is that
segregating the option like this will discourage use of
'--allow-collisions' and prevent an increase in bug reports of the "user
error" type.

If you disagree, please feel free to reopen the bug and optionally CC
some other reviewers, or bring it up on IRC.
Closed
?