From: Greg Hogan <code@greghogan.com>
To: Csepp <raingloom@riseup.net>
Cc: guix-devel@gnu.org
Subject: Re: Order of manifest and overlapping binaries
Date: Mon, 23 Oct 2023 09:18:30 -0400 [thread overview]
Message-ID: <CA+3U0ZkdFZePdUU7CAYbgoT3bJrdcmySLdPL2PuyMF7kLsrcwA@mail.gmail.com> (raw)
In-Reply-To: <87edngkndl.fsf@riseup.net>
On Tue, May 16, 2023 at 4:55 PM Csepp <raingloom@riseup.net> wrote:
>
>
> Greg Hogan <code@greghogan.com> writes:
>
> > I could not find documentation on this circumstance or how to resolve.
> > Both 'parallel' and 'moreutils' produce a 'bin/parallel' and only one
> > can go in the $GUIX_PROFILE.
> >
> > Creating a container, the latter package overshadows the former
> > package, as below. Unclear if this is consistent. In my manifest the
> > former package overshadows the latter (I'd prefer to have parallel's
> > parallel, but by default I have sorted the listing alphabetically). Is
> > there a better way to fix this?
> >
> > Greg
> >
> > --8<---------------cut here---------------start------------->8---
> > $ guix shell --container moreutils parallel which coreutils
> > [env]$ readlink -f `which parallel`
> > /gnu/store/xd9kbadmrrbpkjs9vl1v9rhgayfxwgbc-parallel-20230422/bin/parallel
> >
> > guix shell --container parallel moreutils which coreutils
> > [env]$ readlink -f $(which parallel)
> > /gnu/store/60zdm9zm0nqm5d97vs30sf4plb2ib5p9-moreutils-0.67/bin/parallel
> > --8<---------------cut here---------------end--------------->8---
> >
> >
> > This is operating from a recent guix pull:
> >
> > --8<---------------cut here---------------start------------->8---
> > $ guix describe
> > Generation 44 May 11 2023 17:02:53 (current)
> > guix d6f6b57
> > repository URL: https://git.savannah.gnu.org/git/guix.git
> > branch: master
> > commit: d6f6b57766e95d2fa8af63d4460a2b303ca4d867
> > --8<---------------cut here---------------end--------------->8---
>
> You could create a package that just copies the contents of moreutils
> to $output, but renames some files, then include the resulting package
> in your manifest. If moreutils is not propagated from any other
> package, then you don't even have to do an input rewrite.
I'm still cutting my teeth on Scheme, and this looks like a simple
error, but the following from my manifest results in the error below.
The function accepts a package to inherit from and a list of files to
rename by appending the package name. This works if I change to pass
in a single string and create the list within the for-each argument.
(define (rename-files parent-package files)
(package/inherit parent-package
(arguments
(substitute-keyword-arguments (package-arguments parent-package)
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
(add-after 'install 'rename-files
(lambda* (#:key outputs #:allow-other-keys)
(let ((out #$output) (name #$(package-name parent-package)))
(for-each
(lambda (file)
(rename-file (string-append out "/" file)
(string-append out "/" file "-" name)))
#$files))))))))))
(define moreutils-decollide
(rename-files moreutils (list "bin/parallel")))
--8<---------------cut here---------------start------------->8---
starting phase `rename-files'
error: in phase 'rename-files': uncaught exception:
wrong-type-arg #f "Wrong type to apply: ~S" ("bin/parallel") ("bin/parallel")
phase `rename-files' failed after 0.0 seconds
Backtrace:
9 (primitive-load "/gnu/store/qrj9l194a552vpg2234xx55k76j…")
In guix/build/gnu-build-system.scm:
908:2 8 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
1752:10 7 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
634:9 6 (for-each #<procedure 7ffff5b0b140 at guix/build/gnu-b…> …)
In ice-9/boot-9.scm:
1752:10 5 (with-exception-handler _ _ #:unwind? _ # _)
In guix/build/gnu-build-system.scm:
929:23 4 (_)
In ice-9/eval.scm:
159:9 3 (_ #(#(#(#<directory (guile-user) 7ffff77f7c80>) (#)) …))
159:9 2 (_ _)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Wrong type to apply: "bin/parallel"
--8<---------------cut here---------------end--------------->8---
next prev parent reply other threads:[~2023-10-23 13:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-16 20:41 Order of manifest and overlapping binaries Greg Hogan
2023-05-16 20:51 ` Csepp
2023-10-23 13:18 ` Greg Hogan [this message]
2023-10-23 14:39 ` Kaelyn
2023-10-31 17:29 ` Greg Hogan
2023-05-16 21:23 ` Attila Lendvai
2023-05-25 3:32 ` John Kehayias
2023-10-23 18:20 ` Simon Tournier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+3U0ZkdFZePdUU7CAYbgoT3bJrdcmySLdPL2PuyMF7kLsrcwA@mail.gmail.com \
--to=code@greghogan.com \
--cc=guix-devel@gnu.org \
--cc=raingloom@riseup.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).