guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding to the end of the load path


From: Mark H Weaver
Subject: Re: Adding to the end of the load path
Date: Sun, 11 Nov 2012 16:51:42 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Andreas Rottmann <address@hidden> writes:

> Mark H Weaver <address@hidden> writes:
>
>> I'm also not comfortable with having the empty string be the special
>> marker separating the prepend and append portions of the path.  As you
>> noted in your earlier email, the empty string is currently interpreted
>> as the current directory, and users may have come to rely on that.
>>
>> If we do this, I think the special marker should be a path component
>> that is highly unlikely to occur in practice.  Some ideas off the top of
>> my head are: "...", "*", or " ".  I think I like "..." best.
>>
>> What do you think?
>>
> Another idea would be to use an additional environment variable,
> e.g. GUILE_LOAD_{COMPILED_,}_PATH_SUFFIX.  If we cannot use the empty
> string as special token, I'd prefer introducing additional environment
> variables.

This is certainly the cleanest solution, but there is a complication: if
a user has multiple versions of Guile installed on their system, some of
which look for GUILE_LOAD_PATH_SUFFIX and some which do not, there is no
way for them to configure their environment variables that will work
correctly for all versions.  Guile 2.0.5 will be widely deployed until
at least 2017, since it is part of Ubuntu 12.04 LTS.  We have to cope
with that somehow.

With the "special path component" approach, a user can configure their
GUILE_LOAD_PATH properly today, and it will behave reasonably well on
all versions of Guile.  For older versions of Guile, it will prepend all
components to the path, including the special token which adds two
stat(2) calls per module-load but is otherwise harmless.  For newer
versions, it will do what we want.

Although not as elegant as I'd like, this seems to be the only workable
solution to our problems regarding SRFIs in Guildhall.  It means that we
can immediately start asking users to put "..." in their GUILE_LOAD_PATH
when configuring Guildhall.  The fact that older versions of Guile will
prepend _all_ path components is not a problem, because our Guildhall
repositories we include only SRFIs that are not yet included in core
Guile.  The additional functionality will start working precisely when
it needs to, because only future versions of Guile will include SRFIs
that are also included in Guildhall.

What do you think?

If we can come up with a more elegant solution to this problem that
works with both old and new versions of Guile, I'm open to suggestions.

    Regards,
      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]