ASDF:SYSTEM-RELATIVE-PATHNAME is probably what you want
Sent from my iPhone
> On Dec 13, 2025, at 06:11, Marco Antoniotti <marco.antoniotti@unimib.it> wrote:
>
>
> Hi
>
> I am getting old and I get confused.
>
> Here is the thing (a followup to the "wild" ASDF module question).
>
> I am writing something that will have, at run time, a variable *the-directory-where-stuff-is*.
>
> Now, I want to initialize this variable automagically, with no "outside" references. I thought I could do something like
>
> (defvar the-directory-where-stuff-is*
> (merge-pathnames (make-pathname :directory '(:relative "stuff")
> :name nil :type nil)
> (make-pathname :name nil :type nil
> :defaults *load-pathname*)))
>
> Alas, ASDF and other things may move the compiled file to a cache folder, which, in the end misaligns *load-pathname* w.r.t. where "stuff" actually is (and should be).
>
> This is something that build systems like cmake achieve with the notion of "source", "install", etc folders.
>
> Any ideas, suggestions, incantations, workarounds, even at the ASDF level to get this done?
>
> Thanks
>
>
> --
> Marco Antoniotti