"Profile contains conflicting entries" could be more helpful

DoneSubmitted by Ben Sturmfels.
Details
3 participants
  • Ben Sturmfels
  • Ludovic Courtès
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
B
B
Ben Sturmfels wrote on 11 Nov 2017 01:14
(address . bug-guix@gnu.org)
87bmk98yeq.fsf@sturm.com.au
Hi Folks,
When trying to install "python-twine", installation failed with thefollowing error:
$ guix package --install python-twineThe following package will be installed: python-twine 1.9.1 /gnu/store/fh72qswc2gpj1c1xb2gm23hfs1vx4lk2-python-twine-1.9.1
guix package: error: profile contains conflicting entries for python-requests:outguix package: error: first entry: python-requests@2.13.0:out /gnu/store/4paqanwmdw2d7ss9hdq7d34b43ycjgsv-python-requests-2.13.0guix package: error: ... propagated from python-twine@1.9.1guix package: error: second entry: python-requests@2.13.0:out /gnu/store/z4jqf8p2z73dscrjmbpwamdvyfdaqkgx-python-requests-2.13.0

This was quite baffling - it wasn’t clear to me why there was aconflict, whether it was related to something I'd done and what I coulddo to fix it.
If I understand correctly, the cause is that I had manually installed"python-requests" at some stage and that only one version can beavailable in my profile, and that "python-twine" depended on a differentversion.
I believe the action I need to take to resolve the conflict is:
guix package --install python-twine --upgrade python-requests

So I think the bug is that the user interface could be more helpful here.It should probably either tell you what happened and what you can do tofix it, or offer to resolve the conflict/perform the upgrade for you.
Regards,Ben
L
L
Ludovic Courtès wrote on 11 Nov 2017 14:59
(name . Ben Sturmfels)(address . ben@sturm.com.au)(address . 29255@debbugs.gnu.org)
87bmk8hq6v.fsf@gnu.org
Hi Ben,
Ben Sturmfels <ben@sturm.com.au> skribis:
Toggle quote (4 lines)> So I think the bug is that the user interface could be more helpful here.> It should probably either tell you what happened and what you can do to> fix it, or offer to resolve the conflict/perform the upgrade for you.
Would it be desirable or even feasible to resolve the conflict for you?I wouldn’t want the tool to remove installed packages without asking me,for instance.
Could you suggest messages you’d like to see in this case?
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 24 Nov 2017 18:24
control message for bug #29255
(address . control@debbugs.gnu.org)
87lgiva8ue.fsf@gnu.org
tags 29255 moreinfo
R
R
Ricardo Wurmus wrote on 24 Nov 2017 19:35
Re: bug#29255: "Profile contains conflicting entries" could be more helpful
(name . Ludovic Courtès)(address . ludo@gnu.org)
87609zcyp1.fsf@elephly.net
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (10 lines)> Ben Sturmfels <ben@sturm.com.au> skribis:>>> So I think the bug is that the user interface could be more helpful here.>> It should probably either tell you what happened and what you can do to>> fix it, or offer to resolve the conflict/perform the upgrade for you.>> Would it be desirable or even feasible to resolve the conflict for you?> I wouldn’t want the tool to remove installed packages without asking me,> for instance.
Guix could resolve the conflict by upgrading the existing andconflicting item in the profile. In my experience that’s usually what auser wants.
Guix could also remind the users to use “--manifest” or to upgrade itemsin the profile.
Toggle quote (2 lines)> Could you suggest messages you’d like to see in this case?
In this case it is not entirely clear that the existing python-requestspackage in the profile is “old”. The version looks the same and thehash is opaque.
Would it be possible to record something about the Guix version that wasused to install a package? Then we could say:
An older variant of python-requests is installed in this profile (propagated from package “foo-bar”) and conflicts with a newer variant (propagated from package “python-twine”).
I understand that it is challenging to accurately describe the versionof Guix in the presence of GUIX_PACKAGE_PATH. With a more formaldefinition of channels (e.g. requiring a description file for thechannel that includes a version or date string) this problem could beside-stepped.
--Ricardo
GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAChttps://elephly.net
L
L
Ludovic Courtès wrote on 30 Nov 2017 13:13
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87r2sg3qxx.fsf@gnu.org
Hi,
Ricardo Wurmus <rekado@elephly.net> skribis:
Toggle quote (11 lines)> In this case it is not entirely clear that the existing python-requests> package in the profile is “old”. The version looks the same and the> hash is opaque.>> Would it be possible to record something about the Guix version that was> used to install a package? Then we could say:>> An older variant of python-requests is installed in this profile> (propagated from package “foo-bar”) and conflicts with a newer variant> (propagated from package “python-twine”).
When the version numbers are the same, we cannot tell whether a variantis “older”, we can just tell that it’s different. Also, I find ituseful to see the propagation stack as is currently the case.
With the patch below, I get:
Toggle snippet (11 lines)$ ./pre-inst-env guix package -p foo -i python@2 pythonThe following packages will be installed: python 2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13 python 3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3
guix package: error: profile contains conflicting entries for python:outguix package: error: first entry: python@2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13guix package: error: second entry: python@3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3hint: You cannot have two different versions or variants of `python' in the same profile.
and:
Toggle snippet (12 lines)$ ./pre-inst-env guix package -i guile-cairo -p foo --no-graftsThe following package will be installed: guile-cairo 1.4.1 /gnu/store/dsdbp9sqla6zz2skljlcr5zfjyzvargf-guile-cairo-1.4.1
guix package: error: profile contains conflicting entries for cairo:outguix package: error: first entry: cairo@1.14.10 /gnu/store/c4vl4hw5jccg0b23sfvs0kdnfdbxdlgm-cairo-1.14.10guix package: error: ... propagated from guile-cairo@1.4.1guix package: error: second entry: cairo@1.14.10 /gnu/store/nwxv9s2q8pi0m6gn6fyidpj8442dwp6f-cairo-1.14.10guix package: error: ... propagated from cairomm@1.12.2hint: Try upgrading both `guile-cairo' and `cairomm', or remove one of them from the profile.
How does that sound?
We could further refine the hint to suggest using ‘guix package -m’,though I’m not sure if it’d be a useful hint (it’s a usefulrecommendation, but not necessarily good as a “fix hint.”)
Thoughts?
Thanks,Ludo’.
Toggle diff (38 lines)diff --git a/guix/ui.scm b/guix/ui.scmindex 13cbe3a0f..660f6ea5c 100644--- a/guix/ui.scm+++ b/guix/ui.scm@@ -502,6 +502,25 @@ interpreted." (x (leave (G_ "unknown unit: ~a~%") unit))))))) +(define (display-collision-resolution-hint collision)+ (define (top-most-entry entry)+ (let loop ((entry entry))+ (match (force (manifest-entry-parent entry))+ (#f entry)+ (parent (loop parent)))))++ (let* ((first (profile-collision-error-entry collision))+ (second (profile-collision-error-conflict collision))+ (name1 (manifest-entry-name (top-most-entry first)))+ (name2 (manifest-entry-name (top-most-entry second))))+ (if (string=? name1 name2)+ (display-hint (format #f (G_ "You cannot have two different versions+or variants of @code{~a} in the same profile.")+ name1))+ (display-hint (format #f (G_ "Try upgrading both @code{~a} and @code{~a},+or remove one of them from the profile.")+ name1 name2)))))+ (define (call-with-error-handling thunk) "Call THUNK within a user-friendly error handler." (define (port-filename* port)@@ -570,6 +589,7 @@ interpreted." (manifest-entry-output* conflict) (manifest-entry-item conflict)) (report-parent-entries conflict)+ (display-collision-resolution-hint c) (exit 1))) ((nar-error? c) (let ((file (nar-error-file c))
L
L
Ludovic Courtès wrote on 10 Dec 2017 23:47
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87shci9p5e.fsf@gnu.org
Hello!
ludo@gnu.org (Ludovic Courtès) skribis:
Toggle quote (43 lines)> Ricardo Wurmus <rekado@elephly.net> skribis:>>> In this case it is not entirely clear that the existing python-requests>> package in the profile is “old”. The version looks the same and the>> hash is opaque.>>>> Would it be possible to record something about the Guix version that was>> used to install a package? Then we could say:>>>> An older variant of python-requests is installed in this profile>> (propagated from package “foo-bar”) and conflicts with a newer variant>> (propagated from package “python-twine”).>> When the version numbers are the same, we cannot tell whether a variant> is “older”, we can just tell that it’s different. Also, I find it> useful to see the propagation stack as is currently the case.>> With the patch below, I get:>> $ ./pre-inst-env guix package -p foo -i python@2 python> The following packages will be installed:> python 2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13> python 3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3>> guix package: error: profile contains conflicting entries for python:out> guix package: error: first entry: python@2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13> guix package: error: second entry: python@3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3> hint: You cannot have two different versions or variants of `python' in the same profile.>>> and:>> $ ./pre-inst-env guix package -i guile-cairo -p foo --no-grafts> The following package will be installed:> guile-cairo 1.4.1 /gnu/store/dsdbp9sqla6zz2skljlcr5zfjyzvargf-guile-cairo-1.4.1>> guix package: error: profile contains conflicting entries for cairo:out> guix package: error: first entry: cairo@1.14.10 /gnu/store/c4vl4hw5jccg0b23sfvs0kdnfdbxdlgm-cairo-1.14.10> guix package: error: ... propagated from guile-cairo@1.4.1> guix package: error: second entry: cairo@1.14.10 /gnu/store/nwxv9s2q8pi0m6gn6fyidpj8442dwp6f-cairo-1.14.10> guix package: error: ... propagated from cairomm@1.12.2> hint: Try upgrading both `guile-cairo' and `cairomm', or remove one of them from the profile.
I’ve pushed the patch as commit3b80b81358b3861ca3794105c8eb4395df97846b. Hopefully these hints helpusers get on the right track, and we can always adjust them.
Thanks,Ludo’.
Closed
B
B
Ben Sturmfels wrote on 10 Dec 2017 23:53
(address . 29255-done@debbugs.gnu.org)
5A2DBADB.80902@sturm.com.au
On 11/12/17 09:47, Ludovic Courtès wrote:
Toggle quote (34 lines)>> When the version numbers are the same, we cannot tell whether a variant>> is “older”, we can just tell that it’s different. Also, I find it>> useful to see the propagation stack as is currently the case.>>>> With the patch below, I get:>>>> $ ./pre-inst-env guix package -p foo -i python@2 python>> The following packages will be installed:>> python 2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13>> python 3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3>>>> guix package: error: profile contains conflicting entries for python:out>> guix package: error: first entry: python@2.7.13 /gnu/store/vysfxizaddh1q8s5qjgbdkzxx0585dzi-python-2.7.13>> guix package: error: second entry: python@3.5.3 /gnu/store/m4rdgmvdqcxs2zhv42idnz1s1w391i8j-python-3.5.3>> hint: You cannot have two different versions or variants of `python' in the same profile.>>>>>> and:>>>> $ ./pre-inst-env guix package -i guile-cairo -p foo --no-grafts>> The following package will be installed:>> guile-cairo 1.4.1 /gnu/store/dsdbp9sqla6zz2skljlcr5zfjyzvargf-guile-cairo-1.4.1>>>> guix package: error: profile contains conflicting entries for cairo:out>> guix package: error: first entry: cairo@1.14.10 /gnu/store/c4vl4hw5jccg0b23sfvs0kdnfdbxdlgm-cairo-1.14.10>> guix package: error: ... propagated from guile-cairo@1.4.1>> guix package: error: second entry: cairo@1.14.10 /gnu/store/nwxv9s2q8pi0m6gn6fyidpj8442dwp6f-cairo-1.14.10>> guix package: error: ... propagated from cairomm@1.12.2>> hint: Try upgrading both `guile-cairo' and `cairomm', or remove one of them from the profile.> > I’ve pushed the patch as commit> 3b80b81358b3861ca3794105c8eb4395df97846b. Hopefully these hints help> users get on the right track, and we can always adjust them.
That's Ludo, that's great!
Attachment: signature.asc
Closed
?
Your comment

This issue is archived.

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