From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8M4GAl8DHGHMEgEAgWs5BA (envelope-from ) for ; Tue, 17 Aug 2021 20:43:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id iFWZOF4DHGFRBQAAbx9fmQ (envelope-from ) for ; Tue, 17 Aug 2021 18:43:42 +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 3AD30A964 for ; Tue, 17 Aug 2021 20:43:42 +0200 (CEST) Received: from localhost ([::1]:33506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mG43p-00060n-1i for larch@yhetil.org; Tue, 17 Aug 2021 14:43:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG434-0005vx-5i for help-guix@gnu.org; Tue, 17 Aug 2021 14:42:54 -0400 Received: from sender4-op-o11.zoho.com ([136.143.188.11]:17151) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mG431-000348-Lp for help-guix@gnu.org; Tue, 17 Aug 2021 14:42:53 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1629225767; cv=none; d=zohomail.com; s=zohoarc; b=f7iXJIJqjcvGy2dOVQ/6Zeip71e6G6x0Mh6/h1711IkTYlFp6v2p4SYJCVkzAIuK48aLDKgdy5fpu3LgjXfVSOVpu3AqUGpMRtkP1ZyL41SEL74b9xxN5Ce6zOBB4RBb8zxyR1oClizHcEuz0gfyz3xLzbiOxJPzZaBF1Oezxcg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629225767; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=8HS6v8MSXDSSVg5VPIvUAUxuQqBPP0TaFtcEofX5+lg=; b=gqZ6r3pzsg5yCh4zTPAm/2mwqdDrcaqaiHXmYobauMet28KJQFsiGOkkH5o+u7SBEyv5lmO22qLzwPdlqY99CbTkAwVBYzl9mU8mWpTbc8bxj+wrL/k0x1M8TuCsci2GHhI8notATxbQjPm5UQ7HgMDeqbIjtVNQ/64B2H64t9E= 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=1629225767; 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=8HS6v8MSXDSSVg5VPIvUAUxuQqBPP0TaFtcEofX5+lg=; b=NeVNUYX/rK2SAjo1dg6040Ss9motm+NNMQ48bgmCuJrVO+FpL7kukN7IGUzu5o+j Xb2LaRzKad12bBQECkh4S6kNyA7kiQgbKgXQivuC7bxDPB0ADQEzY0cCqIm3OH6NnQv 02XQytSmNS80rRAooUapV/jq5EPCeBOgZD6upzTc= Received: from Rasoir (7.87.95.79.rev.sfr.net [79.95.87.7]) by mx.zohomail.com with SMTPS id 1629225765424656.9998667444002; Tue, 17 Aug 2021 11:42:45 -0700 (PDT) References: <87v9442ms4.fsf@rdklein.fr> <87o89w9iru.fsf@beadling.co.uk> User-agent: mu4e 1.4.15; emacs 27.2 From: Edouard Klein To: Phil Subject: Re: A single reference to installed non-binaries In-reply-to: <87o89w9iru.fsf@beadling.co.uk> Message-ID: <87pmub3obs.fsf@rdklein.fr> Date: Tue, 17 Aug 2021 20:42:32 +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=1629225822; 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=8HS6v8MSXDSSVg5VPIvUAUxuQqBPP0TaFtcEofX5+lg=; b=P4iIrY/Ip09Mk0+tHsA5qMLYCAXLsLcHguW4XQWtPqq419IITAXv22r+YK3c1zd1INwj/8 Q1T7fXGrRrrTKz/grsskodOymjf+vpfdI59U0+/sM4vVcu+HdtXSbDcFYu71Tib+JUg2eF OzvqSUKgIlh/dYQE1jPHidmfou+cP23ypxolPVYNJRPGCjtpU5NimWFiruY9GXcQ1J0UYt Fa7cPJhC2a/vp8OWilyq6HdwsLekelGXsPWVsaRWwoLuVBNGMyDU7Ith+vNYMaQZefb5BM 0IT/i3/Yxj97TNGlWN/PydvLvlvNTSOAg+mMDkZAo2lqmZmubFpXQ+nDLrVFHw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1629225822; a=rsa-sha256; cv=pass; b=Piax37mr/Gw2m5nsamD9serXSbZfJ+s+q28QLiEK9KfaeVGpzTdUDR+U7FT+rsx1jh516d fVJqhCGAq8VCyNjRHdRZVhoOt2ciIssFA9tP0MuTfYTpCF1V7wYFZ7hnAh9M0UUcpAEOjN vABRnWs/OIEg7KYAFrq25FM1SSuqqvZhyGBWmyCfF/PoVpWgqNN2SyQa+qbu4OIm/rrUYp fAHu3ng35NcdEN2CJooyuftU49P35MW020981kaSD03DcfGtmloypc12BWXxeRKNXPDi0z rweyIclukg/Mgpgu0jCmb0I2O/0MG3cJxnmI1VQgptidAdZbIvAIUcyacghSag== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b="NeVNUYX/"; 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-Spam-Score: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=rdklein.fr header.s=zoho header.b="NeVNUYX/"; 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: 3AD30A964 X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: cVaqIpKhprlQ Phil writes: > Thanks for comments Edouard! Responses inline. :) > > > Edouard Klein writes: > > >> See e.g. >> https://gitlab.com/edouardklein/guix/-/blob/beaverlabs/beaver/packages/scheme-xyz.scm#L68 > > Ahh so wrap-program creates a script that sets the two env vars > LD_LIBRARY_PATH and TZDIR before calling the original script? Yes, it is exactly what it does, with the added cleverness that if the original script is already a wrap, it edits the wrap instead of re-wrapping. > >> It has the advantage of not needing to integrate any guix-realted stuff >> in package-y, which I would consider an abstraction leak. > > Yes it's nicer for the underlying program not to have to know about > Guix. > > There is one small wrinkle with this in my particular case. Whilst I > can wrap the main entry point to the program easily enough, there is a > second entry point via the unit tester (pytest), which is obviously an > external tool so not so easy to wrap. > > I could patch the source code of the unit test itself as an alternative. > As you can see a bit below where I linked before, you can redefine the test stage in order to set the correct environment variables before calling your test command. It will be a bit redundant with the wrapping phase, but it would allow you not to edit your application code. > Another slightly more leftfield idea is to change (or add) package-x to be a > python package which holds the original data files and a very thin API > client that can serve those files up to Python. > > Then package-x's python module will be self-aware of its location, relative > to the text files and we can serve up either a file path or file > object to package-y just by importing package-x, and calling a function. > I don't know the particulars of your code, but package-x and package-y seem to be quite coupled together, so I would question the assumption that they belong in separate packages. Maybe they do, nobody is better placed than you to judge. But putting them both in the same package would make your problems disappear. > The disadvantage of this would be if we had non-python clients > too, but we could keep two different build systems for the same source - > one copies the files, and the other installs a python module. > > I'll give this a whirl. Good luck ! Cheers, Edouard.