How to fix arnesi:clean-op.

Faré fahree at gmail.com
Sun May 8 18:28:29 UTC 2016


Dear ta2gch,

On Sun, May 8, 2016 at 10:50 AM, TANIGUCHI Masaya <ta2gch at gmail.com> wrote:
> I want to do "make clean" on ASDF.
> I tried to use clean-op of ARNESI.
>
> I got a following message, [...]
>
> How to fix it?
>

This is a simple question that unhappily has no answer. My apologies
if my following non-answer is so long and delves into philosophy.

In practice, I'd say that a combination of git clean -xfd and/or
rm -rf ~/.cache/common-lisp/ is what most people need, though
neither should be done without an understanding of the consequences.

clean-op is an impossible operation to fix, because its meaning isn't
defined in general, and CANNOT be defined in general. And while some
specific subsets and variants of it CAN be defined, they remain so
specific as to not be of general purpose and/or there are enough
subtly different variants of it to require a breakdown of the vague
idea into clearly separated concepts.

For instance, in the context of using git, you might "just" do a:

git clean -xfd

and call it quits. Yet, unless you specifically configured your
output-translations to point to under the current git repository,
it won't clean your fasl-translated cache, which would be in e.g.

~/.cache/common-lisp/ccl-1.12-f102-linux-x86/home/fare/common-lisp/arnesi/

Then comes the question: should clean-op clean only for the
current implementation, or should it also remove objects for
sbcl, ecl, allegro, etc.? A git clean might erase files that
you'd like to preserve, that you failed to git add. A

        rm -rf ~/.cache/common-lisp/ccl-1.12-f102-linux-x86/home/fare/common-lisp/arnesi/

would fail to remove fasls from dependencies or on other
implementations. You could try

        rm -rf ~/.cache/common-lisp/ccl-1.12-f102-linux-x86/

or even

        rm -rf ~/.cache/common-lisp/

but then that might remove too many things, including things you might
like to keep at that time. And if you have a non-standard
configuration for output-translations, this might still miss some
files you might want to remove. Actually, build-op and/or bundle-op
variants will typically put the final executable output in the current
directory rather than the output translations cache!

Or you could try to build a plan for load-op with either :force t
or :force :all and remove all the output-files in the plan. But
then there are many problems: first, do you want to just clean
outputs for the current system with :force t, or for all its
dependencies with :force :all ? How do you deal with
defsystem-depends-on and other dependencies not explicitly
included in the plan? Are you sure there aren't bugs and
omissions in asdf or any extension whereby some side output file
is omitted from the list? What about randomly-named temporary
files created during an operation that has been interrupted?`
Their names definitely are not in the list deduced from the plan.
And what if load-op is not the only operation that matters, but
e.g. doc-op generates LaTeX and PDF outputs but fails to be
tracked by clean-op? Are you going to use the CLOS MOP to
generate a list of all possible operations? What if that other
operation isn't loaded in the current image? What if operation
options cause different files to be generated? Or features? What
about all secondary systems? Are you going to generate a plan
for them, too?

There are just too many variants to what "clean-op" might mean.
No possible general recipe can be provided that won't break down
in horrible ways for some users. Yet a given developer knows what
he means in his context. "Fixing" clean-op for good requires not
just a complete rewrite of ASDF but a re-thinking of your Lisp
development ecosystem.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
Many people believe "in the name of the (nation, poor, god, nature...)"
like "simon says" justifies or damns political opinions when said or omitted.



More information about the asdf-devel mailing list