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 https://portacle.github.io/. 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 https://github.com/portacle/config/blob/master/sbcl-init.lisp#L70. However, this sometimes leads to issues https://github.com/portacle/portacle/issues/62 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