unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44327: `guix install` doesn't warn about collison in profile
@ 2020-10-30 11:17 Zhu Zihao
  2020-10-30 16:15 ` zimoun
  2020-10-30 16:18 ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Zhu Zihao @ 2020-10-30 11:17 UTC (permalink / raw)
  To: 44327

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-10-30 11:17 bug#44327: `guix install` doesn't warn about collison in profile Zhu Zihao
@ 2020-10-30 16:15 ` zimoun
  2020-10-30 16:18 ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: zimoun @ 2020-10-30 16:15 UTC (permalink / raw)
  To: Zhu Zihao; +Cc: 44327

Dear,

Thank you for the report.


On Fri, 30 Oct 2020 at 19:17, Zhu Zihao <all_but_last@163.com> wrote:
> 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”.


> 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




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-10-30 11:17 bug#44327: `guix install` doesn't warn about collison in profile Zhu Zihao
  2020-10-30 16:15 ` zimoun
@ 2020-10-30 16:18 ` Ludovic Courtès
  2020-10-30 16:30   ` zimoun
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-30 16:18 UTC (permalink / raw)
  To: Zhu Zihao; +Cc: 44327

Hi,

Zhu Zihao <all_but_last@163.com> skribis:

> 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.

> 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’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-10-30 16:18 ` Ludovic Courtès
@ 2020-10-30 16:30   ` zimoun
  2020-10-31 10:31     ` Ludovic Courtès
  2020-11-04  1:47     ` Zhu Zihao
  0 siblings, 2 replies; 7+ messages in thread
From: zimoun @ 2020-10-30 16:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 44327, Zhu Zihao

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. :-)



All the best,
simon




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-10-30 16:30   ` zimoun
@ 2020-10-31 10:31     ` Ludovic Courtès
  2020-11-04  1:47     ` Zhu Zihao
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-31 10:31 UTC (permalink / raw)
  To: zimoun; +Cc: 44327, Zhu Zihao

zimoun <zimon.toutoune@gmail.com> skribis:

> 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:

  https://issues.guix.gnu.org/27271

Ludo’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-10-30 16:30   ` zimoun
  2020-10-31 10:31     ` Ludovic Courtès
@ 2020-11-04  1:47     ` Zhu Zihao
  2020-11-04 17:15       ` Ludovic Courtès
  1 sibling, 1 reply; 7+ messages in thread
From: Zhu Zihao @ 2020-11-04  1:47 UTC (permalink / raw)
  To: zimoun; +Cc: 44327

[-- Attachment #1: Type: text/plain, Size: 528 bytes --]


> > 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 515 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#44327: `guix install` doesn't warn about collison in profile
  2020-11-04  1:47     ` Zhu Zihao
@ 2020-11-04 17:15       ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2020-11-04 17:15 UTC (permalink / raw)
  To: Zhu Zihao; +Cc: 44327

Zhu Zihao <all_but_last@163.com> skribis:

>> > 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:

  https://issues.guix.gnu.org/27271

> 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’.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-04 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 11:17 bug#44327: `guix install` doesn't warn about collison in profile Zhu Zihao
2020-10-30 16:15 ` zimoun
2020-10-30 16:18 ` Ludovic Courtès
2020-10-30 16:30   ` zimoun
2020-10-31 10:31     ` Ludovic Courtès
2020-11-04  1:47     ` Zhu Zihao
2020-11-04 17:15       ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).