unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Edouard Klein <edou@rdklein.fr>
To: Phil Beadling <phil@beadling.co.uk>
Cc: help-guix@gnu.org
Subject: Re: A single reference to installed non-binaries
Date: Tue, 17 Aug 2021 16:01:15 +0200	[thread overview]
Message-ID: <87v9442ms4.fsf@rdklein.fr> (raw)
In-Reply-To: <CAOvsyQu0Nwr3Sk6vPAbjQKJdHk0EZ19Ft0_rh0c6HJrSLhfS+A@mail.gmail.com>

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.



  reply	other threads:[~2021-08-17 14:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 11:31 A single reference to installed non-binaries Phil Beadling
2021-08-17 14:01 ` Edouard Klein [this message]
2021-08-17 15:45   ` Phil
2021-08-17 18:42     ` Edouard Klein
2021-08-17 20:42       ` Phil
2021-08-17 17:55   ` Leo Famulari
2021-08-17 18:49     ` Setting TZDIR (was Re: A single reference to installed non-binaries) Edouard Klein
2021-08-17 20:20       ` Leo Famulari

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=87v9442ms4.fsf@rdklein.fr \
    --to=edou@rdklein.fr \
    --cc=help-guix@gnu.org \
    --cc=phil@beadling.co.uk \
    /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.
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).