<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>I see, thanks a lot for the hint.</p>
    <p> 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.</p>
    <p>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?</p>
    <br>
    <div class="moz-cite-prefix">On 15/12/17 11:44, Faré wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAN7nBXfJwUcAOgKGcJGZ1TEyNU2uegvD7_GQDgi4K6nNZcpi1Q@mail.gmail.com">
      <pre wrap="">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• <a class="moz-txt-link-freetext" href="http://fare.tunes.org">http://fare.tunes.org</a>
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 <a class="moz-txt-link-rfc2396E" href="mailto:shinmera@tymoon.eu"><shinmera@tymoon.eu></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">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
</pre>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>