changeset 15: |
17a70918610c |
child: |
3491c1d1815d |
author: |
ellis <ellis@rwest.io> |
date: |
Mon, 27 Nov 2023 22:33:13 -0500 |
permissions: |
-rwxr-xr-x |
description: |
scripts |
1 ;;; scripts/check.lisp --- check host features 3 ;; This script runs some basic checks to ensure the host is ready for 9 (asdf:load-asd #P"~/dev/comp/core/lisp/std/std.asd") 10 (asdf:load-system :std) 12 (defpackage :infra/scripts/check 13 (:use :cl :std :sb-alien) 17 (in-package :infra/scripts/check) 19 (defvar *results* (make-hash-table :size 32 :test 'equal)) 21 (defparameter *library-path* (ld-library-path-list)) 22 (defparameter *exec-path* (exec-path-list)) 24 (defun get-result (k) (gethash k *results*)) 26 (defun push-result (k &optional v) 27 (setf (gethash k *results*) v)) 29 (defun check-for-shared-lib (name) 30 (if-let ((lib (ignore-errors (load-shared-object (format nil "lib~a.so" name))))) 32 (push-result name lib) 33 (unload-shared-object lib)) 36 (defun check-for-bin (name) 39 (defun check-for-src (name) 42 (defun check-system () 43 (destructuring-bind (lisp version features) 44 (my-lisp-implementation) 45 (push-result "lisp" (list lisp version features) 46 #-sbcl (push-result "lisp")))) 49 (push-result "shell" (sb-posix:getcwd))) 51 (defun check-display () 52 (push-result "display")) 60 (defmethod print-object ((object hash-table) stream) 61 (format stream "#HOST-FEATURES{~{~{~%(~a . ~a)~}~^ ~}}" 62 (loop for k being the hash-keys of *results* 68 "Check the host for required features." 70 (setq *library-path* (ld-library-path-list) 71 *exec-path* (exec-path-list)) 73 (debug! (format nil "LD_LIBRARY_PATH: ~A~%" *library-path*)) 74 (debug! (format nil "PATH: ~A~%" *exec-path*)) 78 (check-for-bin "sbcl") 79 (check-for-bin "rustc") 80 (check-for-bin "clang") 82 (check-for-bin "emacs") 87 (check-for-bin "podman") 89 (check-for-src "core") 91 (check-for-shared-lib "rocksdb") 92 (check-for-shared-lib "uring") 93 (check-for-shared-lib "btrfs") 94 (check-for-shared-lib "btrfsutil") 95 (check-for-shared-lib "tree-sitter") 97 (check-for-shared-lib "sbcl") ;; requires compiling sbcl as shared_lib 98 (check-for-shared-lib "gtk-4") 99 (check-for-shared-lib "blake3") 100 (check-for-shared-lib "k") 101 (check-for-shared-lib "cbqn")