Newer
Older
":" ; : "-*- Lisp -*-" \
; sbcl --load test.lisp
; ../single-threaded-ccl/stccl --load test.lisp
;; (*) echo "Unrecognized/unsupported Lisp: $1" ; exit 42
Francois-Rene Rideau
committed
;; esac 2>&1 | tee foo ; exit
Francois-Rene Rideau
committed
Francois-Rene Rideau
committed
(setf *load-verbose* nil
*load-print* nil
*compile-verbose* nil
*compile-print* nil)
(ignore-errors (require "asdf"))
Francois-Rene Rideau
committed
(pushnew :DBG *features*)
Francois-Rene Rideau
committed
(defmacro DBG (tag &rest exprs)
"simple debug statement macro:
outputs a tag plus a list of source expressions and their resulting values, returns the last values"
(let ((res (gensym))(f (gensym)))
`(let ((,res))
(flet ((,f (fmt &rest args) (apply #'format *trace-output* fmt args)))
(,f "~&~A~%" ,tag)
,@(mapcan
#'(lambda (x)
`((,f "~& ~S => " ',x)
(,f "~{~S~^ ~}~%" (setf ,res (multiple-value-list ,x)))))
exprs)
(apply 'values ,res)))))
Francois-Rene Rideau
committed
(load-system :asdf)
(setf *load-verbose* t
*load-print* t
*compile-verbose* t
Francois-Rene Rideau
committed
*compile-print* t
*asdf-verbose* t)
Francois-Rene Rideau
committed
(defun print-backtrace (out)
"Print a backtrace (implementation-defined)"
(declare (ignorable out))
#+clozure (let ((*debug-io* out))
(ccl:print-call-history :count 100 :start-frame-number 1)
(finish-output out))
#+sbcl
(sb-debug:backtrace most-positive-fixnum out))
Francois-Rene Rideau
committed
;;#+(or)
(trace
Francois-Rene Rideau
committed
traverse ;; traverse-component
make-parallel-plan
Francois-Rene Rideau
committed
;; run-in-background-p
;; mark-as-done
;; process-return process-result ;; action-result-file
;; input-files output-files file-write-date
;; component-operation-time mark-operation-done
;; call-queue/forking make-communicating-subprocess
;; perform perform-with-restarts
;; compile-file load
operate call-recording-breadcrumbs perform-plan
)
;;#+clisp (trace posix-wexitstatus posix-wait)
Francois-Rene Rideau
committed
Francois-Rene Rideau
committed
(defvar *fare* (asdf::user-homedir))
(defun subnamestring (base sub)
(namestring (asdf::subpathname base sub)))
Francois-Rene Rideau
committed
(block nil
(handler-bind ((error #'(lambda (condition)
(format t "~&ERROR:~%~A~%" condition)
(print-backtrace *standard-output*)
(format t "~&ERROR:~%~A~%" condition)
(finish-output)
(return))))
Francois-Rene Rideau
committed
(asdf:parallel-load-system
:exscribe :verbose t
;;:force :all
:breadcrumbs-to "/tmp/breadcrumbs.text")
Francois-Rene Rideau
committed
(funcall (find-symbol "PROCESS-COMMAND-LINE" "EXSCRIBE")
Francois-Rene Rideau
committed
`("-I" ,(subnamestring *fare* "fare/www/")
"-o" "-" "-H" ,(subnamestring *fare* "fare/www/index.scr")))))
Francois-Rene Rideau
committed
(format t "~&~S~%" (asdf::implementation-identifier))
(format t "~&Compiled with as many as ~D forked subprocesses~%" *max-actual-forks*)
Francois-Rene Rideau
committed
(asdf::posix-exit 0)