Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
4f48c6cb by Raymond Toy at 2024-08-29T07:36:36-07:00
Use os_set_sigcontext_fpu_modes to reset modes
x86-vm.lisp defines `(setf sigcontext-floating-point-modes)` to set
the modes in the sigcontext. Use this in `sigfpe-handler` to reset
trap bit for the exception that was signaled.
However, there's no implementation of `os_set_sigcontext_fpu_modes`,
so implement one in solaris-os.c.
Works somewhat better than before in that we don't resignal the
exception again when we restart. But still have problems with divide
by zero and invalid. And we're left in a weird FP trap state where we
can't read 1d300 anymore---an overflow?
- - - - -
2 changed files:
- src/code/float-trap.lisp
- src/lisp/solaris-os.c
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -481,6 +481,7 @@
(type system-area-pointer scp))
(let* ((modes (sigcontext-floating-point-modes
(alien:sap-alien scp (* unix:sigcontext)))))
+ (format t "Current modes: ~32,'0b~%" modes)
(multiple-value-bind (fop operands)
(let ((sym (find-symbol "GET-FP-OPERANDS" "VM")))
(if (fboundp sym)
@@ -503,6 +504,7 @@
;;
;; Clear out the status for any enabled traps. If we don't
;; then when we return, the exception gets signaled again.
+ #+nil
(let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
(current-x87-modes (vm::x87-floating-point-modes))
(current-sse2-modes (vm::sse2-floating-point-modes))
@@ -525,7 +527,16 @@
(setf (vm::x87-floating-point-modes) new-x87-modes))
(format t "new x87 modes: ~32,'0b~%" (vm::x87-floating-point-modes))
- (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))))))
+ (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))
+ (let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
+ (new-modes
+ (dpb (logandc2 (ldb float-exceptions-byte modes)
+ trap-bit)
+ float-exceptions-byte modes)))
+ (format t "New modes: ~32,'0b~%" new-modes)
+ (setf (sigcontext-floating-point-modes)
+ (alien:sap-alien scp (* unix:sigcontext))
+ new-modes))))))
(macrolet
((with-float-traps (name merge-traps docstring)
=====================================
src/lisp/solaris-os.c
=====================================
@@ -637,6 +637,45 @@ os_sigcontext_fpu_modes(ucontext_t *scp)
return modes;
}
+unsigned int
+os_set_sigcontext_fpu_modes(ucontext_t *scp, uint32_t modes)
+{
+ unsigned short cw, sw;
+ fpregset_t *fpr;
+ unsigned int state;
+
+ fpr = &scp->uc_mcontext.fpregs;
+
+ cw = modes & 0x3f;
+ sw = (modes >> 7) &0x3f;
+
+ DPRINTF(1, (stderr, "modes = 0x%08x\n", modes));
+ DPRINTF(1, (stderr, "cw = 0x%04x\n", cw));
+ DPRINTF(1, (stderr, "sw = 0x%04x\n", sw));
+
+ fpr->fp_reg_set.fpchip_state.state[0] = cw;
+ fpr->fp_reg_set.fpchip_state.state[1] = sw;
+
+#ifdef FEATURE_SSE2
+ /*
+ * Add in the SSE2 part, if we're running the sse2 core.
+ */
+ if (fpu_mode == SSE2) {
+ unsigned long mxcsr = modes & 0xffff;
+
+ DPRINTF(1, (stderr, "SSE2 modes = %08lx\n", mxcsr));
+ fpr->fp_reg_set.fpchip_state.mxcsr = mxcsr;
+
+ modes |= mxcsr;
+ }
+#endif
+
+ modes ^= (0x3f << 7);
+ return modes;
+}
+
+
+
boolean
os_support_sse2()
{
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4f48c6cb2fb01b3613c16d5…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/4f48c6cb2fb01b3613c16d5…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
a1a6bf10 by Raymond Toy at 2024-08-29T06:18:10-07:00
Ignore errors when setting the modes and more cleanups
When resetting the mode bits ignore any errors that might happen if
some traps are still enabled. Also, only update the exception part of
the mode bits.
Document what FPE_FLTSUB means. Make a note that the fpe code info
alist only contains the relevant info for FP traps that we're
interested in handling.
With this change, an overflow and underflow are signaled as expected
and when we restart, we don't get signaled again. But according to
the debugging prints, we do enter the sigfpe handler twice. Divide by
zero is not handled correctly, though.
More testing needed.
- - - - -
46e1190c by Raymond Toy at 2024-08-29T06:48:03-07:00
Refactor cleanup of handler a bit
Make debugging prints line up neatly. Add vars to hold the new modes
so there's less duplication in debugging prints.
Remove old code about clearing out the traps which we've replaced.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -450,11 +450,15 @@
"Signal code for FP inexact result")
(defconstant +fpe-fltinv+ 7
"Signal code for FP invalid operation")
- ;; Not sure what this means.
+ ;; On FreeBSD (and maybe other OSes), this happens when the x86
+ ;; BOUND instruction detects an index out of bounds. Linux
+ ;; apparently generates a SIGSEGV instead. See
+ ;; https://stackoverflow.com/questions/27051428/what-is-a-fpe-fltsub-subscript…
(defconstant +fpe-fltsub+ 8
"Signal code for subscript out of range")
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize")
+ ;; We only include the values that FP operations can trap on.
(defconstant +fpe-code-info-alist+
(list (cons +fpe-fltdiv+
(list 'division-by-zero float-divide-by-zero-trap-bit ))
@@ -489,50 +493,39 @@
;; This means we need to restore the fpu state ourselves.
(unwind-protect
(let ((fpe-info (second (assoc code +fpe-code-info-alist+))))
+ (format t "fpe code = ~D~%" code)
(if fpe-info
(error fpe-info
:operation fop
:operands operands)
(error _"SIGFPE code ~D not handled" code)))
;; Cleanup
+ ;;
+ ;; Clear out the status for any enabled traps. If we don't
+ ;; then when we return, the exception gets signaled again.
(let* ((trap-bit (third (assoc code +fpe-code-info-alist+)))
- (new-x87-modes (vm::x87-floating-point-modes))
- (new-sse2-modes (vm::sse2-floating-point-modes)))
+ (current-x87-modes (vm::x87-floating-point-modes))
+ (current-sse2-modes (vm::sse2-floating-point-modes))
+ (new-x87-modes
+ (dpb (logandc2 (ldb float-exceptions-byte current-sse2-modes)
+ trap-bit)
+ float-exceptions-byte current-sse2-modes))
+ (new-sse2-modes
+ (dpb (logandc2 (ldb float-exceptions-byte current-x87-modes)
+ trap-bit)
+ float-exceptions-byte current-x87-modes)))
(format t "Trap bit: ~D~%" trap-bit)
- (format t "Current modes: ~16,'0b~%" (vm::floating-point-modes))
- (format t "Current x87 modes: ~16,'0b~%" new-x87-modes)
- (format t "Current sse2 modes: ~16,'0b~%" new-sse2-modes)
- (format t "Setting sse2 modes to: ~16,'0b~%"
- (logandc2 (ldb float-exceptions-byte new-sse2-modes)
- trap-bit))
- (setf (vm::sse2-floating-point-modes)
- (logandc2 (ldb float-exceptions-byte new-sse2-modes)
- trap-bit))
- (format t "Setting x87 modes to: ~16,'0b~%"
- (logandc2 (ldb float-exceptions-byte new-x87-modes)
- trap-bit))
- (setf (vm::x87-floating-point-modes)
- (logandc2 (ldb float-exceptions-byte new-x87-modes)
- trap-bit))
-
- (format t "new x87 modes: ~16,'0b~%" (vm::x87-floating-point-modes))
- (format t "new sse2 modes: ~16,'0b~%" (vm::sse2-floating-point-modes))
- #+nil
- (progn
- ;; Clear out the status for any enabled traps. With SSE2, if
- ;; the current exception is enabled, the next FP instruction
- ;; will cause the exception to be signaled again. Hence, we
- ;; need to clear out the exceptions that we are handling here.
- (setf (ldb float-exceptions-byte new-modes) new-exceptions)
- ;;#+nil
- (progn
- (format *debug-io* "sigcontext modes: #x~4x (~A)~%"
- modes (decode-floating-point-modes modes))
- (format *debug-io* "current modes: #x~4x (~A)~%"
- (vm:floating-point-modes) (get-floating-point-modes))
- (format *debug-io* "new modes: #x~x (~A)~%"
- new-modes (decode-floating-point-modes new-modes)))
- (setf (vm:floating-point-modes) new-modes)))))))
+ (format t "Current modes: ~32,'0b~%" (vm::floating-point-modes))
+ (format t "Current x87 modes: ~32,'0b~%" current-x87-modes)
+ (format t "Current sse2 modes: ~32,'0b~%" current-sse2-modes)
+ (format t "Setting sse2 modes to: ~32,'0b~%" new-x87-modes)
+ (format t "Setting x87 modes to: ~32,'0b~%" new-sse2-modes)
+ (ignore-errors
+ (setf (vm::sse2-floating-point-modes) new-sse2-modes)
+ (setf (vm::x87-floating-point-modes) new-x87-modes))
+
+ (format t "new x87 modes: ~32,'0b~%" (vm::x87-floating-point-modes))
+ (format t "new sse2 modes: ~32,'0b~%" (vm::sse2-floating-point-modes)))))))
(macrolet
((with-float-traps (name merge-traps docstring)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/649d84d625d2d673d63685…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/649d84d625d2d673d63685…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
90296b78 by Raymond Toy at 2024-08-28T14:53:40-07:00
Revert "Fix a reader-conditional and add comments."
This reverts commit 90b41bd331fc3260dee9bf0316b4c4a1fc35449d.
- - - - -
33ea1d99 by Raymond Toy at 2024-08-28T14:54:02-07:00
Revert "For Solaris/x86, just use the sse2 mode bits."
This reverts commit 72af1c16346f042bf8d04e1aa0e9b2bd52276895.
- - - - -
15d7b1df by Raymond Toy at 2024-08-28T14:57:11-07:00
Minor cleanup of sigfpe-handler
Move computation of `traps` farther down in the function since we
don't need `traps` so early.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -92,7 +92,7 @@
(setf (x87-floating-point-modes) x87-modes)))
)
-#+(and sse2 (not (or solaris darwin)))
+#+(and sse2 (not darwin))
(progn
(defun floating-point-modes ()
;; Combine the modes from the FPU and SSE2 units. Since the sse
@@ -126,10 +126,7 @@
new-mode)
)
-;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits. Darwin
-;; doesn't use x87. Not sure about Solaris/x86, but this works better
-;; than mixing the x87 and sse2 mode bits.
-#+(and sse2 (or solaris darwin))
+#+(and sse2 darwin)
(progn
(defun floating-point-modes ()
;; Get just the SSE2 mode bits.
@@ -459,19 +456,12 @@
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize"))
-;; SIGFPE handler for Solaris/x86. For this OS, the CODE contains the
-;; information about what caused the SIGFPE signal, so use that to
-;; determine the reason for the SIGFPE.
#+(and solaris x86)
(defun sigfpe-handler (signal code scp)
(declare (ignore signal)
(type system-area-pointer scp))
(let* ((modes (sigcontext-floating-point-modes
- (alien:sap-alien scp (* unix:sigcontext))))
- (traps (logand (ldb float-exceptions-byte modes)
- (ldb float-traps-byte modes))))
-
-
+ (alien:sap-alien scp (* unix:sigcontext)))))
(multiple-value-bind (fop operands)
(let ((sym (find-symbol "GET-FP-OPERANDS" "VM")))
(if (fboundp sym)
@@ -511,7 +501,9 @@
(t
(error _"SIGFPE code ~D not handled" code)))
;; Cleanup
- (let* ((new-modes modes)
+ (let* ((traps (logand (ldb float-exceptions-byte modes)
+ (ldb float-traps-byte modes)))
+ (new-modes modes)
(new-exceptions (logandc2 (ldb float-exceptions-byte new-modes)
traps)))
#+sse2
@@ -521,7 +513,7 @@
;; will cause the exception to be signaled again. Hence, we
;; need to clear out the exceptions that we are handling here.
(setf (ldb float-exceptions-byte new-modes) new-exceptions)
- #+nil
+ ;;#+nil
(progn
(format *debug-io* "sigcontext modes: #x~4x (~A)~%"
modes (decode-floating-point-modes modes))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90b41bd331fc3260dee9bf…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/90b41bd331fc3260dee9bf…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-355-solaris-x86-fp-trap-handler at cmucl / cmucl
Commits:
6e8d4939 by Raymond Toy at 2024-08-28T07:32:02-07:00
Oops. Change `case` to `cond`
Forgot that `case` works with symbols, not numbers. Use `cond`
instead.
Also enable the debugging print, for now.
- - - - -
72af1c16 by Raymond Toy at 2024-08-28T08:38:53-07:00
For Solaris/x86, just use the sse2 mode bits.
Do the same as darwin and only use the sse2 mode bits when setting and
getting the floating point modes.
This takes care of the case when trying to restart after doing `(*
1d300 1d300)`. This used to signal the overflow again. Now it
doesn't.
- - - - -
90b41bd3 by Raymond Toy at 2024-08-28T08:44:46-07:00
Fix a reader-conditional and add comments.
Also comment out debugging prints.
- - - - -
1 changed file:
- src/code/float-trap.lisp
Changes:
=====================================
src/code/float-trap.lisp
=====================================
@@ -92,7 +92,7 @@
(setf (x87-floating-point-modes) x87-modes)))
)
-#+(and sse2 (not darwin))
+#+(and sse2 (not (or solaris darwin)))
(progn
(defun floating-point-modes ()
;; Combine the modes from the FPU and SSE2 units. Since the sse
@@ -126,7 +126,10 @@
new-mode)
)
-#+(and sse2 darwin)
+;; For Darwin and Solaris/x86, only diddle the SSE2 mode bits. Darwin
+;; doesn't use x87. Not sure about Solaris/x86, but this works better
+;; than mixing the x87 and sse2 mode bits.
+#+(and sse2 (or solaris darwin))
(progn
(defun floating-point-modes ()
;; Get just the SSE2 mode bits.
@@ -456,6 +459,9 @@
(defconstant +fpe-fltden+ 9
"Signal code for FP denormalize"))
+;; SIGFPE handler for Solaris/x86. For this OS, the CODE contains the
+;; information about what caused the SIGFPE signal, so use that to
+;; determine the reason for the SIGFPE.
#+(and solaris x86)
(defun sigfpe-handler (signal code scp)
(declare (ignore signal)
@@ -477,28 +483,28 @@
;; from the signal handler so the sigcontext is never restored.
;; This means we need to restore the fpu state ourselves.
(unwind-protect
- (case code
- (+fpe-fltdiv+
+ (cond
+ ((= code +fpe-fltdiv+)
(error 'division-by-zero
:operation fop
:operands operands))
- (+fpe-fltovf+
+ ((= code +fpe-fltovf+)
(error 'floating-point-overflow
:operation fop
:operands operands))
- (+fpe-fltund+
+ ((= code +fpe-fltund+)
(error 'floating-point-underflow
:operation fop
:operands operands))
- (+fpe-fltres+
+ ((= code +fpe-fltres+)
(error 'floating-point-inexact
:operation fop
:operands operands))
- (+fpe-fltinv+
+ ((= code +fpe-fltinv+)
(error 'floating-point-invalid-operation
:operation fop
:operands operands))
- (+fpe-fltden+
+ ((= code +fpe-fltden+)
(error 'floating-point-denormal-operand
:operation fop
:operands operands))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/f5f65ff51a6afb81fd5c97…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/f5f65ff51a6afb81fd5c97…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-352-new-compression-for-dist at cmucl / cmucl
Commits:
48cabd23 by Raymond Toy at 2024-08-27T16:18:25-07:00
Clean up usage message
We don't support `-b` and `-g` options anymore so remove them from the
usage message. Add note about `version` being optional and the
default value.
- - - - -
c21d6a97 by Raymond Toy at 2024-08-27T16:22:33-07:00
More cleanups for usage message and compression code
Remove the `-b` and `-g` options from the usage options and add `-?`.
Also don't recognize these as command-line options. Finally, remove
the code that handled the these options.
- - - - -
3a98c0ab by Raymond Toy at 2024-08-27T16:39:25-07:00
Add -C and -E options to specify compression info for sub-scripts
Use the `-C` and `-E` options to set the appropriate tar compression
option and the corresponding extension. These are set in make-dist.sh
to tell make-main-dist.sh, make-extra-dist.sh, and make-src-dist.sh
how to compress the tarball with the appropriate extension.
- - - - -
d7825bf9 by Raymond Toy at 2024-08-27T16:40:11-07:00
Remove code for old -b and -g options
These aren't used anymore so remove the code for that.
- - - - -
2b4e1278 by Raymond Toy at 2024-08-27T16:46:57-07:00
More cleanups
Forgot tell make-src-dist.sh that -C and -E are valid options. And
also forgot to supply these options when make-dist.sh calls
make-src-dist.sh.
Enforce the requirement that -C and -E are required for
make-main-dist.sh and friends.
- - - - -
4 changed files:
- bin/make-dist.sh
- bin/make-extra-dist.sh
- bin/make-main-dist.sh
- bin/make-src-dist.sh
Changes:
=====================================
bin/make-dist.sh
=====================================
@@ -114,7 +114,6 @@ fi
COMPRESS=-J
COMPRESS_EXT=xz
COMPRESS_NAME=xz
-export COMPRESS COMPRESS_EXT COMPRESS_NAME
while getopts "C:G:O:I:M:hSA:o:V:?" arg
do
@@ -198,7 +197,7 @@ fi
echo cmucl-$VERSION-$ARCH-$OS
ROOT=`dirname $0`
-GTAR_OPTS="-t ${GTAR:-gtar}"
+GTAR_OPTS="-t ${GTAR:-tar}"
EXTRA_OPTS="${GROUP:+ -G ${GROUP}} ${OWNER:+ -O ${OWNER}}"
INSTALL_OPTS="${INSTALL_DIR:+ -I ${INSTALL_DIR}}"
MANDIR="${MANDIR:+ -M ${MANDIR}}"
@@ -206,9 +205,9 @@ OPTIONS="${GTAR_OPTS} ${EXTRA_OPTS} ${INSTALL_OPTS} ${MANDIR}"
set -x
echo Creating distribution for $ARCH $OS
-$ROOT/make-main-dist.sh $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1
-$ROOT/make-extra-dist.sh $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2
+$ROOT/make-main-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS ${MANDIR} $TARGET $VERSION $ARCH $OS || exit 1
+$ROOT/make-extra-dist.sh -C $COMPRESS -E $COMPRESS_EXT $OPTIONS $TARGET $VERSION $ARCH $OS || exit 2
if [ X"$MAKE_SRC_DIST" = "Xyes" ]; then
- $ROOT/make-src-dist.sh ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION
+ $ROOT/make-src-dist.sh -C $COMPRESS -E $COMPRESS_EXT ${GTAR_OPTS} ${INSTALL_OPTS} $VERSION
fi
=====================================
bin/make-extra-dist.sh
=====================================
@@ -1,10 +1,13 @@
#!/bin/sh
usage() {
- echo "make-extra-dist.sh [-t tar] [-I destdir] [-G group] [-O owner]"
+ echo "make-extra-dist.sh -C option -E ext [-t tar] [-I destdir] [-G group] [-O owner]"
echo " -h This help"
echo " -? This help"
echo " -t tar Tar program to use"
+ echo " -C option Tar option for compressing the tarball; required."
+ echo " -E ext Extension to use for the tarball. Must be consistent with"
+ echo " -C option. Required."
echo " -I destdir Install directly to given directory instead of creating a tarball"
echo " -G group Group to use"
echo " -O owner Owner to use"
@@ -18,9 +21,11 @@ usage() {
}
GTAR=tar
-while getopts "G:O:I:t:h?" arg
+while getopts "C:E:G:O:I:t:h?" arg
do
case $arg in
+ C) COMPRESS=$OPTARG ;;
+ E) COMPRESS_EXT=$OPTARG ;;
G) GROUP="-g $OPTARG" ;;
O) OWNER="-o $OPTARG" ;;
I) INSTALL_DIR=$OPTARG ;;
@@ -31,6 +36,17 @@ done
shift `expr $OPTIND - 1`
+# -C and -E options are required
+if [ -z "$COMPRESS" ]; then
+ echo "-C option is required"
+ exit 2
+fi
+
+if [ -z "$COMPRESS_EXT" ]; then
+ echo "-E option is required"
+ exit 2
+fi
+
if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
then
usage
=====================================
bin/make-main-dist.sh
=====================================
@@ -1,11 +1,14 @@
#!/bin/sh
usage() {
- echo "make-main-dist.sh [-h?] [-t tar] [-I destdir] [-G group] [-O owner] [-M mandir]"
+ echo "make-main-dist.sh -C option -E ext [-h?] [-t tar][-I destdir] [-G group] [-O owner] [-M mandir]"
echo " target-directory version arch os"
echo " -h This help"
echo " -? This help"
echo " -t tar Tar program to use"
+ echo " -C option Tar option for compressing the tarball; required."
+ echo " -E ext Extension to use for the tarball. Must be consistent with"
+ echo " -C option. Required."
echo " -I destdir Install directly to given directory instead of creating a tarball"
echo " -G group Group to use"
echo " -O owner Owner to use"
@@ -21,9 +24,11 @@ usage() {
}
GTAR=tar
-while getopts "G:O:I:M:t:h?" arg
+while getopts "C:E:G:O:I:M:t:h?" arg
do
case $arg in
+ C) COMPRESS=$OPTARG ;;
+ E) COMPRESS_EXT=$OPTARG ;;
G) GROUP="-g $OPTARG" ;;
O) OWNER="-o $OPTARG" ;;
I) INSTALL_DIR=$OPTARG ;;
@@ -35,6 +40,17 @@ done
shift `expr $OPTIND - 1`
+# -C and -E options are required
+if [ -z "$COMPRESS" ]; then
+ echo "-C option is required"
+ exit 2
+fi
+
+if [ -z "$COMPRESS_EXT" ]; then
+ echo "-E option is required"
+ exit 2
+fi
+
if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
then
usage
=====================================
bin/make-src-dist.sh
=====================================
@@ -1,22 +1,26 @@
#!/bin/sh
usage() {
- echo "make-src-dist.sh: [-bgh] [-t gnutar] [-I destdir] version"
+ echo "make-src-dist.sh: -C option -E ext [-h?] [-t gnutar] [-I destdir] [version]"
echo " -h This help"
- echo " -b Use bzip2 compression"
- echo " -g Use gzip compression"
+ echo " -? This help"
echo " -t tar Name/path to GNU tar"
+ echo " -C option Tar option for compressing the tarball; required."
+ echo " -E ext Extension to use for the tarball. Must be consistent with"
+ echo " -C option. Required."
echo " -I destdir Install directly to given directory instead of creating a tarball"
+ echo " version The version. Defaults to the current date"
echo ""
- echo 'Create a tar ball of the cmucl sources. The tarball is named '
- echo 'cmucl-src-$version.tar.bz2 (or gz if using gzip compression)'
+ echo "This is generally called by make-dist.sh and not normally invoked by the user"
+ echo ""
+ echo "Create a tar ball of the cmucl sources."
}
-while getopts "bgh?t:I:" arg
+while getopts "C:E:h?t:I:" arg
do
case $arg in
- b) ENABLE_BZIP=-b ;;
- g) ENABLE_GZIP=-g ;;
+ C) COMPRESS=$OPTARG ;;
+ E) COMPRESS_EXT=$OPTARG ;;
t) GTAR=$OPTARG ;;
I) INSTALL_DIR=$OPTARG ;;
h | \?) usage; exit 1 ;;
@@ -25,10 +29,15 @@ done
shift `expr $OPTIND - 1`
-# If no compression given, default to gzip (on the assumption that
-# that is available everywhere.)
-if [ -z "$ENABLE_BZIP" -a -z "$ENABLE_GZIP" ]; then
- ENABLE_GZIP=-b
+# -C and -E options are required
+if [ -z "$COMPRESS" ]; then
+ echo "-C option is required"
+ exit 2
+fi
+
+if [ -z "$COMPRESS_EXT" ]; then
+ echo "-E option is required"
+ exit 2
fi
# If no version is given, default to today's date
@@ -39,15 +48,6 @@ else
fi
echo Creating source distribution
-if [ -n "$ENABLE_GZIP" ]; then
- ZIP="gzip -c"
- ZIPEXT="gz"
-fi
-if [ -n "$ENABLE_BZIP" ]; then
- ZIP="bzip2"
- ZIPEXT="bz2"
-fi
-
GTAR_OPTIONS="--exclude=.git --exclude='*.pot.~*~'"
if [ -z "$INSTALL_DIR" ]; then
# echo " Compressing with $ZIP"
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/376c4ce694508d94f9e134…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/376c4ce694508d94f9e134…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-352-new-compression-for-dist at cmucl / cmucl
Commits:
b9e0b5f5 by Raymond Toy at 2024-08-27T16:03:56-07:00
Add better usage info for make-main-dist and make-extra-dist
The usage message for make-main-dist.sh and make-extra-dist.sh were
pretty inadequate. Make it better.
- - - - -
376c4ce6 by Raymond Toy at 2024-08-27T16:10:13-07:00
Update what's actually in the main and extra tarballs
Remove the debugging `set -x` too.
- - - - -
2 changed files:
- bin/make-extra-dist.sh
- bin/make-main-dist.sh
Changes:
=====================================
bin/make-extra-dist.sh
=====================================
@@ -1,7 +1,23 @@
#!/bin/sh
+usage() {
+ echo "make-extra-dist.sh [-t tar] [-I destdir] [-G group] [-O owner]"
+ echo " -h This help"
+ echo " -? This help"
+ echo " -t tar Tar program to use"
+ echo " -I destdir Install directly to given directory instead of creating a tarball"
+ echo " -G group Group to use"
+ echo " -O owner Owner to use"
+ echo ""
+ echo "This is generally called by make-dist.sh and not normally invoked by the user"
+ echo ""
+ echo "Create a tarball of the extra components for cmucl. This includes things like "
+ echo "CLX; Hemlock; CLM; contrib library not already included in the main"
+ echo "distribution; locale messages."
+ exit 1
+}
+
GTAR=tar
-set -x
while getopts "G:O:I:t:h?" arg
do
case $arg in
@@ -17,8 +33,7 @@ shift `expr $OPTIND - 1`
if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
then
- echo "Usage: $0 target-directory version arch os"
- exit 1
+ usage
fi
if [ ! -d "$1" ]
=====================================
bin/make-main-dist.sh
=====================================
@@ -1,7 +1,26 @@
#!/bin/sh
+usage() {
+ echo "make-main-dist.sh [-h?] [-t tar] [-I destdir] [-G group] [-O owner] [-M mandir]"
+ echo " target-directory version arch os"
+ echo " -h This help"
+ echo " -? This help"
+ echo " -t tar Tar program to use"
+ echo " -I destdir Install directly to given directory instead of creating a tarball"
+ echo " -G group Group to use"
+ echo " -O owner Owner to use"
+ echo " -M mandir Install manpages in this subdirectory. Default is man/man1"
+ echo ""
+ echo "This is generally called by make-dist.sh and not normally invoked by the user"
+ echo ""
+ echo "Create a tarball consisting of the main components needed to distribute"
+ echo "a binary installation of cmucl. This includes the C executable and support"
+ echo "libraries; the subsystems like Gray streams, and simple streams; external"
+ echo "formats; contribs like asdf and defsystem; manpages and READMEs."
+ exit 1
+}
+
GTAR=tar
-set -x
while getopts "G:O:I:M:t:h?" arg
do
case $arg in
@@ -18,8 +37,7 @@ shift `expr $OPTIND - 1`
if [ "$1" = "" -o "$2" = "" -o "$3" = "" -o "$4" = "" ]
then
- echo "Usage: $0 target-directory version arch os"
- exit 1
+ usage
fi
if [ ! -d "$1" ]
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/c653d8ef9fd9f92e5a9739…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/c653d8ef9fd9f92e5a9739…
You're receiving this email because of your account on gitlab.common-lisp.net.