Shinmera / qtools

Qtools is a collection of utilities to aid development with CommonQt
https://shinmera.github.io/qtools
zlib License
209 stars 17 forks source link

Executables don't work after deploying #45

Open hunar1997 opened 3 years ago

hunar1997 commented 3 years ago

Hello This question is kind of similar to #35 which I've commented on, but I think it deserves a new issue.

I have this problem when using latest 64bit SBCL available for Windows (V2.0.0) and manjaro-linux (V2.0.11) and i've tested it in Windows10&7 & two linux machines.. also tested CCL compiler.. all of them bring the same error

When I run an example code it works without any problems, but as soon as I make an executable out of it (and make sure it can find the dynamic libraries) it then throws an error complaining that Encountered unhandled error: Class not found: QWidget or the same error but about not finding QGLWidget if the code used QGLWidget

Here is the simplest example + the output error, please try it

It also happens when I just use (sb-ext:save-lisp-and-die etc...) so I think it's not related to the Deploy library

The deploy library suggested setting environment variable DEPLOY_DEBUG_BOOT to get the debugger after crashing, this was the output after export DEPLOY_DEBUG_BOOT=1 ./a on linux

 ==> Performing warm boot.
   -> Runtime directory is /home/hunar/BareBones/bin/
   -> Resource directory is /home/hunar/BareBones/bin/
 ==> Running boot hooks.
   -> Loading smoke module QTCORE.
   -> Loading smoke module QTGUI.
 ==> Running Qtools boot hooks.
 ==> Reloading foreign libraries.
 ==> Launching application.

debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {10025C8103}>:
  Class not found: QWidget

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [EXIT ] Exit.
  1: [ABORT] Exit from the current thread.

(QT:FIND-QCLASS "QWidget" T)
   source: (ERROR "Class not found: ~A" NAME)
0] 

I'm not sure how trivial-backtrace works but after getting the debugger, I entered (print-backtrace) and got this

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>
0: (QT:FIND-QCLASS "QWidget" T)
1: (QTOOLS::CHECK-QT-SUPERCLASS-COMPATIBILITY "QWidget" (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>))
2: (QTOOLS::SETUP-WIDGET-CLASS #<QTOOLS:WIDGET-CLASS {10025E2993}> #<CLOSURE (FLET CALL-NEXT-METHOD :IN "/home/hunar/quicklisp/dists/quicklisp/software/qtools-20200427-git/widget.lisp") {10025E30DB}> QTOOLS::INIT T :NAME TEST::MAIN-WINDOW :DIRECT-SUPERCLASSES (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/Desktop/New Folder/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL)
3: ((:METHOD MAKE-INSTANCE (CLASS)) #<STANDARD-CLASS QTOOLS:WIDGET-CLASS> :NAME TEST::MAIN-WINDOW :DIRECT-SUPERCLASSES (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/Desktop/New Folder/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL) [fast-method]
4: ((FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT))
5: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
6: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<CLOSURE (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT) {7F183F44F84B}> #<SB-THREAD:MUTEX "World Lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>> T NIL)
7: (SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT NIL TEST::MAIN-WINDOW (:METACLASS QTOOLS:WIDGET-CLASS :DIRECT-SUPERCLASSES (QTOOLS:WIDGET) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/Desktop/New Folder/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") ...) #<FUNCTION (LAMBDA (CLASS SB-PCL::NAME SB-PCL::METACLASS SB-PCL::INITARGS) :IN SB-MOP:ENSURE-CLASS-USING-CLASS) {5235148B}>)
8: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
9: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<CLOSURE (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-MOP:ENSURE-CLASS) {7F183F44FA1B}> #<SB-THREAD:MUTEX "World Lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>> T NIL)
10: (SB-MOP:ENSURE-CLASS TEST::MAIN-WINDOW :METACLASS QTOOLS:WIDGET-CLASS :DIRECT-SUPERCLASSES (QTOOLS:WIDGET) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/Desktop/New Folder/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL)
11: (SB-KERNEL::CALL-WITH-DEFINING-CLASS CLASS TEST::MAIN-WINDOW #<CLOSURE (LAMBDA NIL :IN SB-PCL::REAL-LOAD-DEFCLASS) {10025E1D6B}>)
12: (TEST:MAIN)
13: (DEPLOY::CALL-ENTRY-PREPARED #<FUNCTION TEST:MAIN> #<ASDF/SYSTEM:SYSTEM "a"> #<QTOOLS:QT-PROGRAM-OP >)
14: ((LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE))
15: (UIOP/IMAGE:CALL-WITH-FATAL-CONDITION-HANDLER #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE) {1000B3C7DB}>)
16: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
17: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
18: (SB-IMPL::START-LISP)

And if I launch SBCL with --disable-debugger before the (asdf:operate etc...) step, and ran the executable, with the DEPLOY_DEBUG_BOOT variable set, i got this

==> Performing warm boot.
   -> Runtime directory is /home/hunar/BareBones/bin/
   -> Resource directory is /home/hunar/BareBones/bin/
 ==> Running boot hooks.
   -> Loading smoke module QTCORE.
   -> Loading smoke module QTGUI.
 ==> Running Qtools boot hooks.
 ==> Reloading foreign libraries.
 ==> Launching application.
Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {10025C0103}>:
  Class not found: QWidget

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SIMPLE-ERROR "Class not found: ~A" {10025E35F3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR "Class not found: ~A" {10025E35F3}>)
2: (INVOKE-DEBUGGER #<SIMPLE-ERROR "Class not found: ~A" {10025E35F3}>)
3: ((FLET "H0" :IN DEPLOY::CALL-ENTRY-PREPARED) #<SIMPLE-ERROR "Class not found: ~A" {10025E35F3}>)
4: (SB-KERNEL::%SIGNAL #<SIMPLE-ERROR "Class not found: ~A" {10025E35F3}>)
5: (ERROR "Class not found: ~A" "QWidget")
6: (QT:FIND-QCLASS "QWidget" T)
7: (QTOOLS::CHECK-QT-SUPERCLASS-COMPATIBILITY "QWidget" (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>))
8: (QTOOLS::SETUP-WIDGET-CLASS #<QTOOLS:WIDGET-CLASS {10025E2D43}> #<CLOSURE (FLET CALL-NEXT-METHOD :IN "/home/hunar/quicklisp/dists/quicklisp/software/qtools-20200427-git/widget.lisp") {10025E348B}> QTOOLS::INIT T :NAME TEST::MAIN-WINDOW :DIRECT-SUPERCLASSES (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/BareBones/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL)
9: ((:METHOD MAKE-INSTANCE (CLASS)) #<STANDARD-CLASS QTOOLS:WIDGET-CLASS> :NAME TEST::MAIN-WINDOW :DIRECT-SUPERCLASSES (#<QTOOLS:WIDGET-CLASS QTOOLS:WIDGET>) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/BareBones/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL) [fast-method]
10: ((FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT))
11: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
12: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<CLOSURE (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT) {7F07B1EFF84B}> #<SB-THREAD:MUTEX "World Lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>> T NIL)
13: (SB-PCL::CALL-WITH-ENSURE-CLASS-CONTEXT NIL TEST::MAIN-WINDOW (:METACLASS QTOOLS:WIDGET-CLASS :DIRECT-SUPERCLASSES (QTOOLS:WIDGET) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/BareBones/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") ...) #<FUNCTION (LAMBDA (CLASS SB-PCL::NAME SB-PCL::METACLASS SB-PCL::INITARGS) :IN SB-MOP:ENSURE-CLASS-USING-CLASS) {5235148B}>)
14: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-THREAD::CALL-WITH-RECURSIVE-LOCK))
15: (SB-THREAD::CALL-WITH-RECURSIVE-LOCK #<CLOSURE (FLET SB-THREAD::WITH-RECURSIVE-LOCK-THUNK :IN SB-MOP:ENSURE-CLASS) {7F07B1EFFA1B}> #<SB-THREAD:MUTEX "World Lock" owner: #<SB-THREAD:THREAD "main thread" RUNNING {10025C0103}>> T NIL)
16: (SB-MOP:ENSURE-CLASS TEST::MAIN-WINDOW :METACLASS QTOOLS:WIDGET-CLASS :DIRECT-SUPERCLASSES (QTOOLS:WIDGET) :DIRECT-SLOTS NIL SB-PCL::SOURCE #S(SB-C:DEFINITION-SOURCE-LOCATION :NAMESTRING "/home/hunar/BareBones/a.lisp" :INDICES 163842) SB-PCL::SAFE-P NIL :QT-SUPERCLASS ("QWidget") :DIRECT-DEFAULT-INITARGS NIL)
17: (SB-KERNEL::CALL-WITH-DEFINING-CLASS CLASS TEST::MAIN-WINDOW #<CLOSURE (LAMBDA NIL :IN SB-PCL::REAL-LOAD-DEFCLASS) {10025E211B}>)
18: (TEST:MAIN)
19: (DEPLOY::CALL-ENTRY-PREPARED #<FUNCTION TEST:MAIN> #<ASDF/SYSTEM:SYSTEM "a"> #<QTOOLS:QT-PROGRAM-OP >)
20: ((LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE))
21: (UIOP/IMAGE:CALL-WITH-FATAL-CONDITION-HANDLER #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:RESTORE-IMAGE) {1000B3C7DB}>)
22: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
23: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
24: (SB-IMPL::START-LISP)

unhandled condition in --disable-debugger mode, quitting

I hope those are enough information to identify the problem :(

Thanks for you time, I really wish I get an answer soon

phoe commented 3 years ago

Hey - I'll try to spend some time on this today. @hunar1997 mind if I poke you via some sort of direct messenger for better communication?

hunar1997 commented 3 years ago

I'm very sorry @phoe I was extremely busy and didn't even open github to see the notifications Direct messaging would be great if I had enough time, but It's most likely that we are in different timezones and I work 10hours a day :(

But first of all, is my simple example also failing for you? if yes then a communication wouldn't be necessary (i think) I think it doesn't need any preparation, I (booted into a live linux - installed sbcl - followed the instructions) and there was the error message

charles-rs commented 2 years ago

bump on this, I had an application which deployed fine with no opengl, and then added opengl, and got an error.

Oddly enough, when I try your small example i get an error that the shared object doesn't exist, when it very much does.

Edit: I've tried building Shinmera's halftone, and I get the same error. I wonder if this is some kind of setup issue?

phoe commented 2 years ago

I no longer have a windows machine to test on, sadly - I don't think I can be of good help at the moment.

charles-rs commented 2 years ago

i'm actually on ubuntu, sbcl version 2.1.1.debian what is confusing to me is that the boot LOOKS like QGLWidget should be there ==> Performing warm boot. -> Runtime directory is /home/charles/common-lisp/critterworld/bin/ -> Resource directory is /home/charles/common-lisp/critterworld/bin/ ==> Running boot hooks. -> Loading smoke module QTCORE. -> Loading smoke module QTGUI. -> Loading smoke module QTOPENGL. ==> Running Qtools boot hooks. ==> Reloading foreign libraries. -> Loading foreign library #. ==> Launching application. ==> Encountered unhandled error: Class not found: QGLWidget ==> Running quit hooks.

so it loads QTOPENGL through smoke, and then i also have the cl-opengl dependency which is what I assume the foreign library is.