Relativising FASL Cache Paths
Nicolas Hafner
shinmera at tymoon.eu
Fri Dec 15 12:32:03 UTC 2017
I see, thanks a lot for the hint.
I've just stumbled upon another complicating factor though, which is
source location information. Apparently it is not possible to manually
relocate source information after it has been loaded from a FASL in
SBCL. However, if the Lisp files were compiled using a logical pathname,
logical pathname translations could be used to fix that up as required.
Is there a way to transform the input/output files to logical pathnames
to facilitate this, or would that be too much to ask for?
On 15/12/17 11:44, Faré wrote:
> The design of ASDF is that you should properly initialize the
> output-translations. The usual way is to use
> ~/.config/common-lisp/asdf-output-translations.conf, but since in your
> case you support the directory moving from one instantiation to the
> next, it is probably better to call
> asdf:initialize-output-translations at startup with a proper argument
> (using properly computed absolute pathnames), just after you (require
> "asdf") (which I assume is possible and yielding no older than 3.1.2)
> but before you compile anything with it. Untested template that might
> work:
>
> (asdf:initialize-output-translations
> `(:output-translations
> (,(uiop:wilden *portacle-directory*) ,(uiop:wilden
> (uiop:subpathname *cache-top* "portacle/")))
> (t (uiop:wilden (uiop:subpathname *cache-top* "other/")))
> :ignore-inherited-configuration))
>
> Note that you may choose to use the :inherit-configuration instead.
>
> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
> If soldiers are not to cross international boundaries, goods must do so. Unless
> the Shackles can be dropped from trade, bombs will be dropped from the sky.
> — Otto T. Mallery
>
>
> On Fri, Dec 15, 2017 at 4:41 AM, Nicolas Hafner <shinmera at tymoon.eu> wrote:
>> Hello everyone.
>>
>> I have a rather particular problem that I have so far not been able to solve
>> on my own without brittle workarounds. Specifically, I'm looking for a way
>> to ensure that the directory paths stored in the FASL cache directory are,
>> if possible, truncated according to some other path (by enough-pathname or a
>> similar facility).
>>
>> The reason I want this is for Portacle. The Portacle directory should be
>> relocatable and you should even be able to take it with you on a flash drive
>> to run on other machines. However, this usually means that the absolute
>> position of the directory on the file system will change, even if the Lisp
>> files and FASLs within it remain at the same relative locations.
>>
>> I would thus like to stop ASDF from recompiling everything when the
>> directory is moved absolutely, and instead rely on paths relative to
>> Portacle's own "root" directory if possible.
>>
>> My current approach involves setting
>> asdf/output-translations::*output-translation-function* to a modified
>> version that attempts to relativise the path as seen here. However, this
>> sometimes leads to issues as the translated path might be relative and other
>> components down the line seem to expect absolute paths.
>>
>> Any advice on how to proceed on this would be appreciated.
>>
>> Sincerely, Nicolas Hafner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20171215/81f1242b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20171215/81f1242b/attachment.sig>
More information about the asdf-devel
mailing list