Hello,
I'm cross-posting because I don't know if the issue is related to ASDF or ECL. I'm using the most recent repos of both.
When dumping a very simple system defined like this:
(asdf:defsystem :simple :depends-on (:net.didierverna.clon) :components ((:file "simple")) :entry-point "simple:main")
with (asdf:operate 'asdf:program-op :simple),
I'm getting a runtime error with the executable: Condition of type: SIMPLE-PACKAGE-ERROR There exists no package with name "NET.DIDIERVERNA.CLON.SETUP" No restarts available.
Top level in: #<process TOP-LEVEL 0x10a821f80>.
So it seems that the net.didierverna.clon.setup system is not dumped in the executable.
In Clon, the dependency on setup is indirect: net.didierverna.clon <- net.didierverna.clon.core net.didierverna.clon.core <- net.didierverna.clon.setup
If I add an explicit dependency on setup in the :simple ASDF system above like this:
:depends-on (:net.didierverna.clon.setup :net.didierverna.clon))
the problem goes away. This doesn't happen with the 5 other Lisp implementations that I've tested.
Also, it may be worth mentioning that Clon's setup system gets a special treatment. It's loaded explicitly at the top of several .asd files like this (with the utmost disrespect for the Almighty ASDF Gods recommendations):
(asdf:load-system :net.didierverna.clon.setup)
I'm wondering if this may have something to do with the problem.
Thanks!
Ecl does not dump the image - in other words the compilation environment is not part of the final executable. If the setup system is not a dependency of a "dumped" system, still its package is referenced from the latter, then this will happen. If the setup is indirect dependency of a dumped system, then it is most likely asdf bug, otherwise it is an expected behavior.
If you do not reference setup system package from a dumped system, then something fishy is going on, i.e system definition files are included in program op for some reason.
Regards, Daniel
Wysłano z aplikacji ProtonMail
-------- Oryginalna wiadomość -------- 21 mar 2021, 18:33, Didier Verna napisał(a):
Hello,
I'm cross-posting because I don't know if the issue is related to ASDF or ECL. I'm using the most recent repos of both.
When dumping a very simple system defined like this:
(asdf:defsystem :simple :depends-on (:net.didierverna.clon) :components ((:file "simple")) :entry-point "simple:main")
with (asdf:operate 'asdf:program-op :simple),
I'm getting a runtime error with the executable: Condition of type: SIMPLE-PACKAGE-ERROR There exists no package with name "NET.DIDIERVERNA.CLON.SETUP" No restarts available.
Top level in: #<process TOP-LEVEL 0x10a821f80>.
So it seems that the net.didierverna.clon.setup system is not dumped in the executable.
In Clon, the dependency on setup is indirect: net.didierverna.clon <- net.didierverna.clon.core net.didierverna.clon.core <- net.didierverna.clon.setup
If I add an explicit dependency on setup in the :simple ASDF system above like this:
:depends-on (:net.didierverna.clon.setup :net.didierverna.clon))
the problem goes away. This doesn't happen with the 5 other Lisp implementations that I've tested.
Also, it may be worth mentioning that Clon's setup system gets a special treatment. It's loaded explicitly at the top of several .asd files like this (with the utmost disrespect for the Almighty ASDF Gods recommendations):
(asdf:load-system :net.didierverna.clon.setup)
I'm wondering if this may have something to do with the problem.
Thanks!
-- ¡En Seguida! -- New album: https://www.didierverna.com/records/en-seguida.php Available on all digital platforms now!
Lisp, Jazz, Aïkido: http://www.didierverna.info
Daniel Kochmański daniel@turtleware.eu wrote:
If the setup is indirect dependency of a dumped system, then it is most likely asdf bug
Yes, it's an indirect dependency via a chain of :depends-on:
:simple -> :net.didierverna.clon -> :net.didierverna.clon.core -> :net.didierverna.clon.setup
If I add an explicit dependency on setup in the :simple ASDF system above like this:
:depends-on (:net.didierverna.clon.setup :net.didierverna.clon))
the problem goes away. This doesn't happen with the 5 other Lisp implementations that I've tested.
Also, it may be worth mentioning that Clon's setup system gets a special treatment. It's loaded explicitly at the top of several .asd files like this (with the utmost disrespect for the Almighty ASDF Gods recommendations):
(asdf:load-system :net.didierverna.clon.setup)
I'm wondering if this may have something to do with the problem.
Your system definition was wrong, and you found the way to fix it.
Your manual (asdf:load-system ...) from the .asd file is equivalent to a :defsystem-depends-on dependency. It creates a dependency at system-definition-time, but not at runtime. Not at runtime, ergo, not to be included in the executable.
If it defines packages that are required in the executable, it MUST be added as a load-time dependency as well as a system-definition-time dependency. It is a BUG in YOUR code that clon fails to depend on clon.setup.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org Director is a misnomer. You're a hoper. You put all these people together and you hope it all works out. — Frank Oz, director of "Dirty Rotten Scoundrels"
François-René ÐVB Rideau écrivait:
Your manual (asdf:load-system ...) from the .asd file is equivalent to a :defsystem-depends-on dependency. It creates a dependency at system-definition-time, but not at runtime. Not at runtime, ergo, not to be included in the executable.
No, this is wrong. Like I said, there is ALSO a load-time (indirect) dependency on the setup system via :depends-on, so the setup system IS included in the executable.
If it defines packages that are required in the executable, it MUST be added as a load-time dependency as well as a system-definition-time dependency.
Which, again, is exactly the case. After sleeping over it, I have a different hypothesis: a problem in the execution order of everything that's dumped. The reason for the LOAD-SYSTEM call is for this line in the system definition:
:version #.(net.didierverna.clon.setup:version :short)
So I don't really know how program-op works in ECL (in particular, what it does with the .asd files), but now I think that at the time this above function needs to be called, the setup system isn't hot yet, and so its package hasn't been created.
Regardless, if that's indeed the case, the conclusion remains the same: in order to "program-op" a system depending on Clon with ECL, an explicit dependency on clon.setup needs to be added first.
The other obvious solution would be for ASDF to let me provide a form to be executed without the need for #., but I seem to recall that you didn't want such things to be possible in system definitions.