... update.

I bit the bullet and kludged up something like 

(defparameter *stuff-dir* (and (asdf:find-system "stuff" nil)
                               (asdf:system-source-directory "stuff"))


It works for me.

The asdf:find-system is probably overkill, but better safe than sorry.

MA


On Sat, Dec 13, 2025 at 4:16 PM Marco Antoniotti <marco.antoniotti@unimib.it> wrote:
Thanks but no.

That would create a dependency from ASDF in the code.

MA



On Sat, Dec 13, 2025 at 1:50 PM Robert P. Goldman <rpgoldman@sift.net> wrote:
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



--
Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY

REGAINS: https://regains.disco.unimib.it/


--
Marco Antoniotti, Professor, Director         tel. +39 - 02 64 48 79 01
DISCo, University of Milan-Bicocca U14 2043   http://dcb.disco.unimib.it
Viale Sarca 336
I-20126 Milan (MI) ITALY

REGAINS: https://regains.disco.unimib.it/