In spite of Faré's resistance to supporting LOGICAL-PATHNAMEs in ASDF, I would ask for help in using the current capabilities documented for ASDF-3.2.
To wit, I would like to implement my own OUTPUT-TRANSLATIONS for LOGICAL-PATHNAMES [as is allowed (but discouraged)][1].
[1]: https://www.common-lisp.net/project/asdf/asdf.html#Using-logical-pathnames
I tried to define a (massively inefficient) :BEFORE COMPILE-OP which replaces all LOGICAL-PATHNAME instances with a call to CL:TRUENAME but that doesn't seem to work:
``` (defsystem abcl/build :version "2.0.0" :description "Build ABCL from a Lisp. Downloads necessary build-time tools to local cache." :in-order-to ((test-op (test-op abcl/build/t))) :perform (compile-op :before (op c) (when (typep c 'source-file) (with-slots (absolute-pathname) c (when (typep absolute-pathname 'logical-pathname) (setf absolute-pathname (truename absolute-pathname)))))) :components ((:module package :pathname #p"SYS:build;" :components ((:file "package"))) ```
What is the right well to specify my own OUTPUT-TRANSLATIONS mechanism?
The disfavor of LOGICAL-PATHANME references in DEFSYSTEM form is fully understandable from the observation that there is no conforming way to ensure that the "right" translations are in place. But, I have come up with a use case in abcl where LOGICAL-PATHNAMEs would be very useful, and since it is "my" implementation, I can guarantee that appropiate translations are in place at runtime. My use case involves locating source code referenced by ASDF in different locations depending on whether the source is being actively developed, and is on a writable filesystem, or whether the source is being loaded from a read-only JVM source, i.e. a "jar" archive. Using LOGICAL-PATHNAMEs within `abcl.asd` allows me to configure the runtime behavior quite nicely via suitable DSL parameter to the ASDF:INITIALIALIZE-SOURCE-REGISTRY. Running the [currently-in-asdf jar translation code on the SOURCE-FILE][2] is all I need to do here to get a valid output location for COMPILE-OP.
[2]: https://gitlab.common-lisp.net/asdf/asdf/blob/master/output-translations.lis...
On Mon, May 22, 2017 at 11:29 AM, Mark Evenson evenson@panix.com wrote:
In spite of Faré's resistance to supporting LOGICAL-PATHNAMEs in ASDF, I would ask for help in using the current capabilities documented for ASDF-3.2.
Well, ASDF already does heroics to keep logical-pathnames working, and we accept reasonable patches.
What is the right well to specify my own OUTPUT-TRANSLATIONS mechanism?
The recommended API is to define a method for output-files, possibly :around, that does your translations and returns T as second value.
Alternatively, you can subvert the entire uiop:*output-translation-function*, though this has to happen after you load asdf yet before you use it.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org I don't want to belong to any club that will accept me as a member — Groucho