;;;; -*- coding: utf-8; fill-column: 78 -*-
+changes relative to sbcl-1.1.2:
+ * bug fix: fasls are now once again directly executable (on platforms
+ supporting shebang lines, with a suitably-installed sbcl).
+
changes in sbcl-1.1.2 relative to sbcl-1.1.1:
* notice: System requirements for SBCL on Microsoft Windows: Windows NT 5.1
or newer (Windows XP, Server 2003) is required. Support for Windows 2000
;;; Returns T if the stream is a binary input stream with a FASL header.
(defun fasl-header-p (stream &key errorp)
- (unless (member (stream-element-type stream) '(character base-char))
+ (unless (and (member (stream-element-type stream) '(character base-char))
+ ;; give up if it's not a file stream, or it's an
+ ;; fd-stream but it's either not bivalent or not
+ ;; seekable (doesn't really have a file)
+ (or (not (typep stream 'file-stream))
+ (and (typep stream 'fd-stream)
+ (or (not (sb!impl::fd-stream-bivalent-p stream))
+ (not (sb!impl::fd-stream-file stream))))))
(let ((p (file-position stream)))
(unwind-protect
(let* ((header *fasl-header-string-start-string*)
use_test_subdirectory
tmpscript=$TEST_FILESTEM.lisp-script
+tmpfasl=$TEST_FILESTEM.lisp-fasl
tmpout=$TEST_FILESTEM.lisp-out
tmperr=$TEST_FILESTEM.lisp-err
exit $EXIT_LOSE
fi
echo '(write-line "Ok!")' | run_sbcl --script 1>$tmpout 2>$tmperr
-check_status_maybe_lose "--script exit status script from stdin" $? 0 "(ok)"
+check_status_maybe_lose "--script exit status from stdin" $? 0 "(ok)"
if [ -s $tmperr ] || [ "Ok!" != `cat $tmpout` ]
then
echo "--script unexpected error output"
exit $EXIT_LOSE
fi
-rm -f $tmpscript $tmpout $tmperr
+# automatically executing fasls
+#
+# this test is fragile, with its SBCL_HOME hack to get the shebang
+# line in the fasl to find the right core, and also is unlikely to
+# work with that mechanism on Windows.
+echo '(format t "Hello, Fasl~%")' > $tmpscript
+run_sbcl --eval "(compile-file \"$tmpscript\" :output-file \"$tmpfasl\")" </dev/null >/dev/null
+chmod +x $tmpfasl
+SBCL_HOME=$(dirname $SBCL_CORE) ./$tmpfasl >$tmpout 2>$tmperr
+check_status_maybe_lose "--script exit status from fasl" $? 0 "(ok)"
+if [ -s $tmperr ] || [ "Hello, Fasl" != "`cat $tmpout`" ]
+then
+ echo "--script from fasl unexpected output"
+ exit $EXIT_LOSE
+fi
+
+rm -f $tmpscript $tmpout $tmperr $tmpfasl
exit $EXIT_TEST_WIN