From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0CYHOV3BG2FigQAAgWs5BA (envelope-from ) for ; Tue, 17 Aug 2021 16:02:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GC2fNF3BG2H2PwAAbx9fmQ (envelope-from ) for ; Tue, 17 Aug 2021 14:02: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 575B42CDA7 for ; Tue, 17 Aug 2021 16:02:05 +0200 (CEST) Received: from localhost ([::1]:56144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mFzfI-0004PJ-C3 for larch@yhetil.org; Tue, 17 Aug 2021 10:02:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFzf2-0004Me-SF for help-guix@gnu.org; Tue, 17 Aug 2021 10:01:48 -0400 Received: from sender4-op-o11.zoho.com ([136.143.188.11]:17175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mFzf0-0004Vn-6a for help-guix@gnu.org; Tue, 17 Aug 2021 10:01:48 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1629208898; cv=none; d=zohomail.com; s=zohoarc; b=CGCUUIuTXTe3bQO1r6IhzYelpZoVoA1INujOtN1JcxWDvY98AYJavhR5IrYlw7djac5J8dwQXJZ3WwmsWRbI8qSIuuYxojXv4X0oSqiAHYJtZ4lxVWvtpPz65hLnXTN2ULJa4rRuJM3VbTB348bNywI1XYPddQOFB+bJvZFo500= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629208898; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=z8VD/V+QsiLBzz68YnHghwGvETI+PISFsd32ZdPFab4=; b=HuVy7Ydm201Axj24COrWKjLpflbGAQrzodasvn0rSKUAu1oN8VDTHOEqcUk1PrBXNw2XXqq0BK7Zls5FScODr2qICF6UaQeDSNVA51qQmAca8TGnjXXcq48B+4zD+VS+Wt2AjIk8KWg2caeotF49nsT7SQdzpEuCjUSpPADaii8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1629208898; s=zoho; d=rdklein.fr; i=edou@rdklein.fr; h=References:From:To:Cc:Subject:In-reply-to:Message-ID:Date:MIME-Version:Content-Type; bh=z8VD/V+QsiLBzz68YnHghwGvETI+PISFsd32ZdPFab4=; b=A8X1XqX6nl1pM8p3aOyQjuD5DC7CV6GZoe19P/dS8IPAUyk1RagIykNMv4tFVByo ob0CAKQhL8sn3IOIXE2P3jSxbfWKCXG//PPL/MmZXEbRnT2U6ScxfCNt6W1b94ifsHD MF452NQutBfeZqqb0Uz5iS5h2GIikpN9JmFG3feQ= Received: from Rasoir (22.87.95.79.rev.sfr.net [79.95.87.22]) by mx.zohomail.com with SMTPS id 1629208896525134.49399547098403; Tue, 17 Aug 2021 07:01:36 -0700 (PDT) References: User-agent: mu4e 1.4.15; emacs 27.2 From: Edouard Klein To: Phil Beadling Subject: Re: A single reference to installed non-binaries In-reply-to: Message-ID: <87v9442ms4.fsf@rdklein.fr> Date: Tue, 17 Aug 2021 16:01:15 +0200 MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=136.143.188.11; envelope-from=edou@rdklein.fr; helo=sender4-op-o11.zoho.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1629208925; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=z8VD/V+QsiLBzz68YnHghwGvETI+PISFsd32ZdPFab4=; b=oBAz2rxubVMSiKS+7tZAQ5alCaKhOgoKjP+Ng9lVSiYzr9aClSL93Do8i7zPjQHJMmV2z1 41ikrctrCi+sD8rveUoeP4wqOpe0T1ZHRFMZ2Wd807rm0sZIjfFrJ+e9HJFAe7ugB9GVvg ekW40kXdzHI+yPDbbBAmoWK5MxThDG8qKgl6Hqtw8BB8R1GLR+UI5JNCTXi69HOgA04ozK gq/mzGxnVIPSa//6jNMhXyzxpGUpB9wa2mrcpM1uiq8q5+efQFSqwfurTbnR0QLlqSdeo9 OV0A/qaajxjXQgr3Ua/RhOtGAYHiEpHYPPQ0YnrvVfqz0wx85MWX4hsIw4Wtxw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1629208925; a=rsa-sha256; cv=pass; b=MnkQ1JSV1DLkwPkS8x+bVeVlolVSPUCQB8Rxko4kViMom+6EeIqyAUlq8DwzXRwZnBBLeF GeN3Gbplynwd7bh7imPRNL+32a+bFiXYIJypLXI3VLnaaoZWQWCZSZvPF/7KKQ/WhNSImi 6ccS7FgJUrt/4oNPpQfTsv3Klobc9tJbjIdg6czHcoXP/3qotR6PPMqZgJsmifPwkJ3Fz2 rkSaYWjm6IFX45pn0lPS2nQC20xIj57sv7cq02fVBWfqZG1pA636SJWgi0gHp3FixUwkEr yrU9OrzK7wcjYlyg649Jr7TfwgglOHANneOmfQTudmyWr7BHtLBrUjtsCLoGMw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b=A8X1XqX6; arc=pass ("zohomail.com:s=zohoarc:i=1"); spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b=A8X1XqX6; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 575B42CDA7 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9NiwgJeDE7hD Hi ! I side-step this kind of things by adding a stage in package-y that will find and replace all references to "bar" with the complete path to the installation path of package-x, or that will set the needed environment variable to the full path of the dependency. See e.g. https://gitlab.com/edouardklein/guix/-/blob/beaverlabs/beaver/packages/scheme-xyz.scm#L68 Here, xlsxio and tzdir will be expanded to their full install path in the store. It has the advantage of not needing to integrate any guix-realted stuff in package-y, which I would consider an abstraction leak. I hope this helps :) Cheers, Edouard. Phil Beadling writes: > Hi all, > > I have some platform independent files I have created a package for using > copy-build-system. This works great but I've come across situation I don't > know how to handle. > > Let's call the package I've made package-x, and let's say that package-y > (which is for arguments sake is a python build system) lists package-x as a > propagated-input. > > package-x is installing a directory, let's say "bar" from the source into > "share/foo/" > > '(#:install-plan '(("bar" "share/foo/"))) > > Now whenever we install package-y, I should expect it's "share" directory > to contain foo/bar - and I find it to be the case. > > No suprises so far. > > The problem comes when I want to reference a file under "bar" in the source > code of package-y. > > Depending on whether I install package-y via "guix install package-y -p > /path/to/profile" or via "guix environment --ad-hoc package-y" there is no > single reference to the bar directory that covers every use-case. > > When I "install" the package - I can reference it using $GUIX_PROFILE > But as for example a developer when I'm coding package-y I would reference > it using $GUIX_ENVIRONMENT > > This means that any source that references it must presumably attempt to > read it from $GUIX_ENVIRONMENT, and then on failure fallback to > $GUIX_PROFILE. > > This feels a bit brittle to me, and I'm hoping I've missed a trick, and > there's a better way to singluarly reference the location of a share > directory from any GUIX profile or environment? > > Note the problem doesn't happen with binaries as the order of precedence in > the PATH variable avoids the issue. > > Any ideas? > > Thanks, > Phil.