Order in manifest and command-line differs

  • Open
  • quality assurance status badge
Details
2 participants
  • Mathieu Othacehe
  • zimoun
Owner
unassigned
Submitted by
zimoun
Severity
normal
Z
Z
zimoun wrote on 24 Sep 2020 01:38
(address . bug-guix@gnu.org)
86v9g4kqrd.fsf@gmail.com
Dear,

It is probably more a feature than a bug (and it is expected, I guess).
However, it can be misleading. For example,

Toggle snippet (10 lines)
$ guix package -i busybox diffutils -p /tmp/foo
$ ls -l /tmp/foo/bin
[..]
df -> /gnu/store/…-busybox-1.31.1/bin/df
diff -> /gnu/store/…-diffutils-3.7/bin/diff
diff3 -> /gnu/store/…-diffutils-3.7/bin/diff3
dirname -> /gnu/store/…-busybox-1.31.1/bin/dirname
[..]

And the same result is obtained with the manifest.scm file:

Toggle snippet (4 lines)
(specifications->manifest '("diffutils" "busybox"))


This difference could be counter-intuitive. One of the two lists should
be internally reverse’d. WDYT?


(Even if it is a corner-case, 2 packages providing the same tool, but it
matters for <profile>/manifest.)

All the best,
simon
M
M
Mathieu Othacehe wrote on 24 Sep 2020 15:08
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 43585@debbugs.gnu.org)
871rir725l.fsf@gnu.org
Hello zimoun,

Toggle quote (9 lines)
> $ guix package -i busybox diffutils -p /tmp/foo
> $ ls -l /tmp/foo/bin
> [..]
> df -> /gnu/store/…-busybox-1.31.1/bin/df
> diff -> /gnu/store/…-diffutils-3.7/bin/diff
> diff3 -> /gnu/store/…-diffutils-3.7/bin/diff3
> dirname -> /gnu/store/…-busybox-1.31.1/bin/dirname
> [..]

The order of what appears in "bin" depends on both the name of the
binaries provided by both packages and also how the "ls" command decides
to sort its output. I'm not sure that much can be done here.

Thanks,

Mathieu
Z
Z
zimoun wrote on 24 Sep 2020 16:08
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 43585@debbugs.gnu.org)
CAJ3okZ0xME_8sN-D5H7jPFjQx=RAxpw9K+3sZvfec0JyB+0Ghg@mail.gmail.com
Hi Mathieu,

On Thu, 24 Sep 2020 at 15:08, Mathieu Othacehe <othacehe@gnu.org> wrote:

Toggle quote (4 lines)
> The order of what appears in "bin" depends on both the name of the
> binaries provided by both packages and also how the "ls" command decides
> to sort its output. I'm not sure that much can be done here.

I have badly worded. The point is that "diffutils" and "busybox"
provide both the 'diff' binary. Therefore, depending on the order,
'diff' is provided by one or the other. Compare:

guix package -i busybox diffutils -p /tmp/busybox-diffutils
/tmp/busybox-diffutils/bin/diff

and

guix package -i diffutils busybox -p /tmp/diffutils-busybox
/tmp/diffutils-busybox/bin/diff

In the same time, compare the manifest.scm files:

Toggle snippet (7 lines)
;;; busybox-diffutils.scm
(specifications->manifest '("busybox" "diffutils"))

;;; diffutils-busybox.scm
(specifications->manifest '("diffutils" "busybox"))

then

guix package -m busybox-diffutils.scm -p /tmp/busybox-diffutils-m
/tmp/busybox-diffutils-m/bin/diff

and

guix package -m diffutils-busybox.scm -p /tmp/diffutils-busybox-m
/tmp/diffutils-busybox-m/bin/diff


Concretely, "guix package" processes command-line arguments from right
to left. And the manifest.scm file read the list in order (so from
left to right).

All the best,
simon

PS:
For another example not related:

$ guix package --show=diffutils --show=busybox | recsel -C -p name
name: busybox
name: diffutils

and "guix show" corrects that, processing from left to right.

$ guix show diffutils busybox | recsel -C -p name
name: diffutils
name: busybox
M
M
Mathieu Othacehe wrote on 25 Sep 2020 13:54
(name . zimoun)(address . zimon.toutoune@gmail.com)(address . 43585@debbugs.gnu.org)
87h7rmdqc4.fsf@gnu.org
Hey zimoun,

Oh I see, thanks for explaining!

It would be nice if the `guix package -i` command could also operate
from left to right then. Would you like to give it a try?

Thanks,

Mathieu
--
Z
Z
zimoun wrote on 31 Mar 2021 15:13
(name . Mathieu Othacehe)(address . othacehe@gnu.org)(address . 43585@debbugs.gnu.org)
87r1jvfouy.fsf@gmail.com
Hi,

On Fri, 25 Sep 2020 at 13:54, Mathieu Othacehe <othacehe@gnu.org> wrote:

Toggle quote (3 lines)
> It would be nice if the `guix package -i` command could also operate
> from left to right then. Would you like to give it a try?

I will not do. I am not interested any more. Closing?

Cheers,
simon
?