1

我想将应用程序与Ceramic捆绑在一起。我可以用它运行应用程序。错误出现在:

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

它运行...</p>

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)"

和崩溃:

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]

但是,日志错误,回溯根本不包含太多信息。有没有办法要求更多?

我做了一个mkdir build/确定。

[![image][1]][1]
(来源:toile-libre.org


鉴于 coredump 的回答:

我从 Ceramic:bundle 的源代码 (with M-.) 中找到对 的调用uiop:run-process,我添加了两个参数并包裹了一个多值绑定:

(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))))

并再次运行构建命令:


    ------------ 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...

所以似乎构建找不到我的组件“weblocks-todomvc”。这让我感到惊讶,因为我的 .asdf 文件编译正确,我可以运行 Ceramic 窗口,...</p>


鉴于此问题下的评论,我通过添加使 trivial-build 加载我的包,(format nil "(load #p\"/home/vince/projets/weblocks-todomvc/weblocks-todomvc.asd/\"")trivial-build:load-and-build-code得到不同的堆栈跟踪:


    ------------ 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
4

1 回答 1

3

你需要:

  • 经过:ignore-error-status t
  • 定义您希望如何检索错误消息:error-output(例如:lines

然后,run-program不会发出错误信号,但您必须检查错误状态(第三个值),并打印/检查错误消息(第二个值)。

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
于 2017-09-13T16:03:13.927 回答