From Ceramic:bundle got uiop/run-program:subprocess-error does not find my component (and not showing much)

465 views Asked by At

I want to build an application into a bundle with Ceramic. I can run the app with it. The error arises with:

(ceramic:bundle :WEBLOCKS-TODOMVC :bundle-pathname #p"build/todomvc.tar")

it runs…

Ceramic: Compiling app...
Launch:
"/usr/local/bin/sbcl" --noinform --no-userinit --no-sysinit
 --load "/home/vince/quicklisp/setup.lisp"
 --eval "(setf *debugger-hook*
               #'(lambda (c h)
                   (declare (ignore h))
                   (uiop:print-condition-backtrace c)
                   (uiop:quit -1)))"
 --eval "(asdf:load-system :WEBLOCKS-TODOMVC)"
 --eval "(setf uiop:*image-entry-point*
               #'(lambda ()
                  (ceramic-entry::weblocks-todomvc)))"
 --eval "(uiop:dump-image #P\"/home/vince/.ceramic/working/weblocks-todomvc\"
                          :executable t
                          #+sb-core-compression :compression
                          #+sb-core-compression t)"

and crashes:

Subprocess with command "\"/usr/local/bin/sbcl\" --noinform --no-userinit --no-sysinit  --load \"/home/vince/quicklisp/setup.lisp\"  --eval \"(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (uiop:print-condition-backtrace c) (uiop:quit -1)))\" --eval \"(asdf:load-system :WEBLOCKS-TODOMVC)\" --eval \"(setf uiop:*image-entry-point* #'(lambda () (ceramic-entry::weblocks-todomvc)))\" --eval \"(uiop:dump-image #P\\\"/home/vince/.ceramic/working/weblocks-todomvc\\\" :executable t
  #+sb-core-compression :compression #+sb-core-compression t)\""
 exited with error code 255
   [Condition of type UIOP/RUN-PROGRAM:SUBPROCESS-ERROR]

However, the log error, the backtrace don't contain much information at all. Is there a way to ask for more ?

I did a mkdir build/ to be sure.

[![image][1]][1]
(source: toile-libre.org)


Given coredump's answer:

I went up in the source (with M-.) from ceramic:bundle to find the call to uiop:run-process, which I added the two parameters and wrapped around a multiple-value-bind:

(multiple-value-bind (zero one two)
    (uiop:run-program command
                  :output *standard-output*
                  :error :output
                  :error-output :lines
                  :ignore-error-status t)
  (format t "------------ printing error messages:")
  (log:info zero)
  (log:info one)
  (log:info two))))

and running the build command again:


    ------------ printing error messages:
     <INFO> [19:09:32] trivial-build slimeCUlUAR (boot-and-build) -
      TRIVIAL-BUILD::ZERO: NIL 
     <INFO> [19:09:32] trivial-build slimeCUlUAR (boot-and-build) -
      TRIVIAL-BUILD::ONE: ("WARNING: Setting locale failed."
                           "  Check the following variables for correct values:"
                           "  LC_CTYPE=en_US.UTF-8" "  LANG=fr_FR.UTF-8"
                           "Backtrace for: #<SB-THREAD:THREAD \"main thread\" RUNNING {10019BB4E3}>"
                           "0: ((LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE))"
                           "1: ((FLET \"THUNK\" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX))"
                           "2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (FLET \"THUNK\" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX) {7FFFF70BF27B}>)"
                           "3: (UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE) {10035ABAAB}> :PACKAGE :CL)"
                           "4: (UIOP/IMAGE:PRINT-CONDITION-BACKTRACE Component :WEBLOCKS-TODOMVC not found :STREAM NIL :COUNT NIL)"
                           "5: ((LAMBDA (COMMON-LISP-USER::C COMMON-LISP-USER::H)) 
                              Component :WEBLOCKS-TODOMVC not found #<unused argument>)"
                           "6: (SB-DEBUG::RUN-HOOK *DEBUGGER-HOOK* 
                             Component :WEBLOCKS-TODOMVC not found)"
                           "7: (INVOKE-DEBUGGER 
                               Component :WEBLOCKS-TODOMVC not found)"
                           "8: (ERROR ASDF/FIND-SYSTEM:MISSING-COMPONENT :REQUIRES :WEBLOCKS-TODOMVC)"
                           "9: ((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP :WEBLOCKS-TODOMVC) [fast-method]"
                           "10: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP :WEBLOCKS-TODOMVC)"
                           "11: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))"
                           "12: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP :WEBLOCKS-TODOMVC) [fast-method]"
                           "13: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))"
                           "14: (ASDF/CACHE:CALL-WITH-ASDF-CACHE #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1001ED497B}> :OVERRIDE NIL :KEY NIL)"
                           "15: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP :WEBLOCKS-TODOMVC) [fast-method]"
                           "16: (ASDF/OPERATE:LOAD-SYSTEM :WEBLOCKS-TODOMVC)"
                           "17: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:LOAD-SYSTEM :WEBLOCKS-TODOMVC) #<NULL-LEXENV>)"
                           "18: (EVAL (ASDF/OPERATE:LOAD-SYSTEM :WEBLOCKS-TODOMVC))"
                           "19: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:LOAD . \"/home/vince/quicklisp/setup.lisp\") (:EVAL . \"(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (uiop:print-condition-backtrace c) (uiop:quit -1)))\") (:EVAL . \"(asdf:load-system :WEBLOCKS-TODOMVC)\") (:EVAL . \"(setf uiop:*image-entry-point* #'(lambda () (ceramic-entry::weblocks-todomvc)))\") (:EVAL . \"(uiop:dump-image #P\\\"/home/vince/.ceramic/working/weblocks-todomvc\\\" :executable t"
                           "  #+sb-core-compression :compression #+sb-core-compression t)\")))"
                           "20: (SB-IMPL::TOPLEVEL-INIT)"
                           "21: ((FLET \"WITHOUT-INTERRUPTS-BODY-6\" :IN SB-EXT:SAVE-LISP-AND-DIE))"
                           "22: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))"
                           "Above backtrace due to this condition:"
                           "Component :WEBLOCKS-TODOMVC not found")
      
     <INFO> [19:09:32] trivial-build slimeCUlUAR (boot-and-build) -
      TRIVIAL-BUILD::TWO: 255 
    Ceramic: Compressing...

so it seems that the build can not find my component "weblocks-todomvc". Which I find surprising because my .asdf file compiles correctly, I can run a Ceramic window,…


Given the comments under this question, I make trivial-build load my package by adding (format nil "(load #p\"/home/vince/projets/weblocks-todomvc/weblocks-todomvc.asd/\"") in trivial-build:load-and-build-code and I get a different stacktrace:


    ------------ printing error messages:
     <INFO> [21:49:12] trivial-build trivial-build.lisp (boot-and-build) -
      TRIVIAL-BUILD::ZERO: NIL 
     <INFO> [21:49:12] trivial-build trivial-build.lisp (boot-and-build) -
      TRIVIAL-BUILD::ONE: ("WARNING: Setting locale failed."
                           "  Check the following variables for correct values:"
                           "  LC_CTYPE=en_US.UTF-8" "  LANG=fr_FR.UTF-8"
                           "Backtrace for: #<SB-THREAD:THREAD \"main thread\" RUNNING {10019BB783}>"
                           "0: ((LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE))"
                           "1: ((FLET \"THUNK\" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX))"
                           "2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (FLET \"THUNK\" :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX) {7FFFF70BF66B}>)"
                           "3: (UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE) {1001EB3A2B}> :PACKAGE :CL)"
                           "4: (UIOP/IMAGE:PRINT-CONDITION-BACKTRACE 
                         #<END-OF-FILE {1001EB3473}> :STREAM NIL :COUNT NIL)"
                           "5: ((LAMBDA (COMMON-LISP-USER::C COMMON-LISP-USER::H)) 
                       #<END-OF-FILE {1001EB3473}> #<unused argument>)"
                           "6: (SB-DEBUG::RUN-HOOK *DEBUGGER-HOOK* 
                        #<END-OF-FILE {1001EB3473}>)"
                           "7: (INVOKE-DEBUGGER #<END-OF-FILE {1001EB3473}>)"
                           "8: (ERROR END-OF-FILE :STREAM #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}>)"
                           "9: (SB-IMPL::STRING-INCH #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> T NIL)"
                           "10: (SB-IMPL::FLUSH-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}>)"
                           "11: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> #<unused argument>)"
                           "12: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> #\\()"
                           "13: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> T (NIL) T)"
                           "14: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> T (NIL) NIL)"
                           "15: (READ #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}> T NIL NIL)"
                           "16: (SB-IMPL::%READ-FROM-STRING \"(load #p\\\"/home/vince/projets/weblocks-todomvc/weblocks-todomvc.asd/\\\"\" T NIL 0 NIL NIL)"
                           "17: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:LOAD . \"/home/vince/quicklisp/setup.lisp\") (:EVAL . \"(setf *debugger-hook* #'(lambda (c h) (declare (ignore h)) (uiop:print-condition-backtrace c) (uiop:quit -1)))\") (:EVAL . \"NIL\") (:EVAL . \"(load #p\\\"/home/vince/projets/weblocks-todomvc/weblocks-todomvc.asd/\\\"\") (:EVAL . \"(ql:quickload :WEBLOCKS-TODOMVC)\") (:EVAL . \"(setf uiop:*image-entry-point* #'(lambda () (ceramic-entry::weblocks-todomvc)))\") (:EVAL . \"(uiop:dump-image #P\\\"/home/vince/.ceramic/working/weblocks-todomvc\\\" :executable t"
                           "  #+sb-core-compression :compression #+sb-core-compression t)\")))"
                           "18: (SB-IMPL::TOPLEVEL-INIT)"
                           "19: ((FLET \"WITHOUT-INTERRUPTS-BODY-6\" :IN SB-EXT:SAVE-LISP-AND-DIE))"
                           "20: ((LABELS SB-IMPL::RESTART-LISP :IN SB-EXT:SAVE-LISP-AND-DIE))"
                           "Above backtrace due to this condition:"
                           "end of file on #<SB-IMPL::STRING-INPUT-STREAM {1001EB2F53}>")
      
     <INFO> [21:49:12] trivial-build trivial-build.lisp (boot-and-build) -
      TRIVIAL-BUILD::TWO: 255 


 [1]: https://i.stack.imgur.com/OxVHf.png
1

There are 1 answers

1
coredump On

You need to:

  • pass :ignore-error-status t
  • define how you want to retrieve the error messages with :error-output (e.g. :lines)

Then, run-program won't signal an error but you have to check the error status (third value), and print/inspect the error message (second value).

RUN-PROGRAM returns 3 values:
0- the result of the OUTPUT slurping if any, or NIL
1- the result of the ERROR-OUTPUT slurping if any, or NIL
2- either 0 if the subprocess exited with success status,
or an indication of failure via the EXIT-CODE of the process