(defvar *font-pathname* (merge-pathnames #p"font.ttf" *load-truename*)))Then ASDF2 arrived, and with its default policy of storing FASL files separated from source files, the above construct broke. *load-truename* wound up being something like /Users/xach/.cache/common-lisp/foo/bar/a
I initially switched my defvar forms to use something like this instead:
(defvar *font-pathname* (asdf:system-relative-pathname 'app #p"font.ttf"))That works ok. I don't like embedding ASDF references in my source code, though, so for now I'm switching to something like this in my app.asd file:
(defpackage #:app-config (:export #:*base-directory*)) (defparameter app-config:*base-directory* (make-pathname :name nil :type nil :defaults *load-truename*))And in the source:
(defvar *font-pathname* (merge-pathnames #p"font.ttf" app-config:*base-directory*))That way at least I won't have to update the application source code when I replace ASDF with something else!