[asdf-devel] BUILD-OP
Faré
fahree at gmail.com
Thu Mar 13 19:43:22 UTC 2014
On Thu, Mar 13, 2014 at 2:40 PM, Robert P. Goldman <rpgoldman at sift.info> wrote:
> I'm a little concerned about making BUILD-OP be the default operation.
>
> It seems to me that "BUILD" is not a good synonym for "LOAD," which is
> how BUILD-OP is currently interpreted.
>
> I think the conventional interpretation of the word "build" would
> suggest to the user that
>
> (build "foo-system")
>
> would compile and NOT load "foo-system," instead of performing LOAD-OP
> as now. To me "build" does not connote "load."
>
> Is this just me? What's the sense of the community?
>
BUILD is supposed to be a synonym for "whatever the user expects to do
with this system",
which for most / all existing systems is "load it", but for e.g. test
systems might be "run the tests".
It is also intended to allow for (primary or secondary) systems that
are intended for something else
than being loaded.
Example: asdf/defsystem itself has :build-operation
monolithic-concatenate-source-op.
Now that ASDF3 has a sane action graph that isn't specialized only for
compiling CL code
(while being buggy at it), it can be used for other, arbitrary tasks.
But requiring each user to know by name the operation for each such
system is a pain,
especially when these systems require build extensions to define their
operation to begin with.
Actually, I see that :build-operation has the same bug as :class used to have
in presence of defsystem-depends-on, and build-op needs to do things similar to
asdf/parse-defsystem::class-for-type to be useful in this context.
Thus, if anyone uses ASDF to specify say the building of document,
using foo-doc:document-op,
the corresponding system would be
(defsystem my-document
:defsystem-depends-on (foo-doc)
:build-operation "foo-doc:document-op"
:components (...))
Or for shell scripts:
(defsystem my-makefile
:defsystem-depends-on (asdf-make)
:build-operation "asdf-make:run-op"
:components
((:target "all" :depends-on ("my-program"))
(:target "clean" :command "git clean -xfd")
(:target "tarball" :depends-on ("clean") :command "tar zcvf ...")
...)))
Getting build-op right is necessary to enable such uses.
And you don't want users to remember that they need to
(asdf:oos 'foo-doc:document-op :mydocument)
but
(asdf:oos 'asdf-make:run-op :my-makefile)
which is even worse since the foo-doc and asdf-make packages might not
even exist at this point.
Usability demands an asdf:build function. The name may vary, but
shorter is better.
asdf:b or asdf:bnm (build 'n' munge?) might do, too.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
Beware of altruism. It is based on self-deception, the root of all evil.
— Robert Heinlein, "Time Enough For Love"
More information about the asdf-devel
mailing list