fukamachi / mito

An ORM for Common Lisp with migrations, relationships and PostgreSQL support
284 stars 31 forks source link

Does not load on ABCL 1.8.0 on Windows #111

Open jespertp-systematic opened 2 years ago

jespertp-systematic commented 2 years ago

When trying to load mito using quicklisp I receive the following error:

There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION MOP:SLOT-BOUNDP-USING-CLASS {67BC38A7}> when called with arguments (#<BUILT-IN-CLASS SYMBOL {44F2CAE5}> :ALLOCATION-CLASS NIL). [Condition of type SIMPLE-ERROR]

Backtrace: 0: (INVOKE-DEBUGGER #<SIMPLE-ERROR {78874F63}>) 1: (ERROR "There is no applicable method for the generic function ~S when called with arguments ~S." #<STANDARD-GENERIC-FUNCTION MOP:SLOT-BOUNDP-USING-CLASS {67BC38A7}> (#<BUILT-IN-CLASS SYMBOL {44F2CAE5.. 2: (NO-APPLICABLE-METHOD #<STANDARD-GENERIC-FUNCTION MOP:SLOT-BOUNDP-USING-CLASS {67BC38A7}> #<BUILT-IN-CLASS SYMBOL {44F2CAE5}> :ALLOCATION-CLASS NIL) 3: (APPLY #<LOCAL-FUNCTION NO-APPLICABLE-METHOD IN METHOD MAKE-LOAD-FORM NIL (T) {7F528E64}> #<STANDARD-GENERIC-FUNCTION MOP:SLOT-BOUNDP-USING-CLASS {67BC38A7}> (#<BUILT-IN-CLASS SYMBOL {44F2CAE5}> ..)) 4: (MOP:SLOT-BOUNDP-USING-CLASS #<BUILT-IN-CLASS SYMBOL {44F2CAE5}> :ALLOCATION-CLASS NIL) 5: (SLOT-BOUNDP :ALLOCATION-CLASS MITO.CLASS.COLUMN::COL-TYPE) 6: (#<LOCAL-FUNCTION IN METHOD INITIALIZE-INSTANCE (AROUND) (TABLE-COLUMN-CLASS) {3529C3A4}> #<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS {13AF8DF3}> :ALLOCATION-CLASS #<MITO.DAO.MIXIN:DAO-TABLE-MIXIN MITO.D.. 7: (APPLY #<LOCAL-FUNCTION IN METHOD INITIALIZE-INSTANCE (AROUND) (TABLE-COLUMN-CLASS) {3529C3A4}> (#<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS {13AF8DF3}> :ALLOCATION-CLASS ..)) 8: (#<LOCAL-FUNCTION IN GENERATE-EMF-LAMBDA {6195A2D4}> (#<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS {13AF8DF3}> :ALLOCATION-CLASS ..)) 9: (#<LOCAL-FUNCTION IN METHOD INITIALIZE-INSTANCE (AROUND) (DAO-TABLE-COLUMN-CLASS) {1A5A79A1}> #<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS {13AF8DF3}> :ALLOCATION-CLASS #<MITO.DAO.MIXIN:DAO-TABLE-MIXIN MI.. 10: (APPLY #<LOCAL-FUNCTION IN METHOD INITIALIZE-INSTANCE (AROUND) (DAO-TABLE-COLUMN-CLASS) {1A5A79A1}> #<MITO.DAO.COLUMN:DAO-TABLE-COLUMN-CLASS {13AF8DF3}> (:ALLOCATION-CLASS ..))

results of (lisp-implementation-version): 1.8.0 OpenJDK_64-Bit_Server_VM-Red_Hat,_Inc.-11.0.11+9-LTS amd64-Windows_10-10.0

jespertp-systematic commented 2 years ago

It seems that the error occurs at line 73 in src/core/class/column.lisp

So apparently the SLOT-BOUNDP function signals an error because the meta-class for MITO.CLASS.COLUMN::COL-TYPE is an instance of the class BUILT-IN-CLASS SYMBOL

The CLHS specifies [1]: The specific behavior depends on instance's metaclass. An error is never signaled if instance has metaclass standard-class. An error is always signaled if instance has metaclass built-in-class. The consequences are undefined if instance has any other metaclass--an error might or might not be signaled in this situation. Note in particular that the behavior for conditions and structures is not specified.

I'm not sure if this helps anyone else, but I'll keep digging to see if I can figure out how to fix it. But since it works flawlessly in SBCL, maybe it is the SLOT-BOUNDP implementation in ABCL that is the problem?

[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_slt_bo.htm#slot-boundp

fukamachi commented 2 years ago

Sorry for the delay, and thanks for the further information!

Though I don't have enough time to dig into an environmental issue now, :ALLOCATION-CLASS (keyword) is given when defining a class while it should be a class object.