Skip to content

Commit

Permalink
Optionally allow building the image with POIU
Browse files Browse the repository at this point in the history
  • Loading branch information
ruricolist committed Dec 14, 2024
1 parent d8c64c7 commit 46de4b3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
21 changes: 20 additions & 1 deletion bootstrap/build0.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@
(let ((target-system (uiop:getenvp "KILN_TARGET_SYSTEM")))
(if target-system
(load-system target-system)
(kiln/image:load-all-script-systems)))
(progn
#+sbcl
(setf sb-ext:*on-package-variance* '(:warn t))
#+sbcl
(when (uiop:getenvp "KILN_POIU")
(handler-case
(progn
(sb-ext:unlock-package :sb-sys)
(let ((key (intern "DEFAULT_INTERRUPT" :sb-sys)))
(unless (fboundp key)
(export key :sb-sys)
(eval
`(defun ,key (signal)
(sb-sys:enable-interrupt signal :default)))))
(sb-ext:lock-package :sb-sys)
(load-system "poiu"))
(error (e)
(format *error-output* "Could not load POIU: ~a"
e))))
(kiln/image:load-all-script-systems))))
(finish-output *error-output*)
(uiop:quit)
2 changes: 2 additions & 0 deletions flags.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
:+kiln-no-print-version+
:+kiln-stack-size+
:+kiln-path-systems+
:+kiln-poiu+
:+kiln-quicklisp+
:+kiln-target-file+
:+kiln-target-system+
Expand All @@ -32,6 +33,7 @@
(def +kiln-no-print-version+ "KILN_NO_PRINT_VERSION")
(def +kiln-stack-size+ "KILN_STACK_SIZE")
(def +kiln-path-systems+ "KILN_PATH_SYSTEMS")
(def +kiln-poiu+ "KILN_POIU")
(def +kiln-quicklisp+ "KILN_QUICKLISP")
(def +kiln-target-file+ "KILN_TARGET_FILE")
(def +kiln-target-system+ "KILN_TARGET_SYSTEM")
Expand Down
11 changes: 10 additions & 1 deletion scripts/rebuild.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@
:long-name "tolerant"
:initial-value :false
:env-vars (list +kiln-tolerant+)
:key :tolerant)))
:key :tolerant)
(cli:make-option
:flag
:description "Use POIU"
:long-name "poiu"
:initial-value :false
:env-vars (list +kiln-poiu+)
:key :poiu)))

(def command
(cli:make-command
Expand Down Expand Up @@ -98,6 +105,8 @@
(error "Quicklisp requested but not available"))))
(when (cli:getopt opts :tolerant)
(setf (getenv +kiln-tolerant+) "1"))
(when (cli:getopt opts :poiu)
(setf (getenv +kiln-poiu+) "1"))
(let ((path (asdf:system-relative-pathname "kiln" "")))
(uiop:chdir (namestring path))
(exec "sh build.sh"))))

0 comments on commit 46de4b3

Please sign in to comment.