[asdf-devel] Advanced Configuration
fahree at gmail.com
Mon Nov 11 09:01:30 UTC 2013
On Mon, Nov 11, 2013 at 2:40 AM, FAU <fau at riseup.net> wrote:
> I'd like to find out if I can do this with ASDF.
> (defun foo ()
> As you can see the behaviour of the fn foo depends on version request
> features (which, lets say, represents the API version and not the
> software package version) which must be pushed on *features* before the
> system is compiled (or loaded).
> I'd like to have ASDF reject any operation on system foo if there's not
> an appropriate API version request feature present for it and notify
> the user in some way.
> I'd like to keep multiple fasls for different API versions in the
> cache. (One way to achieve this, which comes to my mind, would be to
> mangle the name of the fasl output file name to incorporate the version
> in same way or to change the output directory path.)
You could have a form in foo.asd that uses #+ or (featurep ...) to
query the features,
and control that in your build scripts before you call ASDF on your system.
However, I don't recommend this strategy.
I recommend you compile either only the latest version by default, or
compile all versions if compatibility is a must, and select at runtime
via some parameter or hook.
In general, anything that makes compilation non-deterministic is to be
That said, I remember that at ITA, h4ns did a subclass of
cl-source-file so that a file could be compiled twice (with a
different output name, each time), one in each of two packages. You
could do something similar, except with two features. In the recently
published snapshot of QUUX, see in
lisp/qres-build/asdf-source-in-package.lisp for inspiration.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
Legislation is the manifestation of Evil in the world. Legislation is the
supreme camouflage of the devil, for it institutionalises Evil by giving
it the appearance of Good.
— Christian Michel, http://www.liberalia.com/htm/cm_obey_laws.htm
More information about the asdf-devel