76 lines
3.4 KiB
Common Lisp
76 lines
3.4 KiB
Common Lisp
;; Deep compiler audit - compile every file with full warnings
|
|
(load "~/quicklisp/setup.lisp")
|
|
(ql:register-local-projects)
|
|
(ql:quickload :cl-tty :silent t)
|
|
(ql:quickload :fiveam :silent t :error t)
|
|
(ql:quickload :bordeaux-threads :silent t)
|
|
|
|
(defparameter *results* '())
|
|
|
|
(defun audit-compile (file)
|
|
(let* ((warnings '())
|
|
(notes '())
|
|
(style-warnings '()))
|
|
;; Redirect compiler output during compilation
|
|
(handler-bind
|
|
((style-warning
|
|
(lambda (c) (push (format nil " STYLE-WARNING: ~a" c) style-warnings) (muffle-warning c)))
|
|
(warning
|
|
(lambda (c) (push (format nil " WARNING: ~a" c) warnings) (muffle-warning c)))
|
|
(sb-ext:compiler-note
|
|
(lambda (c) (push (format nil " NOTE: ~a" c) notes) (muffle-warning c))))
|
|
(multiple-value-bind (fasl warn-p fail-p)
|
|
(compile-file file :print nil :verbose nil)
|
|
(delete-file fasl)
|
|
(push (list file warn-p fail-p (reverse style-warnings) (reverse warnings) (reverse notes))
|
|
*results*)))))
|
|
|
|
(let ((files
|
|
'("backend/classes.lisp" "backend/package.lisp"
|
|
"backend/detection.lisp" "backend/simple.lisp" "backend/modern.lisp"
|
|
"layout/layout.lisp"
|
|
"src/components/container-package.lisp"
|
|
"src/components/dialog-package.lisp" "src/components/dialog.lisp"
|
|
"src/components/dirty.lisp"
|
|
"src/components/input-package.lisp" "src/components/input.lisp"
|
|
"src/components/keybindings.lisp"
|
|
"src/components/markdown-package.lisp" "src/components/markdown.lisp"
|
|
"src/components/mouse-package.lisp" "src/components/mouse.lisp"
|
|
"src/components/package.lisp" "src/components/render.lisp"
|
|
"src/components/scrollbox.lisp" "src/components/select-package.lisp"
|
|
"src/components/select.lisp" "src/components/slot-package.lisp"
|
|
"src/components/slot.lisp" "src/components/tabbar.lisp"
|
|
"src/components/text-input.lisp" "src/components/text.lisp"
|
|
"src/components/textarea.lisp" "src/components/theme.lisp"
|
|
"src/components/box.lisp"
|
|
"src/rendering/framebuffer.lisp"
|
|
"demo.lisp"
|
|
"backend/modern-tests.lisp" "backend/tests.lisp"
|
|
"layout/tests.lisp"
|
|
"src/components/box-tests.lisp" "src/components/dirty-tests.lisp"
|
|
"src/components/render-tests.lisp" "src/components/theme-tests.lisp"
|
|
"src/components/input-tests.lisp"
|
|
"tests/scrollbox-tabbar-tests.lisp" "tests/select-tests.lisp"
|
|
"tests/markdown-tests.lisp" "tests/dialog-tests.lisp"
|
|
"tests/mouse-tests.lisp" "tests/slot-tests.lisp"
|
|
"tests/framebuffer-tests.lisp")))
|
|
(dolist (f files)
|
|
(if (probe-file f)
|
|
(audit-compile f)
|
|
(format t "~&SKIP (not found): ~a~%" f))))
|
|
|
|
(format t "~&~%=== COMPILER AUDIT RESULTS ===~%")
|
|
(dolist (r (reverse *results*))
|
|
(destructuring-bind (file warn-p fail-p style-warnings warnings notes) r
|
|
(format t "~&~a~%" file)
|
|
(format t " warn=~a fail=~a" warn-p fail-p)
|
|
(when notes (format t " (~d notes)" (length notes)))
|
|
(when style-warnings (format t " (~d style-warnings)" (length style-warnings)))
|
|
(when warnings (format t " (~d warnings)" (length warnings)))
|
|
(format t "~%")
|
|
(dolist (s style-warnings) (format t "~a~%" s))
|
|
(dolist (w warnings) (format t "~a~%" w))))
|
|
|
|
(format t "~%=== DONE ===~%")
|
|
(uiop:quit 0)
|