LOGICAL-PATHNAMES output locations

Mark Evenson evenson at panix.com
Mon May 22 15:29:17 UTC 2017


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.lisp#L166

-- 
"A screaming comes across the sky.  It has happened before, but there
is nothing to compare to it now."



More information about the asdf-devel mailing list