Bad slot inheritance in ECL

Faré fahree at
Tue Dec 27 17:00:34 UTC 2016

When I modify my script, I see

Which looks weird to me: shouldn't the initialize-instance :before
method have triggered an error because I did a make-instance outside
of make-operation? That sounds like another ECL CLOS bug to me — SBCL
does catch this one. Which means that somehow the (load-system
:cffi-toolchain) failed to cause an implicit upgrade of asdf, at least
on ECL. Sigh. Oh, that's because you called your internal version instead of as you should probably have, to follow
the asdf numbering convention described in upgrade.lisp.

On the other hand, I realize that the gather-type vs gather-operation
thing was my bug in failing to import the suitable symbols from
asdf/bundle, so I was defining NEW slots with symbols of the same name
but in different packages ­— that's worth at least a warning (SBCL
does issue warnings in that case, but of course that code was #+(or
ecl mkcl)).

OK, so the failures are all explained now.

Please number your ASDF properly. If you forked at and added
three patches, this should be ASDF This will allow the
ASDF upgrade mechanism to work properly.

However, though the program compiles as expected, trying to link lots
of .o files instead of a handful of .a files leads to another bug:
=> An error occurred during initialization:
Too many arguments supplied to a macro or a destructuring-bind form:
That's from the line:
    (destructuring-bind ((lib-op . deps)) (call-next-method)

Looks like I can't win :-(

Of course, if I get past whatever limitation ECL has here (can you fix
it?), the next bump will be a command line too long for the kernel, at
which point the solution would have been to pass arguments to GCC with
an @file, the same way that bazel does it.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
Insanity is hereditary — you get it from your kids.

On Tue, Dec 27, 2016 at 3:17 AM, Daniel Kochmański <daniel at> wrote:
> (slot-value (make-instance 'foo-op) 'gather-type) ;-> :object
> Works OK for me. I think that the problem is somewhere with your
> make-operation and gather-type functions indirection magic (I'm not
> saying its not triggered by some bug in ECL, but it's doesn't look like
> a problem with allocation).
> Faré writes:
>> I'm facing an "interesting" bug in ECL: in my branch of cffi at
>> I try to define a static-image-op that has gather-operation
>> 'compile-op and gather-type :object because I want to force all
>> objects to be linked, and using the same 'lib-op and :static-library
>> as image-op cause objects unreferenced by ECL to be dropped. However,
>> though I override these slots in my defclass, they don't seem
>> effective.
>> (require "asdf")
>> (asdf:load-system :cffi-toolchain)
>> (in-package :cffi-toolchain)
>> (uiop-debug)
>> (defclass foo-op (image-op)
>>   ((gather-type :initform :object :allocation :class)))
>> (defun g (o) (asdf/bundle::gather-type (make-operation o)))
>> (DBG :foo
>>      (g 'image-op) ;==> :static-library, as expected
>>      (g 'static-image-op) ;==> :static-library, but expected :object
>>      (g 'static-program-op) ;==> :static-library, but expected :object
>>      (g 'foo-op)) ;==> :static-library, but expected :object
>> I tried to extract a smaller test case by recreating in a file the
>> hierarchy of static-image-op, keeping only the definitions and
>> overrides for slot gather-type, but then it worked. Maybe the
>> combination of eval-when's and/or the compilation and loading play a
>> role in making the bug happen.
>> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
>> The only way for a reporter to look at a politician is down.
>>                — H.L. Mencken
> --
> Daniel Kochmański ;; aka jackdaniel | Przemyśl, Poland
> TurtleWare - Daniel Kochmański      |
> "Be the change that you wish to see in the world." - Mahatma Gandhi

More information about the ecl-devel mailing list