`guix install` doesn't warn about collison in profile

  • Done
  • quality assurance status badge
Details
3 participants
  • Zhu Zihao
  • Ludovic Courtès
  • zimoun
Owner
unassigned
Submitted by
Zhu Zihao
Severity
normal

Debbugs page

Z
Z
Zhu Zihao wrote on 30 Oct 2020 04:17
(address . bug-guix@gnu.org)
86v9esc691.fsf@163.com
In commit ba60bbd4370570ff03a16c63af051be06f22658e. Try command

guix install emacs && guix install emacs-xwidgets

These two packages are conflict with each other, but I can't see any
warning message emitted(It should emit some because profile-derivation
use union-build).

I also suggest to raise an error when conflict detected during building
profile to force user to resolve it.


--
Retrieve my PGP public key: https://meta.sr.ht/~citreu.pgp

Zihao
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEE7NCVzXX6efyusptG1SOVn+xGFqYFAl+b9loVHGFsbF9idXRf
bGFzdEAxNjMuY29tAAoJENUjlZ/sRhamLJgH/0wxa3yM+0nganedj7YD1W9iCMQN
1Bhf8LGHXcoCxG3FVk7r50gZVT1x8+ylEiLNdOV+zG1eZWtVD/S6nvJR8fv1KmHs
oe+yCiVRT7d/hdLZVLGRqD0lyac74nw4INqUnx68Hh4JOcCExN10LsYh9wvEx+Pu
OSwy5usRnlCdd8dkhnzDSNfKau6oivmhvmpA6Ya6ZZMhnitpwMeimBA8S4BTkRrr
W0VqQXmxDVobP/CEWqTmsm/A5xcmg5htcj43/HVZHXkIYN4gARdcYh1A7vR1/ypm
LlIuVHx+h1S7B5uZ9TeEj4xoKePVBI4rEjMR4xUm/cEFGlwziI0//4YEIE8=
=QO51
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 30 Oct 2020 09:15
(name . Zhu Zihao)(address . all_but_last@163.com)(address . 44327@debbugs.gnu.org)
871rhf7krk.fsf@gmail.com
Dear,

Thank you for the report.


On Fri, 30 Oct 2020 at 19:17, Zhu Zihao <all_but_last@163.com> wrote:
Toggle quote (4 lines)
> In commit ba60bbd4370570ff03a16c63af051be06f22658e. Try command
>
> guix install emacs && guix install emacs-xwidgets

I do not know if this is really a collision since it is sequential.
Well, I agree that a warning message should be displayed.


However, note that,

$ guix time-machine --commit=ba60bbd4 \
-- install emacs emacs-xwidgets -p /tmp/foo
$ guix time-machine --commit=ba60bbd4 \
-- install emacs-xwidgets emacs -p /tmp/bar

readlink -f /tmp/{foo,bar}/bin/emacs
/gnu/store/xy38cgnr21j2jsb5mnn9cf91d6q67as2-emacs-xwidgets-27.1/bin/emacs-27.1
/gnu/store/1zwmmfy1d213mrqixl36ckbzghkpqdmf-emacs-27.1/bin/emacs

which is a bug. AFAIU. Same with “guix package -i”.


Toggle quote (3 lines)
> I also suggest to raise an error when conflict detected during building
> profile to force user to resolve it.

It should be already the case. :-)


All the best,
simon
L
L
Ludovic Courtès wrote on 30 Oct 2020 09:18
(name . Zhu Zihao)(address . all_but_last@163.com)(address . 44327@debbugs.gnu.org)
87blgjy9ea.fsf@gnu.org
Hi,

Zhu Zihao <all_but_last@163.com> skribis:

Toggle quote (8 lines)
> In commit ba60bbd4370570ff03a16c63af051be06f22658e. Try command
>
> guix install emacs && guix install emacs-xwidgets
>
> These two packages are conflict with each other, but I can't see any
> warning message emitted(It should emit some because profile-derivation
> use union-build).

‘union-build’ emits a warning, but it’s only visible in build logs.

Toggle quote (3 lines)
> I also suggest to raise an error when conflict detected during building
> profile to force user to resolve it.

Currently, ‘guix install’ errors out if you try to install two
same-named packages with a different version number or a different store
file name (typically via propagated inputs).

Here, ‘emacs’ and ‘emacs-xwidgets’ have different names, so it doesn’t
complain.

Perhaps we should offer a way to annotate packages as conflicting with
one another?

Thanks,
Ludo’.
Z
Z
zimoun wrote on 30 Oct 2020 09:30
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAJ3okZ2UpyD6PexzNaU4J3OyvY0KBycuL7-Xdn4a4gBjo+4V1g@mail.gmail.com
On Fri, 30 Oct 2020 at 17:20, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (10 lines)
> Currently, ‘guix install’ errors out if you try to install two
> same-named packages with a different version number or a different store
> file name (typically via propagated inputs).
>
> Here, ‘emacs’ and ‘emacs-xwidgets’ have different names, so it doesn’t
> complain.
>
> Perhaps we should offer a way to annotate packages as conflicting with
> one another?

Why? The solution seems to check the path names. Here, the 2
packages provide 'bin/emacs'; which is the conflict. However, this
could be implemented with care otherwise it will slow down.
I have not check 'union-build' but maybe it is already the case. :-)



All the best,
simon
L
L
Ludovic Courtès wrote on 31 Oct 2020 03:31
(name . zimoun)(address . zimon.toutoune@gmail.com)
87o8kivg8z.fsf@gnu.org
zimoun <zimon.toutoune@gmail.com> skribis:

Toggle quote (17 lines)
> On Fri, 30 Oct 2020 at 17:20, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> Currently, ‘guix install’ errors out if you try to install two
>> same-named packages with a different version number or a different store
>> file name (typically via propagated inputs).
>>
>> Here, ‘emacs’ and ‘emacs-xwidgets’ have different names, so it doesn’t
>> complain.
>>
>> Perhaps we should offer a way to annotate packages as conflicting with
>> one another?
>
> Why? The solution seems to check the path names. Here, the 2
> packages provide 'bin/emacs'; which is the conflict. However, this
> could be implemented with care otherwise it will slow down.
> I have not check 'union-build' but maybe it is already the case. :-)

Yes, ‘union-build’ already makes that check, but it happens too late: at
build time.

This is why back in the day we devised a specific collision detection
mechanism that looks at package names/version/store file names, and
which can run before anything has been built:


Ludo’.
Z
Z
Zhu Zihao wrote on 3 Nov 2020 17:47
(name . zimoun)(address . zimon.toutoune@gmail.com)
86blgdao67.fsf@163.com
Toggle quote (5 lines)
> > I also suggest to raise an error when conflict detected during building
> > profile to force user to resolve it.

> It should be already the case. :-)

IIRC the deafult collision handler of union-build is
warn-about-collision which doesn't terminate the build when collision
occured.

BTW, There's something called "priority" in Nix. The package with higher
priority in manifest will be able to override the package with lower one.


--
Retrieve my PGP public key: https://meta.sr.ht/~citreu.pgp

Zihao
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEE7NCVzXX6efyusptG1SOVn+xGFqYFAl+iCCAVHGFsbF9idXRf
bGFzdEAxNjMuY29tAAoJENUjlZ/sRhamtuwIAKJ7HuWaW6dongAIOeQ4YARx+qrn
4nzuda66HRQjv/lKfKyXwkxiML8wB1NvCuVpoieVYS5/Jxi/nnYeryZQW6IRdnTf
tKY6Rym5A6Yt0+dw+K2Zi6ojpw2+xE2LUZhKYj6xqcQmZ6ho2y+XgoKcIQPPnMru
qZib5JU0F00cxtWM17v6MXVBT6dHx89nVUJorNyjLc9zxfYmb4w17cIXNdpVhxRK
8/3H7plEU4bA+l/jkDCKTG3fRqCiCC2FCyovgaAoxJ+SQq1XFHpPs9Bs0EpPx8Fs
sD5E6hw30nnSuHGkTQEDDBE44wcZPJ5xxBklgNFJXvbhuOyU7FVbjKhEh7U=
=vjjO
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 4 Nov 2020 09:15
(name . Zhu Zihao)(address . all_but_last@163.com)
87o8kd6o1n.fsf@gnu.org
Zhu Zihao <all_but_last@163.com> skribis:

Toggle quote (9 lines)
>> > I also suggest to raise an error when conflict detected during building
>> > profile to force user to resolve it.
>
>> It should be already the case. :-)
>
> IIRC the deafult collision handler of union-build is
> warn-about-collision which doesn't terminate the build when collision
> occured.

We’re talking about different things. Whatever happens during
‘union-build’ happens too late and won’t lead to user-friendly errors.

I was referring to the mechanism implemented a while back and submitted
here:


Toggle quote (3 lines)
> BTW, There's something called "priority" in Nix. The package with higher
> priority in manifest will be able to override the package with lower one.

My experience with it (from 8+ years ago, though) is that it was
inconvenient and not natural—as a user you don’t want to ask yourself
which package should have the highest priority, you just want to have
these things installed.

The approach we took is to error out, with a clear diagnostic, when Guix
knows beforehand that two packages cannot coexist in the same profile.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 3 Dec 2020 09:13
control message for bug #44327
(address . control@debbugs.gnu.org)
87k0tybyor.fsf@gnu.org
tags 44327 notabug
close 44327
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 44327@patchwise.org

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