From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id yFSrKNqFNmV1xgAAauVa8A:P1 (envelope-from ) for ; Mon, 23 Oct 2023 16:40:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yFSrKNqFNmV1xgAAauVa8A (envelope-from ) for ; Mon, 23 Oct 2023 16:40:26 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5E4A1596FD for ; Mon, 23 Oct 2023 16:40:26 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=EUxAEO3P; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=protonmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698072026; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=RIizulPs5yLlnMawW/+0sdSB99LRtIcJv+ojoSx2qTs=; b=ERlntCb8Mi+X1NqsL9zP/RUtzaQR03HZo6TJJ9hVaizTO9l9ePL3ULY97xPDGTxwj1e71n xmWwuB7ATNlki3KzFxDgBXpXFXY0O2DGpT0U86b9WIyxXZYJK+MgwreYAjAQYBGLtYnkUz ObfRaVayWWuUjUISnjkiGCxAypb+YN7xsMoC5bp7Y8w7vnF0z20gswNN9ow8eMq0ZkrYzY E8oxAt0+6lloitEUhpTbKHuPUmXcMYiEE6eAFbztG5RYYf4v7xsUt/I1omYD/0yjqn5E+s 6GEZ1ixXBPg5CTvTfAM9c8TvkyTY8DzTOjqzd/M5c3oOg+6sz7bFFeo/2i06Cg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=EUxAEO3P; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=protonmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698072026; a=rsa-sha256; cv=none; b=dxPZAs+pZcW7LhbheCmbDTxxMRv1+pnJ4S7NSRxRwtTs30UaaF/yUquz5JjyGId2DIYgBY AoYmr9SMoldcwpb65gLUTuluYaxeRVC6cWbFlJ0ivW6WLzsUHMm+2IJB1wOXPzH420cOVQ h6jYeOUF3JTOn6B8llHFm57EgA8F14cNKo1K6GJWcR3vFaMJ4/4uMAApXN5eG1fAxfaXzc d1Hil1zUCZKwTi7FjUgDHavU4tlJ9SQi8vWwJIdYpOWFy/rjNFgacyT7gh430a0yNAzVTE Glzr/+ApP7IWR3mOa/YuXHXQYw+2NF5pzmLMBKMuavlFbOjWYd9FVp73Ruqhcw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quw5z-000467-Ty; Mon, 23 Oct 2023 10:39:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quw5y-00045q-0j for guix-devel@gnu.org; Mon, 23 Oct 2023 10:39:54 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1quw5u-0006Bq-Cw for guix-devel@gnu.org; Mon, 23 Oct 2023 10:39:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1698071986; x=1698331186; bh=RIizulPs5yLlnMawW/+0sdSB99LRtIcJv+ojoSx2qTs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=EUxAEO3P/9fj77UdZ4XBBNeeL9NE/B7OHey5vN+4T1MwI6LO6KE9iuKc8QAr9ak7m lCF9bMoYYYjgRInQ/D8y4bstD19qxXNa3BfAiuoLQaV5z2EFUMj7SQCQuWF+cfZW1p 8tEwl+xLL91Q1uxWqTSGaX2DO29kynB+5YCUm+6u3CCLjuqmH5u9a7p2g0VAlrFYis v8cj3hw0emelDlvKBzDNJF9iJLmLfDzLSrEIopmvd3oqMV/zGUaRgcc8vO7XOOk7ak fK/zq7AgC8/qWqXTrJiomN4JD99pIyFyrGCIevF15wLW88WK3x0JUd4t5T7ukdfHeD HYOezOYReufEw== Date: Mon, 23 Oct 2023 14:39:40 +0000 To: Greg Hogan From: Kaelyn Cc: Csepp , guix-devel@gnu.org Subject: Re: Order of manifest and overlapping binaries Message-ID: In-Reply-To: References: <87edngkndl.fsf@riseup.net> Feedback-ID: 34709329:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.40.133; envelope-from=kaelyn.alexi@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -9.50 X-Spam-Score: -9.50 X-Migadu-Queue-Id: 5E4A1596FD X-Migadu-Scanner: mx2.migadu.com X-TUID: gi7ovYxiyJpq Hi, ------- Original Message ------- On Monday, October 23rd, 2023 at 6:18 AM, Greg Hogan w= rote: >=20 > On Tue, May 16, 2023 at 4:55=E2=80=AFPM Csepp raingloom@riseup.net wrote: >=20 > > Greg Hogan code@greghogan.com writes: > >=20 > > > 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. > > >=20 > > > 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). I= s > > > there a better way to fix this? > > >=20 > > > Greg > > >=20 > > > --8<---------------cut here---------------start------------->8--- > > > $ guix shell --container moreutils parallel which coreutils > > > [env]$ readlink -f `which parallel` > > > /gnu/store/xd9kbadmrrbpkjs9vl1v9rhgayfxwgbc-parallel-20230422/bin/par= allel > > >=20 > > > guix shell --container parallel moreutils which coreutils > > > [env]$ readlink -f $(which parallel) > > > /gnu/store/60zdm9zm0nqm5d97vs30sf4plb2ib5p9-moreutils-0.67/bin/parall= el > > > --8<---------------cut here---------------end--------------->8--- > > >=20 > > > This is operating from a recent guix pull: > > >=20 > > > --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--- > >=20 > > 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. >=20 >=20 > 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. >=20 > (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)))))))))) >=20 > (define moreutils-decollide > (rename-files moreutils (list "bin/parallel"))) >=20 > --8<---------------cut here---------------start------------->8--- >=20 > starting phase `rename-files' error: in phase 'rename-files': uncaught ex= ception: wrong-type-arg #f "Wrong type to apply: ~S" ("bin/parallel") ("bin= /parallel") phase` rename-files' failed after 0.0 seconds This error is because using gexps adds an extra layer of expansion on top o= f normal scheme. The error is coming from the use of "#$files"... specifica= lly in the subform "(for-each (lambda (file) ...) #$files)", #$files is rep= laced--in the usage example--with exactly ("bin/parallel"), resulting in: (for-each (lambda (file) ...) ("bin/parallel")) Because it is a gexp, #$file is replaced with ("bin/parallel") and then the= resulting form is evaluated on the builder. Since ("bin/parallel") now loo= ks like a function call, it tries to treat it as one. The three main option= s that I know of are to 1) quote the argument when calling rename-files so that "list" is first in = the literal list: (rename-files moreutils '(list "bin/parallel")) 2) quote the list within the gexp: (for-each (lambda (file) ...) '#$files) 3) build the list within the gexp: (for-each (lambda (file) ...) (list #@$files) In my opinion the second option is probably the easiest and safest to work = with. #1 and #3 both suffer from needing to specially craft the incoming ar= gument to handle being evaluated twice. For #1, the argument has to be a li= st after being evaluated twice (the first evaluation is of the quote, the s= econd occurs after the gexp was expanded and calls list with the string arg= uments). For #3, the expectation of a list is more explicit, but the argume= nt has to evaluate to a list where all of the elements have to then evaluat= e to something meaningful (not too much of an issue for this case as string= s evaluate to themselves). #2 should only require that the evaluated argume= nt has a printable representation that can be read back in, which at least = to me feels more natural to work with. Hope my early morning explanation helps! Cheers, Kaelyn > Backtrace: > 9 (primitive-load "/gnu/store/qrj9l194a552vpg2234xx55k76j=E2=80=A6") > 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 # =E2=80=A6) >=20 > 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 (_ #(#(#(#) (#)) =E2=80= =A6)) >=20 > 159:9 2 (_ _) > In ice-9/boot-9.scm: > 1685:16 1 (raise-exception _ #:continuable? _) > 1685:16 0 (raise-exception _ #:continuable? _) >=20 > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > Wrong type to apply: "bin/parallel" > --8<---------------cut here---------------end--------------->8---