-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-bugs.lisp
More file actions
43 lines (37 loc) · 1.89 KB
/
Copy pathbuild-bugs.lisp
File metadata and controls
43 lines (37 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;;;; build-bugs.lisp — Compile mlisp-bugs into a compressed native binary
;;;;
;;;; Usage: sbcl --load build-bugs.lisp
;;;; Output: bin/mlisp-bugs
(require :asdf)
(let* ((here (directory-namestring (truename *load-pathname*)))
(ql-setup (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname))))
(when (probe-file ql-setup) (load ql-setup))
(pushnew (truename here) asdf:*central-registry* :test #'equal)
;; Force recompilation by deleting the ASDF output cache for this project.
;; asdf:clear-output-translations resets path mappings but leaves compiled
;; fasls in place; explicit deletion ensures source changes always take effect.
(let ((cache (merge-pathnames
(make-pathname :directory
(list :relative (format nil "~A-~A-~A"
(lisp-implementation-type)
(lisp-implementation-version)
(machine-type))))
(uiop:xdg-cache-home "common-lisp/"))))
(when (probe-file cache)
(uiop:delete-directory-tree cache :validate t :if-does-not-exist :ignore)))
(setf asdf:*compile-file-failure-behaviour* :warn)
(handler-case
(progn
(format t "~&[build] Loading mlisp-bugs via ASDF~%")
(asdf:load-system :mlisp-bugs))
(error (e)
(format *error-output* "[build] FATAL: ASDF load of mlisp-bugs failed: ~A~%" e)
(sb-ext:exit :code 1)))
(ensure-directories-exist (merge-pathnames "bin/" here))
(format t "~&[build] Compiling to ~Abin/mlisp-bugs~%" here)
(apply #'sb-ext:save-lisp-and-die
(merge-pathnames "bin/mlisp-bugs" here)
:toplevel (symbol-function (intern "MAIN" (find-package :mlisp-bugs-main)))
:executable t
:save-runtime-options t
(if (member :sb-core-compression *features*) '(:compression t) '())))