Accept one filename in make-host-2.sh to compile just that

The use case is that after an attempted parallel compilation that crashed,
you can restart a compile for any individual file. The compile-for-effect-only
flag allows rapdily skipping through all files preceding the requested one,
any of which may have been prerequisites for actually compiling.
This commit is contained in:
Douglas Katzman 2019-11-10 13:30:53 -05:00
parent e79e7f6799
commit 6849f8c406
3 changed files with 37 additions and 16 deletions

View file

@ -47,6 +47,14 @@ rm -f output/after-xc.core
# the only disadvantage seems to be the extra time required to reload
# the fasl files into the new host Lisp, and that doesn't seem to be
# an enormously important disadvantage, either.)
if [ $# -gt 0 ]
then
files=\'\(\"$1\"\) # FIXME: create string-quoted list of each arg individually
echo //compiling $files
echo '(defvar *compile-files* '${files}')(load "make-host-2.lisp")' | $SBCL_XC_HOST
exit
fi
echo //running cross-compiler to create target object files
echo '(load "loader.lisp") (load-sbcl-file "make-host-2.lisp")' | $SBCL_XC_HOST

View file

@ -145,18 +145,31 @@
(sb-cold::exit-process 1))))
(values))))
;;; Actually compile
(let ((sb-xc:*compile-print* nil))
(if (make-host-2-parallelism)
(funcall 'parallel-make-host-2 (make-host-2-parallelism))
(let ((total
(count-if (lambda (x) (not (find :not-target (cdr x))))
(get-stems-and-flags 2)))
(n 0)
(sb-xc:*compile-verbose* nil))
(with-math-journal
(do-stems-and-flags (stem flags 2)
(unless (position :not-target flags)
(format t "~&[~D/~D] ~A" (incf n) total (stem-remap-target stem))
(target-compile-stem stem flags)
(terpri)))))))
;;; See whether we're in individual file mode
(cond
((boundp 'cl-user::*compile-files*)
(let ((files
(mapcar (lambda (x) (concatenate 'string "src/" x))
(symbol-value 'cl-user::*compile-files*))))
(with-compilation-unit ()
(do-stems-and-flags (stem flags 2)
(unless (position :not-target flags)
(let* ((*compile-for-effect-only* (not (member stem files :test #'string=)))
(sb-xc:*compile-print* (not sb-xc:*compile-print*)))
(target-compile-stem stem flags)))))))
(t
;; Actually compile
(let ((sb-xc:*compile-print* nil))
(if (make-host-2-parallelism)
(funcall 'parallel-make-host-2 (make-host-2-parallelism))
(let ((total
(count-if (lambda (x) (not (find :not-target (cdr x))))
(get-stems-and-flags 2)))
(n 0)
(sb-xc:*compile-verbose* nil))
(with-math-journal
(do-stems-and-flags (stem flags 2)
(unless (position :not-target flags)
(format t "~&[~D/~D] ~A" (incf n) total (stem-remap-target stem))
(target-compile-stem stem flags)
(terpri)))))))))

View file

@ -1340,7 +1340,7 @@
(inheritable-constraints nil :type (or null (array t 1)))
(private-constraints nil :type (or null (array t 1)))
(equality-constraints nil :type (or null (array t 1)))
;; The FOP handle of the lexical variable represented by LAMBDA-VAR
;; in the fopcompiler.
(fop-value nil)