[Openmcl-devel] standalone application hang on error
Michael Maul
mike.maul at gmail.com
Tue Mar 4 18:59:59 PST 2014
Okay well I probably shouldn't have tried to build an image from
inside slime, with a non stock image using quicklisp to load my
system.
That said the standalone application still doesn't seem to be adhering
to :quit or :quit-quietly :error-handler parameter values, it places
me in the listener on error.
As part of sorting out my issue I made this handy little helper.
(also if anyone want to reproduce my current issue, you can use this
to duplicate my application build)
;; make.lisp
;; Standalone application builder helper for Clozure Common Lisp
;; ccl64 -l ~/.lisp/make.lisp -- <package dir> <package-name> <init function>
;; <package dir> is spected to contain a system definition of
;; <package name>.asd
(require 'asdf)
(if (= 3 (length CCL::*UNPROCESSED-COMMAND-LINE-ARGUMENTS*))
(progn
(defconstant app-pathname
(make-pathname :directory
(elt CCL::*UNPROCESSED-COMMAND-LINE-ARGUMENTS* 0)))
(defconstant app (elt CCL::*UNPROCESSED-COMMAND-LINE-ARGUMENTS* 1))
(defconstant initfn (elt CCL::*UNPROCESSED-COMMAND-LINE-ARGUMENTS* 2))
(setf asdf:*central-registry* '(*default-pathname-defaults*
(directory-namestring app-pathname)))
(asdf:operate 'asdf:load-op (intern app))
(ccl:save-application (merge-pathnames app-pathname
(make-pathname :name app))
:toplevel-function
(find-symbol (string-upcase initfn)
(string-upcase app))
:error-handler :quit-quietly :mode #o644
:prepend-kernel t))
(format t "make.lisp <pkgdir> <package name> <init function>~%")
)
On Tue, Mar 4, 2014 at 2:36 PM, Michael Maul <mike.maul at gmail.com> wrote:
> I'm having an issue where a saved application hangs (does not return,
> does not respond to break) it does this if there is an error
> condition.
>
> To illustrate below is code that will reproduce the problem
>
> My platform
> Linux pos 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013
> x86_64 x86_64 x86_64 GNU/Linux
> Version 1.9-dev-r15611M-trunk (LinuxX8664)
>
> ;;;; Load system and save application
> (ql:quickload :myapp)
> (ccl:save-application "~/quicklisp/local-projects/myapp/myapp"
> :toplevel-function #'myapp::init :error-handler :quit :mode #o644
> :prepend-kernel t)
>
>
> ;;;; log-parser.asd ;;;
> (asdf:defsystem #:myapp
> :serial t
> :components ((:file "package")
> (:file "myapp" )
> ))
>
> ;;;; package.lisp ;;;;
> (defpackage #:myapp
> (:use :cl)
> (:export :init))
>
> ;;; myapp.lisp ;;;;
> (in-package :myapp)
> (defun mymain (a)
> (format t "mymain ~a~%" a)
> ;; ERROR BEGIN
> (elt () 1)
> ;; ERROR END
> )
>
> (defun init ()
> (format t "myapp ~a~%" ccl::*command-line-argument-list*)
> (mymain (elt ccl::*command-line-argument-list* 0))
> (ccl:quit)
> )
More information about the Openmcl-devel
mailing list