From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sQpXMdX/GmA7CQAA0tVLHw (envelope-from ) for ; Wed, 03 Feb 2021 19:56:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id CI5lLNX/GmBjfwAAbx9fmQ (envelope-from ) for ; Wed, 03 Feb 2021 19:56:05 +0000 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 44EAE940858 for ; Wed, 3 Feb 2021 19:56:05 +0000 (UTC) Received: from localhost ([::1]:59362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7OFw-0007GY-89 for larch@yhetil.org; Wed, 03 Feb 2021 14:56:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7NeW-0002pX-Ux for guix-devel@gnu.org; Wed, 03 Feb 2021 14:17:25 -0500 Received: from m42-5.mailgun.net ([69.72.42.5]:52543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7NeS-00085k-U0 for guix-devel@gnu.org; Wed, 03 Feb 2021 14:17:24 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1612379839; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-Id: In-Reply-To: References: From: Subject: Cc: To: Date: Sender; bh=CLkKLDz9Ain7ENBo+hYnt9F6n3kaQuHt9H2khPERDY4=; b=J8FzeGb5yrEYekgZ/11X+S2ZuiTM48KY/O/frgVlB1sl2rTv7iIWowFnOfeMRmM9L75vV2ad 9kjcEcfPlqLNi/hlKzKRyHN/TE7m8yvxs28gLGqBgt/kVhLs2SiiaEgxoarKPhMQ34bBn9pv USsNBe4rap7v2rdNkyO2Ye/fzBrm5q2Phy5GqEXt5ZN7I9ln9C/w975LrGMsfFU49xbjToD3 3i+TRjoG0QbXO7CTnXtAn8HSnF8yIR0zE+epgpAAFzPzLRyWWjItlayNx9JQmBo3fhg8DV4O fnQpimVJWfTfGPVX/IgMjdq97iEZ69O6eVaRvKd7m9JYPrCo+NMRVQ== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyIyNWJlMSIsICJndWl4LWRldmVsQGdudS5vcmciLCAiMDg1NDdhIl0= Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 601af6be7e4e6c9dfea3546b (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Wed, 03 Feb 2021 19:17:18 GMT Received: from localhost (x099243.dynamic.ppp.asahi-net.or.jp [122.249.99.243]) by wilsonb.com (Postfix) with ESMTPSA id 79F28A18AF; Wed, 3 Feb 2021 19:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1612379835; bh=CLkKLDz9Ain7ENBo+hYnt9F6n3kaQuHt9H2khPERDY4=; h=Date:To:Cc:Subject:From:References:In-Reply-To:From; b=1CYIPRrlzYKYj0ovSMAsE01CirHfOvSlMLn7+MBGBh3RSa0xaw2zU/PY5Ch4FWcJh n/syHItyzpXFXDeQ1iXbkhyYodoFq/dcObxHhXPAdr+DtZ/6db1Eq0b0ewXT+amqlQ cRoxFeSt4dhVFWepTmNQO7pDjsLDFFoMfYE+vpWFcTMlSQ+Je0QjVPgKUCETR72JJi MU1OUqX5QSN1BBc6Sgz3oB1PJAd3q7zuy6RSAmcXzuNm0MyUsVmC7vapoQ4WCVFbAy kqGM0dOywal2NC/xOaBXL4o4g5p/BaMC9T/QPTrdmx0Di82H4d78Mhg7hhFrl61wTK sfzUCaglAvt8QTcPT57lnq3K78kJf6K3O+eLaZwRHB7xup/BXpWGVQY01NrbySAAUo rHuTmi+5ArnxHEXZ2uCSw8V1Z77QwyDABoJb6uxI1JUgtLAHuyVIF6lyzbTSYQasil 7xYo8BazyyjvyCDFFLf4QGSCm2MCDqNcUkykHNlqHlPNsFL2pCfkdHvUOPF8DF7cA3 wmYI89SlpdM2kib+6cnyYsT8rIxppWFu/nlCxOp8SGBCYeTH8wyO0Lku6HQQVhkP21 u1q+h05aA00bxZkS0w+pX9wb4xeH+nTjvvzg4DQB4q7t1meXsT6lcUY6Mr/CvkntXt +DN69K/jNHmjm/O0t07YStHw= Date: Thu, 04 Feb 2021 04:17:20 +0900 To: Maxime Devos Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , guix-devel@gnu.org Subject: Re: Installing a wrapper guile script in /bin From: elaexuotee@wilsonb.com References: <3EA9135IVLYXR.223U6JDXT4SSS@wilsonb.com> <874kivlqol.fsf@gnu.org> <2VMUHEHLO03FL.3AF0SWRKGMFZ3@wilsonb.com> <6d41cb49f87561620e46f5e8a25946f2fbb927ab.camel@telenet.be> <3TT5JRKHCZ2E4.2VYCP49OAJARA@wilsonb.com> In-Reply-To: Message-Id: <37L9FNXG6ZFRG.3DMOOF29K2VAM@wilsonb.com> User-Agent: mblaze/1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=69.72.42.5; envelope-from=bounce+ec9951.08547a-guix-devel=gnu.org@mg.wilsonb.com; helo=m42-5.mailgun.net 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 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" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.06 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mg.wilsonb.com header.s=krs header.b=J8FzeGb5; dkim=pass header.d=wilsonb.com header.s=201703 header.b=1CYIPRrl; dmarc=pass (policy=quarantine) header.from=wilsonb.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 44EAE940858 X-Spam-Score: -3.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: HEsZgIgNrC6G Thank you for the thoughtful input. Maxime Devos wrote: > * forego representing `wrapper-script` as a gexp (using #~), instead repr= esent > `wrapper-script` as something quasiquoted. Then write this expression = to > a file (with 'write', and include an appropriate shebang line) > * The procedure =E2=80=98program-file=E2=80=99 turns a gexp into a repres= entation of a store item. After spending most of the day figuring out how to manually create and buil= d derivations. I hit a fundamental problem including that code in a package d= ef which made me realize that manually embedding scripts is a flawed approach.= The issue is that a script itself has dependencies, e.g. guile, bash, whate= ver. Those dependencies also need to show up in the transitive closure of whatev= er package embeds this script. > * Define a wrapper package. See wrap-python3 in packages/python.scm > for an example. (This option probably has to be combined with one of th= e > first two options.)=20 Your suggestion here eventually set me on the right track. Say we want the final executable to end up at /bin/X. The basic idea is this: 1) Creat original package with a name like X-lib, and leave /bin/X emp= ty, 2) Write a wrapper script as a gexp argument to program-file. In this gexp = we reference the X-lib package, and finally 3) Create an trivial-build-system package X that includes the program-file wrapper as an input. The build step will copy this input script to /bin/X! This way dependencies are correctly tracked, and there's no need for manual= derivation building hackery. Anyway, thanks for the pointers! They motivated me to keep pushing until something worked.