-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-admin.lisp
More file actions
47 lines (40 loc) · 1.95 KB
/
Copy pathbuild-admin.lisp
File metadata and controls
47 lines (40 loc) · 1.95 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
44
45
46
47
;;;; build-admin.lisp — Compile mlisp-admin into a compressed native binary
;;;;
;;;; Usage: sbcl --load build-admin.lisp
;;;; Output: bin/mlisp-admin
(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-admin via ASDF~%")
(asdf:load-system :mlisp-admin))
(error (e)
(format *error-output* "[build] FATAL: ~A~%" e)
(sb-ext:exit :code 1)))
(let ((out (merge-pathnames "bin/mlisp-admin" here)))
(ensure-directories-exist out)
(format t "~&[build] Compiling to ~A~%" out)
(apply #'funcall (find-symbol "SAVE-LISP-AND-DIE" :sb-ext)
out
:toplevel (find-symbol "ADMIN-MAIN" :mlisp-admin)
:executable t
:save-runtime-options t
(if (member :sb-core-compression *features*) '(:compression t) '()))))