From: William Harold Newman Date: Thu, 6 Jun 2002 14:08:09 +0000 (+0000) Subject: 0.7.4.15: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=f0d511130027c6878f08d619ccc92ef588d81223;p=sbcl.git 0.7.4.15: changed --noprogrammer behavior to support people building interactive cores noninteractively... ...renamed --noprogrammer to --disable-debugger ...defined SB-EXT:DISABLE-DEBUGGER and SB-EXT:ENABLE-DEBUGGER --- diff --git a/INSTALL b/INSTALL index cce955d..be9e1c4 100644 --- a/INSTALL +++ b/INSTALL @@ -48,11 +48,17 @@ This software has been built successfully on these systems: os = FreeBSD 3.4 or 4.0 host lisp = CMU CL host lisp = SBCL itself - os = OpenBSD 2.6 + os = OpenBSD 2.6, 2.7, 2.8, 2.9, and 3.0 host lisp = SBCL itself -It is known not to build under CLISP, because CLISP doesn't support -MAKE-LOAD-FORM. Reports of other systems that it works on, or help in -making it run on more systems, would be appreciated. +It is known not to build under CLISP because of (as of early June 2002) +bugs in the CLISP garbage collector, and it is known not to build under +other systems like OpenMCL because of (as of early June 2002) remaining +dependencies of SBCL bootstrapping on CMUCLisms like the representation +of BYTE. + +Reports of other systems that it works on (or doesn't work on, for +that matter), or help in making it run on more systems, would be +appreciated. CAUTION CAUTION CAUTION CAUTION CAUTION SBCL, like CMU CL, overcommits memory. That is, it diff --git a/NEWS b/NEWS index 8678221..309f2bd 100644 --- a/NEWS +++ b/NEWS @@ -1141,6 +1141,15 @@ changes in sbcl-0.7.5 relative to sbcl-0.7.4: count as they should. * bug fix: classes with :METACLASS STRUCTURE-CLASS now print correctly. (thanks to Pierre Mai) + * minor incompatible change: The --noprogrammer option is deprecated + in favor of the new name --disable-debugger option, which takes + effect at a slightly different time at startup (so that e.g. + handling of errors in --sysinit and --userinit files will be affected + differently). The SB-EXT:DISABLE-DEBUGGER and SB-EXT:ENABLE-DEBUGGER + functions have been added to allow this functionality to be controlled + from ordinary Lisp code. (ENABLE-DEBUGGER should help people like the + Debian maintainers, who might want to run non-interactive scripts to + build SBCL cores which will later be used interactively.) * minor incompatible change: The LOAD function no longer, when given a wild pathname to load, loads all files matching that pathname; instead, an error of type FILE-ERROR is signalled. diff --git a/doc/sbcl.1 b/doc/sbcl.1 index aee50e3..6844d40 100644 --- a/doc/sbcl.1 +++ b/doc/sbcl.1 @@ -270,8 +270,9 @@ options. .TP 3 .B --noinform Suppress the printing of any banner or other informational message at -startup. (This makes it easier to write Lisp programs which work in -Unix pipelines. See also the "--noprogrammer" and "--noprint" options.) +startup. (This makes it easier to write Lisp programs which work +cleanly in Unix pipelines. See also the "--noprint" and +"--disable-debugger" options.) .PP In the future, runtime options may be added to control behavior such @@ -310,9 +311,11 @@ from shell scripts. When ordinarily the toplevel "read-eval-print loop" would be executed, execute a "read-eval loop" instead, i.e. don't print a prompt and don't echo results. Combined with the --noinform runtime option, this -makes it easier to write Lisp "scripts" which work in Unix pipelines. +makes it easier to write Lisp "scripts" which work cleanly in Unix +pipelines. .TP 3 -.B --noprogrammer +.B --disable-debugger +This is equivalent to --eval '(sb-ext:disable-debugger)'. By default, a Common Lisp system tries to ask the programmer for help when it gets in trouble (by printing a debug prompt on *DEBUG-IO*). However, this is not useful behavior for a system running with no @@ -323,6 +326,8 @@ to raise an error if any input is requested from it, and we set *DEBUGGER-HOOK* to output a backtrace, then exit the process with a failure code. Because it is implemented by modifying special variables, its effects persist in .core files created by SB-EXT:SAVE-LISP-AND-DIE. +(If you want to undo its effects, see the SB-EXT:ENABLE-DEBUGGER +command.) .PP Regardless of the order in which --sysinit, --userinit, and --eval diff --git a/make.sh b/make.sh index ebbacc9..14dd17c 100755 --- a/make.sh +++ b/make.sh @@ -25,19 +25,22 @@ # even though you have stuff in your initialization files # which makes it behave in such a non-standard way that # it keeps the build from working -# "sbcl --noprogrammer" +# "sbcl --disable-debugger" # to use an existing SBCL binary as a cross-compilation host -# and tell it to handle errors as best it can by itself, -# without trying to use *DEBUG-IO* to ask for help from -# the programmer +# and tell it to handle errors as best it can by itself +# (probably by dying with an error code) instead of waiting +# endlessly for a programmer to help it out with input +# on *DEBUG-IO* # "lisp -batch" to use an existing CMU CL binary as a cross-compilation host # "lisp -noinit -batch" # to use an existing CMU CL binary as a cross-compilation host # when you have weird things in your .cmucl-init file -# Someday CLISP should work +# Someday any sufficiently ANSI Common Lisp, perhaps CLISP and/or +# OpenMCL should work # "clisp" -# but as of sbcl-0.7.1.17, it still doesn't. (SBCL's fault: too much -# unportable code!) +# "??" +# but not yet as of sbcl-0.7.4. (There are still some weird dependencies +# on idiosyncrasies of the way CMU CL implements Common Lisp.) # # FIXME: Make a more sophisticated command line parser, probably # accepting "sh make.sh --xc-host foolisp" instead of the @@ -50,6 +53,13 @@ # require a second pass, just testing at build-the-cross-compiler time # whether the cross-compilation host returns suitable values from # UPGRADED-ARRAY-ELEMENT-TYPE?) +# FIXME: --noprogrammer was deprecated in sbcl-0.7.5, replaced by +# --disable-debugger. We still use the old form here because the +# change was not preannounced, and it would be rude to make our new +# version of SBCL unbootstrappable by immediately prior versions. +# But in a year or so the --noprogrammer here can change to +# --disable-debugger (and the deprecated --noprogrammer support can +# go away completely). SBCL_XC_HOST="${1:-sbcl --noprogrammer}" export SBCL_XC_HOST echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\" diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 0e35531..8625031 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -597,6 +597,14 @@ like *STACK-TOP-HINT* and unsupported stuff like *TRACED-FUN-LIST*." ;; saving Lisp images "SAVE-LISP-AND-DIE" + ;; provided for completeness to make it more convenient + ;; to use command-line --disable-debugger functionality + ;; in oddball situations (like building core files using + ;; scripts which run unattended, when the core files are + ;; intended for interactive use) + "DISABLE-DEBUGGER" + "ENABLE-DEBUGGER" + ;; miscellaneous useful supported extensions "QUIT" diff --git a/slam.sh b/slam.sh index d62f0a1..366e0f6 100644 --- a/slam.sh +++ b/slam.sh @@ -68,7 +68,7 @@ fi # and the SBCL-vs-CMUCL dependence of --core/-core argument syntax # make it too messy to try deal with arbitrary SBCL_XC_HOST variants. # So you have no choice: -export SBCL_XC_HOST='sbcl --noprogrammer' +export SBCL_XC_HOST='sbcl --disable-debugger' # (We don't do make-host-1.sh at all. Hopefully nothing relevant has # changed.) diff --git a/src/code/cold-error.lisp b/src/code/cold-error.lisp index d35f107..4c62556 100644 --- a/src/code/cold-error.lisp +++ b/src/code/cold-error.lisp @@ -126,7 +126,7 @@ ;;; like BREAK, but without rebinding *DEBUGGER-HOOK* to NIL, so that ;;; we can use it in system code (e.g. in SIGINT handling) without -;;; messing up --noprogrammer mode (which works by setting +;;; messing up --disable-debugger mode (which works by setting ;;; *DEBUGGER-HOOK*); or for that matter, without messing up ordinary ;;; applications which try to do similar things with *DEBUGGER-HOOK* (defun %break (what &optional (datum "break") &rest arguments) diff --git a/src/code/target-signal.lisp b/src/code/target-signal.lisp index 1d99910..9ad1f36 100644 --- a/src/code/target-signal.lisp +++ b/src/code/target-signal.lisp @@ -86,7 +86,7 @@ ;;; SIGINT is handled like BREAK, except that ANSI BREAK ignores ;;; *DEBUGGER-HOOK*, but we want SIGINT's BREAK to respect it, so that -;;; SIGINT in --noprogrammer mode will cleanly terminate the system +;;; SIGINT in --disable-debugger mode will cleanly terminate the system ;;; (by respecting the *DEBUGGER-HOOK* established in that mode). (defun sigint-%break (format-string &rest format-arguments) (apply #'%break 'sigint format-string format-arguments)) diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 381a2b2..092a0cb 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -285,7 +285,6 @@ (reversed-evals nil) ; values of --eval options, in reverse order; and ; also --load options, translated into --eval (noprint nil) ; Has a --noprint option been seen? - (noprogrammer nil) ; Has a --noprogrammer option been seen? (options (rest *posix-argv*))) ; skipping program name (/show0 "done with outer LET in TOPLEVEL-INIT") @@ -338,9 +337,16 @@ ((string= option "--noprint") (pop-option) (setf noprint t)) + ;; FIXME: --noprogrammer was deprecated in 0.7.5, and + ;; in a year or so this backwards compatibility can + ;; go away. ((string= option "--noprogrammer") + (warn "treating deprecated --noprogrammer as --disable-debugger") (pop-option) - (setf noprogrammer t)) + (push '(disable-debugger) reversed-evals)) + ((string= option "--disable-debugger") + (pop-option) + (push '(disable-debugger) reversed-evals)) ((string= option "--end-toplevel-options") (pop-option) (return)) @@ -365,14 +371,6 @@ ;; user-level options are left visible to user code. (setf (rest *posix-argv*) options) - ;; Handle --noprogrammer option. We intentionally do this - ;; early so that it will affect the handling of initialization - ;; files and --eval options. - (/show0 "handling --noprogrammer option in TOPLEVEL-INIT") - (when noprogrammer - (setf *debugger-hook* 'noprogrammer-debugger-hook-fun - *debug-io* *error-output*)) - ;; Handle initialization files. (/show0 "handling initialization files in TOPLEVEL-INIT") (flet (;; If any of POSSIBLE-INIT-FILE-NAMES names a real file, @@ -449,6 +447,15 @@ ;; (classic CMU CL error message: "You're certainly a clever child.":-) (critically-unreachable "after TOPLEVEL-REPL")))) +;;; halt-on-failures and prompt-on-failures modes, suitable for +;;; noninteractive and interactive use respectively +(defun disable-debugger () + (setf *debugger-hook* 'noprogrammer-debugger-hook-fun + *debug-io* *error-output*)) +(defun enable-debugger () + (setf *debugger-hook* nil + *debug-io* *query-io*)) + ;;; read-eval-print loop for the default system toplevel (defun toplevel-repl (noprint) (/show0 "entering TOPLEVEL-REPL") @@ -505,10 +512,11 @@ (fresh-line) (prin1 result)))))))))) +;;; suitable value for *DEBUGGER-HOOK* for a noninteractive Unix-y program (defun noprogrammer-debugger-hook-fun (condition old-debugger-hook) (declare (ignore old-debugger-hook)) (flet ((failure-quit (&key recklessly-p) - (/show0 "in FAILURE-QUIT (in noprogrammer debugger hook)") + (/show0 "in FAILURE-QUIT (in --disable-debugger debugger hook)") (quit :unix-status 1 :recklessly-p recklessly-p))) ;; This HANDLER-CASE is here mostly to stop output immediately ;; (and fall through to QUIT) when there's an I/O error. Thus, @@ -530,8 +538,9 @@ ;; (Where to truncate the BACKTRACE is of course arbitrary, but ;; it seems as though we should at least truncate it somewhere.) (sb!debug:backtrace 128 *error-output*) - (format *error-output* - "~%unhandled condition in --noprogrammer mode, quitting~%") + (format + *error-output* + "~%unhandled condition in --disable-debugger mode, quitting~%") (finish-output *error-output*) (failure-quit)) (condition () @@ -552,7 +561,8 @@ ;; what that is responsible, but that it's possible at all ;; means that we should IGNORE-ERRORS here. -- WHN 2001-04-24 (ignore-errors - (%primitive print "Argh! error within --noprogrammer error handling")) + (%primitive print + "Argh! error within --disable-debugger error handling")) (failure-quit :recklessly-p t))))) ;;; a convenient way to get into the assembly-level debugger diff --git a/tests/run-tests.sh b/tests/run-tests.sh index ddd15b1..df6d40e 100644 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -19,7 +19,7 @@ # pathname, but now we take care to bind it to an absolute pathname (still # generated relative to `pwd` in the tests/ directory) so that tests # can chdir before invoking SBCL and still work. -SBCL="${1:-`pwd`/../src/runtime/sbcl --core `pwd`/../output/sbcl.core --noinform --sysinit /dev/null --userinit /dev/null --noprint --noprogrammer}" +SBCL="${1:-`pwd`/../src/runtime/sbcl --core `pwd`/../output/sbcl.core --noinform --sysinit /dev/null --userinit /dev/null --noprint --disable-debugger}" export SBCL echo /running tests on SBCL=\'$SBCL\' diff --git a/version.lisp-expr b/version.lisp-expr index c1a55f2..f6e42e6 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.7.4.14" +"0.7.4.15"