3.8: Building images

Q 3.8-1) I get an error when I try to build an image with excl:build-lisp-image (and also with excl:generate-application) but the build process simply quits. How can I debug this error?


Q 3.8-1) I get an error when I try to build an image with excl:build-lisp-image (and also with excl:generate-application) but the build process simply quits. How can I debug this error?

A 3-8.1) Since excl:generate-application calls excl:build-lisp-image, the same answer applies to both functions.

excl:build-lisp-image spawns another Lisp to build the desired image (that is one reason why the new image does not inherit from the calling image). This new Lisp is started in a way that it will exit after an error without any user interaction. That is usually what is desired but sometimes being able to interact with the Lisp building the new image is desirable. You can do that by starting that image yourself. Here is how you do that:

1. Call excl:build-lisp-image (or excl:generate-application) with arguments (in addition to your own arguments)

:internal-debug "idout" :verbose t 

"idout" is a filename -- any filename with any valid path will do. Here is what the build-lisp-image form looks like:

(excl:build-lisp-image <image-file> 
                       :internal-debug "idout" :verbose t <your arguments>)

This causes the actual command starting the Lisp that builds the new dxl (along with other stuff) to be printed to the listener where the build-lisp-image command was issued. This example is from an SGI machine. For ease of reading, we have added linebreaks where indicated by [Added LB]:

USER(11): (build-lisp-image "foo.dxl" :internal-debug "idout" :verbose t)
; Autoloading for BUILD-LISP-IMAGE:
; Fast loading from bundle code/build.fasl.
;; Running command: cat "idout" | /tmp_mnt/net/sole/release/5.0/bin/irix62/lisp -build [Added LB]
-lsfi -lxi -o 10m -Fa -llni -B "/tmp_mnt/net/sole/release/5.0/bin/irix62/files.ebu" [Added LB]
-v -c "/tmp_mnt/net/sole/release/5.0/bin/irix62/acl503.epll" [Added LB]
-FF -u...Loading /tmp_mnt/net/sole/release/5.0/bin/irix62/libacl503.so.
Mapping /tmp_mnt/net/sole/release/5.0/bin/irix62/acl503.epll.
Initial generation spread = 1

The command is everything after the | through the ...Loading. (We did not put in an added linebreak at the end of the command to emphasize that printing after the command will likely not have a linebreak.)

Also generated (by the :internal-debug argument) is the file "idout" which contains the Lisp forms passed to the spawned Lisp. It looks like:

(COMMON-LISP:SETQ EXCL::*BATCH-MODE* COMMON-LISP:NIL) 
(COMMON-LISP:SETQ EXCL::*BREAK-HOOK* #'EXCL::EXIT-ON-ERROR-HOOK) 
(EXCL:SET-CASE-MODE :CASE-INSENSITIVE-UPPER) (COMMON-LISP:FORCE-OUTPUT) 
(COMMON-LISP:PROGN (COMMON-LISP:SETQ EXCL::*STORE-DOCUMENTATION* COMMON-LISP:NIL) 
(COMMON-LISP:SETQ EXCL:*RECORD-SOURCE-FILE-INFO* COMMON-LISP:NIL) 
(COMMON-LISP:SETQ EXCL:*LOAD-LOCAL-NAMES-INFO* COMMON-LISP:NIL) 
[...]

The first two lines (which should be displayed in bold) tell the Lisp to exit on errors. The remaining lines depend on the arguments passed and may be different when you run build-lisp-image (or generate-application).

You are now ready for the next step. Presumably, the failure you wished to debug has occurred but ignore that for now.

2. In a shell (or better, an emacs shell buffer) start the build image by executing the command line identified above (do not add the linebreaks which are here for ease of reading only):

MYMACHINE> /tmp_mnt/net/sole/release/5.0/bin/irix62/lisp -build [Added LB]
-lsfi -lxi -o 10m -Fa -llni -B "/tmp_mnt/net/sole/release/5.0/bin/irix62/files.ebu" [Added LB]
-v -c "/tmp_mnt/net/sole/release/5.0/bin/irix62/acl503.epll" [Added LB]
-FF -u

This will bring up a Lisp and you should get a prompt. Start evaluating the forms in idout skipping the first two. That is, do not evaluate these:

(COMMON-LISP:SETQ EXCL::*BATCH-MODE* COMMON-LISP:NIL)
(COMMON-LISP:SETQ EXCL::*BREAK-HOOK* #'EXCL::EXIT-ON-ERROR-HOOK) 

but evaluate the forms after those two, like:

USER(1): (EXCL:SET-CASE-MODE :CASE-INSENSITIVE-UPPER) USER(2): (COMMON-LISP:FORCE-OUTPUT) 

When you get to the form that causes the problem, you should get a error prompt and can do a :zoom etc.


© Copyright 1998, Franz Inc., Berkeley, CA.  All rights reserved.
$Revision: 1.1.2.7 $