[cmucl-help] error in compile-file?

Pascal J. Bourguignon pjb at informatimago.com
Sat Apr 11 22:46:34 UTC 2015


Raymond Toy <toy.raymond at gmail.com> writes:

>>>>>> "Pascal" == Pascal J Bourguignon <pjb at informatimago.com> writes:
>
>     Pascal> I get this following problem both in cmucl-20d and cmucl-20f, binary
>     Pascal> release; (I've not tested other versions).  The backtrace indicates that
>     Pascal> the assertion fails when closing the newly compiled fasl file.
>
>     Pascal> What would be the problem?
>
>
>     Pascal> To load "com.informatimago.common-lisp":
>     Pascal>   Load 1 ASDF system:
>     Pascal>     com.informatimago.common-lisp
>     Pascal> ; Loading "com.informatimago.common-lisp"
>     Pascal> ..................................................
>     Pascal> [package com.informatimago.common-lisp.cesarum.dfa].
>     Pascal> .....
>
> Exactly what package are you loading? Can I get it from quicklisp?

(ql:quickload :com.informatimago.common-lisp)

However, it seems that it works nicely when evaluating that from the
REPL.  It's only when run from my rc file that it fails.

~/.cmucl-init.lisp contains:


(load (merge-pathnames
       (make-pathname :directory '(:relative "RC") :name "COMMON" :type "LISP"
                      :case :common)
       (user-homedir-pathname)
       nil))


~/rc/common.lisp contains:

;;; comments …  and then:

(in-package "COMMON-LISP-USER")

;;;----------------------------------------------------------------------
;;;
;;; Clean the packages imported into COMMON-LISP-USER:
;;;


(mapc (lambda (package) (unuse-package package "COMMON-LISP-USER"))
      (set-difference
       (copy-seq (package-use-list "COMMON-LISP-USER"))
       (delete nil (list ;; A list of all the "CL" packages possible:
                    (find-package "COMMON-LISP")
                    (find-package "IMAGE-BASED-COMMON-LISP")))))


(setf *print-circle* t
      *print-length* nil
      *print-level*  nil
      *print-lines*  nil
      *print-right-margin* 110)

#+swank
(setq *debugger-hook* (let ((old-debugger-hook *debugger-hook*))
                        (defun trace-error-debugger-hook (condition me-or-my-encapsulation)
                          (format *trace-output* "~A~%" condition)
                          (funcall old-debugger-hook condition me-or-my-encapsulation))))



(declaim (optimize (safety 3) (debug 3) (space 0) (speed 0)))



;;;----------------------------------------------------------------------
;;;
;;; COM.INFORMATIMAGO.PJB
;;;

(defpackage "COM.INFORMATIMAGO.PJB"
  (:nicknames "PJB")
  (:use "COMMON-LISP")
  (:shadow "USER-HOMEDIR-PATHNAME" "MAKE-PATHNAME" "TRANSLATE-LOGICAL-PATHNAME")
  (:export "LIST-DIRECTORIES"   "GET-DIRECTORY"
           "LIST-LOGICAL-HOSTS" "DEFINE-LOGICAL-HOST-TRANSLATIONS"
           "START-DRIBBLE"
           "DEFAUTOLOAD"
           "HOSTNAME"
           "SCHEME"
           "*INP*" "*OUT*"
           "SELF"
           "IT" "THIS" "THAT"
           "THEM" "THESE" "THOSE"
           "IS" "WAS" "WERE"))
(in-package "COM.INFORMATIMAGO.PJB")


;;;----------------------------------------------------------------------
;;;
;;; COM.INFORMATIMAGO.TOOLS.PATHNAME
;;;


(defun user-homedir-pathname ()
  "On MS-Windows, it's not the USER-HOMEDIR-PATHNAME."
  #+windows-target (let ((home (ccl::getenv "HOME")))
                     (if home
                         (pathname (format nil "~A\\" home))
                         #P"C:\\cygwin\\home\\pjb\\"))
  #-windows-target (cl:user-homedir-pathname))


(defun make-pathname (&key (host nil hostp) (device nil devicep) (directory nil directoryp)
                       (name nil namep) (type nil typep) (version nil versionp)
                       (defaults nil defaultsp) (case :local casep))
  (declare (ignorable casep))
  #+(or abcl ccl allegro)
  (labels ((localize (object)
             (typecase object
               (list   (mapcar (function localize) object))
               (string (string-downcase object))
               (t      object)))
           (parameter (indicator key value)
             (when indicator
               (list key (if (eql case :common)
                             (localize value)
                             value)))))
    (apply (function cl:make-pathname)
           (append (parameter hostp      :host      host)
                   (parameter devicep    :device    device)
                   (parameter directoryp :directory directory)
                   (parameter namep      :name      name)
                   (parameter typep      :type      type)
                   (parameter versionp   :version   version)
                   (parameter defaultsp  :defaults  defaults)
                   (list :case :local))))
  #-(or abcl ccl allegro)
  (apply (function cl:make-pathname)
         (append
          (when hostp      (list :host      host))
          (when devicep    (list :device    device))
          (when directoryp (list :directory directory))
          (when namep      (list :name      name))
          (when typep      (list :type      type))
          (when versionp   (list :version   version))
          (when defaultsp  (list :defaults  defaults))
          (when casep      (list :case      case)))))


;;;----------------------------------------------------------------------
;;;
;;; ASDF-CONFIGURATION
;;;

(let ((asdf-conf-path (merge-pathnames
                       (make-pathname :directory '(:relative ".config" "common-lisp")
                                      :name "asdf-output-translations"
                                      :type "conf"
                                      :case :local
                                      :defaults (user-homedir-pathname))
                       (user-homedir-pathname) nil))
      (common-path *load-truename*))
  (when (or (not (ignore-errors (probe-file asdf-conf-path)))
            (null (file-write-date asdf-conf-path))
            (and common-path
                 (or (null (file-write-date common-path))
                     (< (file-write-date asdf-conf-path)
                        (file-write-date common-path)))))
    (ensure-directories-exist asdf-conf-path)
    (with-open-file (asdfconf asdf-conf-path
                              :direction :output
                              :if-does-not-exist :create
                              :if-exists nil
                              :external-format :default)
      (write-string ";; -*- mode:lisp -*-" asdfconf)
      (print '(:output-translations
               #-clisp :ignore-invalid-entries
               (t (:home ".cache" "common-lisp" :hostname :implementation))
               (t (:home ".cache" "common-lisp" :implementation))
               :inherit-configuration)
             asdfconf)
      (terpri asdfconf))))


;;;----------------------------------------------------------------------
;;;
;;; QuickLisp
;;;

(let ((quicklisp (merge-pathnames
                  (make-pathname :directory '(:relative "QUICKLISP")
                                  :name "SETUP"
                                  :type "LISP"
                                  :version :newest
                                  :case :common
                                  :defaults (user-homedir-pathname))
                  (user-homedir-pathname)
                  nil)))
  (if (probe-file quicklisp)
      (load quicklisp)
      (error "Please install quicklisp.  I expect it in ~S" quicklisp)))


(push #P"~/src/public/lisp/" ql:*local-project-directories*)
(ql:quickload "com.informatimago.common-lisp")

;; … and some more.


It reaches this quickload and it produces the backtrace given previously
while evaluating it.


Error in function LISP::ASSERT-ERROR:
   The assertion (ZEROP (HASH-TABLE-COUNT (C::FASL-FILE-PATCH-TABLE C::FILE))) failed.
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [CONTINUE                     ] Retry assertion.
  1: [RETRY                        ] Retry
                                     compiling #<CL-SOURCE-FILE "com.informatimago.common-lisp.cesarum" "dfa">.
  2: [ACCEPT                       ] Continue, treating
                                     compiling #<CL-SOURCE-FILE "com.informatimago.common-lisp.cesarum" "dfa">
                                     as having been successful.
  3:                                 Retry ASDF operation.
  4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the configuration.
  5: [ABORT                        ] Give up on "com.informatimago.common-lisp"   ###
  6:                                 Return NIL from load of #P"rc/common.lisp".  ###
  7:                                 Return NIL from load of "home:.cmucl-init".  ###
  8:                                 Skip remaining initializations.




The only thing that I do in rc/common.lisp that could influence an
implementation (but I don't think it should), is to unuse packages from
the CL-USER package.

Also, perhaps the optimization levels matter:
(declaim (optimize (safety 3) (debug 3) (space 0) (speed 0)))


-- 
__Pascal Bourguignon__                 http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk



More information about the cmucl-help mailing list