I want to do "make clean" on ASDF. I tried to use clean-op of ARNESI.
I got a following message,
WARNING: No dependency propagating scheme specified for operation class IT.BESE.ARNESI:CLEAN-OP. The class needs to be updated for ASDF 3.1 and specify appropriate propagation mixins.
#<IT.BESE.ARNESI:CLEAN-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN {1003A65533}>
Definition of arnesi:clean-op is
(defclass clean-op (asdf:operation) ((for-op :accessor for-op :initarg :for-op :initform 'asdf:compile-op)) (:documentation "Removes any files generated by an asdf component."))
(defmethod asdf:perform ((op clean-op) (c asdf:component)) "Delete all the output files generated by the component C." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (delete-file f))))
(defmethod asdf:operation-done-p ((op clean-op) (c asdf:component)) "Returns T when the output-files of (for-op OP) C don't exist." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (return-from asdf:operation-done-p nil))) t)
How to fix it?
Thanks.
ta2gch
Hi Masaya, list!
I use batch file which deletes all fasl files to do complete cleanup. If I wanted to force recompilation of a particular system, I would just "touch" all files.
See also https://en.wikibooks.org/wiki/Common_Lisp/External_libraries/ASDF/Budden%27s... - it describes a way to find fasls of the system.
Hi Budden!
I see I can only do that with shell or batch.
I would like to confirm, is it possible to create new operation for ASDF 3.1 regardless of cleaning up .fasl files?
I googled, but there is no particular code to create new operation for an asdf manual but there is a section for creating a new operation at asdf manual.
Could you tell me an example that just print "hello asdf", and it is named hello-op likes this Makefile
hello: echo "hello asdf"
Thank you for your telling.
ta2gch
Sent from my iPhone
On May 9, 2016, at 00:19, 73budden . budden73@gmail.com wrote:
Hi Masaya, list!
I use batch file which deletes all fasl files to do complete cleanup. If I wanted to force recompilation of a particular system, I would just "touch" all files.
See also https://en.wikibooks.org/wiki/Common_Lisp/External_libraries/ASDF/Budden%27s...
- it describes a way to find fasls of the system.
Hi Budden!
I see I can only do that with shell or batch.
I would like to confirm, is it possible to create new operation for ASDF 3.1 regardless of cleaning up .fasl files?
I googled, but there is no particular code to create new operation for an asdf manual but there is a section for creating a new operation at asdf manual.
Could you tell me an example that just print "hello asdf", and it is named hello-op likes this Makefile
hello: echo "hello asdf"
Thank you for your telling.
ta2gch
On 2016年05月09日 00:19, 73budden . wrote:
Hi Masaya, list!
I use batch file which deletes all fasl files to do complete cleanup. If I wanted to force recompilation of a particular system, I would just "touch" all files.
See also https://en.wikibooks.org/wiki/Common_Lisp/External_libraries/ASDF/Budden%27s...
- it describes a way to find fasls of the system.
Hi!
Maybe :force works well now, but I had problems with it in the past (don't remember which problems exactly). TANIGUCHI Masaya, you can consult asdf source as the "canonical" example of operations.
I'll look into this a bit. I'd be happy to see clean-op incorporated in ASDF.
Note that budden's response about using touch is not necessary. To force a recompile one can simply use :force
Sent from my iPhone
On May 8, 2016, at 09:50, TANIGUCHI Masaya ta2gch@gmail.com wrote:
I want to do "make clean" on ASDF. I tried to use clean-op of ARNESI.
I got a following message,
WARNING: No dependency propagating scheme specified for operation class IT.BESE.ARNESI:CLEAN-OP. The class needs to be updated for ASDF 3.1 and specify appropriate propagation mixins.
#<IT.BESE.ARNESI:CLEAN-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN {1003A65533}>
Definition of arnesi:clean-op is
(defclass clean-op (asdf:operation) ((for-op :accessor for-op :initarg :for-op :initform 'asdf:compile-op)) (:documentation "Removes any files generated by an asdf component."))
(defmethod asdf:perform ((op clean-op) (c asdf:component)) "Delete all the output files generated by the component C." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (delete-file f))))
(defmethod asdf:operation-done-p ((op clean-op) (c asdf:component)) "Returns T when the output-files of (for-op OP) C don't exist." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (return-from asdf:operation-done-p nil))) t)
How to fix it?
Thanks.
ta2gch
Hi Budden!
I see I can only do that with shell or batch.
I would like to confirm, is it possible to create new operation for ASDF 3.1 regardless of cleaning up .fasl files?
I googled, but there is no particular code to create new operation for an asdf manual but there is a section for creating a new operation at asdf manual.
Could you tell me an example that just print "hello asdf", and it is named hello-op likes this Makefile
hello: echo "hello asdf"
Thank you for your telling.
ta2gch
Sent from my iPhone
On May 8, 2016, at 23:50, TANIGUCHI Masaya ta2gch@gmail.com wrote:
I want to do "make clean" on ASDF. I tried to use clean-op of ARNESI.
I got a following message,
WARNING: No dependency propagating scheme specified for operation class IT.BESE.ARNESI:CLEAN-OP. The class needs to be updated for ASDF 3.1 and specify appropriate propagation mixins.
#<IT.BESE.ARNESI:CLEAN-OP > #<ASDF/PLAN:SEQUENTIAL-PLAN {1003A65533}>
Definition of arnesi:clean-op is
(defclass clean-op (asdf:operation) ((for-op :accessor for-op :initarg :for-op :initform 'asdf:compile-op)) (:documentation "Removes any files generated by an asdf component."))
(defmethod asdf:perform ((op clean-op) (c asdf:component)) "Delete all the output files generated by the component C." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (delete-file f))))
(defmethod asdf:operation-done-p ((op clean-op) (c asdf:component)) "Returns T when the output-files of (for-op OP) C don't exist." (dolist (f (asdf:output-files (make-instance (for-op op)) c)) (when (probe-file f) (return-from asdf:operation-done-p nil))) t)
How to fix it?
Thanks.
ta2gch
Dear ta2gch,
On Sun, May 8, 2016 at 10:50 AM, TANIGUCHI Masaya ta2gch@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.
On Sun, May 8, 2016 at 11:28 AM, Faré fahree@gmail.com wrote:
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.
These certainly are dicey issues given the default mapping of output files.
Something I've been looking into is moving towards "project-based" CL development. Most other languages now have some variant of this, where dependencies and build artifacts are typically contained within some sub-directory. At this point in time, it's surprising that ASDF/Quicklisp doesn't do things this way. I've only found one project attempting to do this,
https://github.com/fukamachi/qlot (after a quick read, I don't think it's mapping output-files underneath the project directory like one might expect)
If you only expect to load files from within that project/directory, and run separate lisp images for different projects/directories, then cleaning is more intuitive for those coming from mainstream environments, i.e. you just delete the build/ sub-directory. I'd be interested to hear about similar approaches and complications, e.g. you'd want a user-global quicklisp cache to avoid re-fetching remote deps as in Maven with its ~/.m2.