From 0ea2298a697150c8d277eda33e3233e31d5d63ee Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Wed, 22 Nov 2023 22:45:29 +0200 Subject: [PATCH 1/4] Delete dependency on NASDF. --- nasdf/compilation-tests.lisp | 168 ------------------- nasdf/install.lisp | 306 ----------------------------------- nasdf/log.lisp | 17 -- nasdf/nasdf.asd | 18 --- nasdf/nasdf.lisp | 19 --- nasdf/package.lisp | 101 ------------ nasdf/readme.org | 53 ------ nasdf/submodules.lisp | 74 --------- nasdf/systems.lisp | 139 ---------------- nasdf/tests.lisp | 122 -------------- 10 files changed, 1017 deletions(-) delete mode 100644 nasdf/compilation-tests.lisp delete mode 100644 nasdf/install.lisp delete mode 100644 nasdf/log.lisp delete mode 100644 nasdf/nasdf.asd delete mode 100644 nasdf/nasdf.lisp delete mode 100644 nasdf/package.lisp delete mode 100644 nasdf/readme.org delete mode 100644 nasdf/submodules.lisp delete mode 100644 nasdf/systems.lisp delete mode 100644 nasdf/tests.lisp diff --git a/nasdf/compilation-tests.lisp b/nasdf/compilation-tests.lisp deleted file mode 100644 index a6cfa05..0000000 --- a/nasdf/compilation-tests.lisp +++ /dev/null @@ -1,168 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(export-always 'nasdf-compilation-test-system) -(defclass nasdf-compilation-test-system (nasdf-test-system) - ((packages - :initform '() ;; (error "Packages required") - :initarg :packages - :reader packages - :documentation "Packages to check for unbound exports. -Sub-packages are included in the check.") - (unbound-symbols-to-ignore - :initform '() - :initarg :unbound-symbols-to-ignore - :reader unbound-symbols-to-ignore - :documentation "Symbols to ignore when checking for unbound exports.") - (undocumented-symbols-to-ignore - :initform '() - :initarg :undocumented-symbols-to-ignore - :reader undocumented-symbols-to-ignore - :documentation "Symbols to ignore when checking for documentation. -Likely, slot names (these don't have native `documentation' support.")) - (:documentation "Specialized systems for compilation tests.")) -(import 'nasdf-compilation-test-system :asdf-user) - -(defun valid-type-p (type-specifier) - "Check the TYPE-SPECIFIER for being a valid type. -The logic is: -- If the type is documented as a type, then a type it is. -- Otherwise, if `typep' exits normally (with whatever return value) - when checking arbitrary value against this specifier, then - TYPE-SPECIFIER is valid. -- And if there's an error about argument types, then TYPE-SPECIFIER is - the type requiring arguments. Which means: type exists, even if - requiring arguments. -- If there's any other error raised by `typep', then TYPE-SPECIFIER is - likely not a type." - (or (documentation type-specifier 'type) - (handler-case - (progn - (typep t type-specifier) - t) - #+sbcl - (sb-kernel::arg-count-error () - t) - #+ccl - (ccl::simple-program-error (e) - (search "can't be destructured against the lambda list" (format nil "~a" e))) - #+ecl - (simple-error (e) - (or (search "Too few arguments" (format nil "~a" e)) - (not (search "not a valid type specifier" (format nil "~a" e))))) - #+clisp - (simple-error (e) - (or (search "may not be called with 0 arguments" (format nil "~a" e)) - (not (search "invalid type specification" (format nil "~a" e))))) - (error () nil)))) - -(defun list-unbound-exports (package) - (let ((result '())) - (do-external-symbols (s (find-package package) result) - (unless (or (fboundp s) - (boundp s) - (find-class s nil) - (valid-type-p s) - (and (find-package :parenscript) - (gethash s (symbol-value (find-symbol "*MACRO-TOPLEVEL*" :parenscript))))) - (push s result))))) - -(defun subpackage-p (subpackage package) - "Return non-nil if SUBPACKAGE is a sub-package of PACKAGE. -A sub-package has a name that starts with that of PACKAGE followed by a '/' separator." - (not (null - (uiop:string-prefix-p (uiop:strcat (package-name package) "/") - (package-name subpackage))))) - -(defun list-subpackages (package) - (remove-if (lambda (pkg) (not (subpackage-p pkg package))) (list-all-packages))) - -(defun list-undocumented-exports (package) - (let ((result '()) - (classes (loop for s being the external-symbol in package - when (find-class s nil) - collect s))) - (flet ((accessor-p (symbol) - "Check whether the SYMBOL is a slot accessor. -This is necessary because accessors rarely have documentation and thus -have to be excluded from the undocumented symbols list. -Uses the built-in MOP abilities of every Lisp." - (and (fboundp symbol) - (typep (symbol-function symbol) 'generic-function) - (some (lambda (class) - (ignore-errors - (typep (find-method (symbol-function symbol) '() (list (find-class class))) - '(or standard-accessor-method standard-reader-method standard-writer-method)))) - classes)))) - (do-external-symbols (s (find-package package) result) - (unless (or (some (lambda (doctype) (documentation s doctype)) - '(variable function compiler-macro setf method-combination type structure)) - (accessor-p s) - ;; Parenscript macros don't have documentation. - (and (find-package :parenscript) - (gethash s (symbol-value (find-symbol "*MACRO-TOPLEVEL*" :parenscript))))) - (push s result)))))) - -(flet ((list-offending-packages (package export-lister testing-for) - (let* ((package (find-package package))) - (delete nil - (mapcar (lambda (package) - (logger ";;; Testing ~a for ~a" package testing-for) - (let ((exports (funcall export-lister package))) - (when exports - (list package exports)))) - (cons (find-package package) (list-subpackages package))))))) - (defun unbound-exports (package symbols-to-ignore) - "Report unbound exported symbols for PACKAGE and all its subpackages." - ;; NOTE: these implementations throw errors on atypical type specifier, enabling `valid-type-p' - #+(or sbcl ccl ecl clisp) - (let* ((report (list-offending-packages package #'list-unbound-exports "unbound exports")) - (report (delete - nil - (mapcar (lambda (rep) - (destructuring-bind (package symbols) - rep - (let ((really-undocumented-symbols - (remove-if (lambda (sym) - (member (symbol-name sym) symbols-to-ignore - :key #'symbol-name :test #'equal)) - symbols))) - (if really-undocumented-symbols - (list package really-undocumented-symbols) - nil)))) - report)))) - (when report - (error "~s~&Found unbound exported symbols in ~a package~:p." - report (length report)))) - #-(or sbcl ccl ecl clisp) nil) - - (defun undocumented-exports (package symbols-to-ignore) - "Report undocumented exported symbols for PACKAGE and all its subpackages. -SYMBOLS-TO-IGNORE are these that should not be tested for -documentation (e.g. slot names)." - (let* ((report (list-offending-packages package #'list-undocumented-exports "undocumented exports")) - (report (delete - nil - (mapcar (lambda (rep) - (destructuring-bind (package symbols) - rep - (let ((really-undocumented-symbols - (remove-if (lambda (sym) - (member (symbol-name sym) symbols-to-ignore - :key #'symbol-name :test #'equal)) - symbols))) - (if really-undocumented-symbols - (list package really-undocumented-symbols) - nil)))) - report)))) - (when report - (error "~s~&Found undocumented exported symbols in ~a package~:p." - report (length report)))))) - -(defmethod asdf:perform ((op asdf:test-op) (c nasdf-compilation-test-system)) - (logger "------- STARTING Compilation Testing: ~a" (packages c)) - (mapc #'(lambda (p) (unbound-exports p (unbound-symbols-to-ignore c))) (packages c)) - (mapc #'(lambda (p) (undocumented-exports p (undocumented-symbols-to-ignore c))) (packages c)) - (logger "------- ENDING Compilation Testing: ~a" (packages c))) diff --git a/nasdf/install.lisp b/nasdf/install.lisp deleted file mode 100644 index af583a5..0000000 --- a/nasdf/install.lisp +++ /dev/null @@ -1,306 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(export-always 'nasdf-file) -(defclass nasdf-file (asdf:static-file) - ((if-does-not-exist - :initform :error - :initarg :if-does-not-exist - :type (member :error nil) - :documentation "What to do when input file is missing: -- `:error': Signal an error. -- `nil': Skip it.")) - (:documentation "Component type for files to install.")) -(import 'nasdf-file :asdf-user) - -(export-always 'nasdf-binary-file) -(defclass nasdf-binary-file (nasdf-file) () - (:documentation "Component type for executables to install.")) -(import 'nasdf-binary-file :asdf-user) - -(export-always 'nasdf-library-file) -(defclass nasdf-library-file (nasdf-binary-file) () - (:documentation "Component type for libraries (shared objects) to install.")) -(import 'nasdf-library-file :asdf-user) - -(export-always 'nasdf-desktop-file) -(defclass nasdf-desktop-file (nasdf-file) () - (:documentation "Component type for XDG .desktop files to install.")) -(import 'nasdf-desktop-file :asdf-user) - -(export-always 'nasdf-icon-directory) -(defclass nasdf-icon-directory (nasdf-file) - ((asdf/interface::type :initform "png")) ; TODO: Is there a standard way to access the type? - (:documentation "Component type for directory containing icon files to install. -File ot type `type' are looked for. -The last number found in the file name is used to install the icon in the right directory.")) -(import 'nasdf-icon-directory :asdf-user) - -;; TODO: Is it possible to list all files targetted by an ASDF system? -(export-always 'nasdf-source-directory) -(defclass nasdf-source-directory (nasdf-file) - ((exclude-subpath - :initform '() - :type (or null (cons string *)) - :accessor exclude-subpath - :initarg :exclude-subpath - :documentation "Subpath to exclude from installation. -Subpaths are relative to the component, so - - (:nasdf-source-directory \"foo\" :exclude-subpath (\"bar\")) - -means that foo/bar is excluded, but foo/baz is not. - -If subpath is a directory, then all its subpaths are excluded as well.") - (exclude-types - :initform '("fasl") - :type (or null (cons string *)) - :accessor exclude-types - :initarg :exclude-types - :documentation "Pattern of files to exclude when not using Git.")) - (:documentation "Directory of Common Lisp source files. -Subdirectory is included. -Git is used to list the tracked files -- untracked files will be ignored. -If Git is not found, fall back to copying everything except files of type in `exclude-types'. - -Destination directory is given by the `dest-source-dir' generic function.")) -(import 'nasdf-source-directory :asdf-user) - -(defun nil-pathname-p (pathname) - "Return non-nil if PATHNAME is `uiop:*nil-pathname*' or nil." - (the (values boolean &optional) - (or (null pathname) - (uiop:pathname-equal pathname uiop:*nil-pathname*)))) - -(defun basename (pathname) ; From nfiles. - "Return the basename, that is: -- if it's a directory, the name of the directory, -- if it's a file, the name of the file including its type (extension), -- nil if it's a nil-pathname (#p\"\")." - (if (nil-pathname-p pathname) - nil ; TODO: Shouldn't we return #p"" instead? - (first (last (pathname-directory - ;; Ensure directory _after_ truenamizing, otherwise if - ;; non-directory file exists it may not yield a directory. - (uiop:ensure-directory-pathname - (uiop:ensure-pathname pathname :truenamize t))))))) - -(defun path-from-env (environment-variable default) - (let ((env (getenv environment-variable))) - (if env - (ensure-directory-pathname env) - default))) - -(defun relative-path-from-env (environment-variable default) - (let ((env (getenv environment-variable))) - (if env - (relativize-pathname-directory (ensure-directory-pathname env)) - default))) - -;; We use `defparameter' so that paths are re-computed on system reload. -(export-always '*destdir*) -(defparameter *destdir* (if (getenv "DESTDIR") - (ensure-directory-pathname (getenv "DESTDIR")) - #p"/")) - -(export-always '*prefix*) -(defparameter *prefix* (merge-pathnames* (relative-path-from-env "PREFIX" #p"usr/local/") - *destdir*)) - -(export-always '*datadir*) -(defparameter *datadir* (path-from-env "DATADIR" (merge-pathnames* "share/" *prefix*))) -(export-always '*bindir*) -(defparameter *bindir* (path-from-env "BINDIR" (merge-pathnames* "bin/" *prefix*))) -(export-always '*libdir*) -(defparameter *libdir* (path-from-env "LIBDIR" (merge-pathnames* "lib/" *prefix*))) -(export-always 'libdir) -(defmethod libdir ((component nasdf-library-file)) - *libdir*) - -(export-always '*dest-source-dir*) -(defvar *dest-source-dir* (path-from-env "NASDF_SOURCE_PATH" *datadir*)) - -(export-always 'dest-source-dir) -(defmethod dest-source-dir ((component nasdf-source-directory)) - *dest-source-dir*) - -(export-always '*chmod-program*) -(defvar *chmod-program* "chmod") -(export-always '*chmod-executable-arg*) -(defvar *chmod-executable-arg* "+x") - -(export-always 'make-executable) -(defun make-executable (file) - "Does nothing if files does not exist." - ;; TODO: Use iolib/os:file-permissions instead of chmod? Too verbose? - (when (file-exists-p file) - (run-program (list *chmod-program* *chmod-executable-arg* (native-namestring file))))) - -(export-always 'install-file) -(defun install-file (file dest) - "Like `copy-file' but ensures all parent directories are created if necessary." - (ensure-all-directories-exist - (list (directory-namestring dest))) - (copy-file file dest)) - -(defmethod asdf:perform ((op asdf:compile-op) (c nasdf-file)) ; REVIEW: load-op? - (loop for input in (asdf:input-files op c) - for output in (asdf:output-files op c) - do (if (or (file-exists-p input) - (slot-value c 'if-does-not-exist)) - (progn - (install-file input output) - ;; (format *error-output* "~&; installing file~%; ~s~%; to~%; ~s~%" source dest) ; Too verbose? - (logger "installed ~s" output)) - (logger "skipped ~s" output))) - nil) - -(defmethod asdf:output-files ((op asdf:compile-op) (c nasdf-file)) - (values (list (uiop:merge-pathnames* (pathname-name (asdf:component-name c)) - *prefix*)) - t)) - -(defmethod asdf:output-files ((op asdf:compile-op) (c nasdf-binary-file)) - (values (list (uiop:merge-pathnames* (basename (asdf:component-name c)) *bindir*)) - t)) - -(defmethod asdf:perform ((op asdf:compile-op) (c nasdf-binary-file)) - (call-next-method) - (mapc #'make-executable (asdf:output-files op c)) - nil) - -(defmethod asdf:output-files ((op asdf:compile-op) (c nasdf-library-file)) - (values (list (uiop:merge-pathnames* (basename (asdf:component-name c)) (libdir c))) - t)) - -(defmethod asdf:output-files ((op asdf:compile-op) (c nasdf-desktop-file)) - (values (list (uiop:merge-pathnames* (uiop:merge-pathnames* - (basename (asdf:component-name c)) - "applications/") - *datadir*)) - t)) - -(defun scan-last-number (path) - "Return the last number found in PATH. -Return NIL is there is none." - (let ((result (block red - (reduce (lambda (&optional next-char result) - (if (parse-integer (string next-char) :junk-allowed t) - (cons next-char result) - (if result - (return-from red result) - result))) - (uiop:native-namestring path) - :initial-value '() - :from-end t)))) - (when result - (coerce result 'string)))) - -(defmethod asdf:input-files ((op asdf:compile-op) (c nasdf-icon-directory)) - "Return all files of NASDF-ICON-DIRECTORY `type' in its directory. -File must contain a number in their path." - (let ((result (remove-if (complement #'scan-last-number) - (uiop:directory-files (asdf:component-pathname c) - (uiop:strcat "*." (asdf:file-type c)))))) - (let* ((dimensions (mapcar #'scan-last-number result)) - (dups (set-difference dimensions - (remove-duplicates dimensions) - :test 'string=))) - (if (= 0 (length dups)) - result - (error "Directory contains icons with duplicate dimensions: ~a" dups))))) - -(defmethod asdf:output-files ((op asdf:compile-op) (c nasdf-icon-directory)) - (let ((name (asdf:primary-system-name (asdf:component-system c)))) - (values - (mapcar (lambda (path) - (let ((icon-size (scan-last-number path)) ) - (format nil "~a/icons/hicolor/~ax~a/apps/~a.png" - *datadir* - icon-size icon-size - name))) - (asdf:input-files op c)) - t))) - -(defun git-ls-files (root dir) - (split-string - (run-program (append (list *git-program* - "-C" (native-namestring root) - "ls-files" (native-namestring dir))) - :output '(:string :stripped t)) - :separator '(#\newline #\return #\linefeed))) - -(defun file-excluded-type (file exclude-types) - (member (pathname-type file) exclude-types :test 'equalp)) - -(defun list-directory (directory &key exclude-subpath (exclude-types '("fasl"))) - (let ((result '())) - (collect-sub*directories - (ensure-directory-pathname directory) - (constantly t) - (lambda (dir) - (notany (lambda (exclusion) - (uiop:string-suffix-p (basename dir) exclusion)) - (mapcar #'basename exclude-subpath))) - (lambda (subdirectory) - (setf result (append result - (remove-if - (lambda (file) (file-excluded-type file exclude-types)) - (uiop:directory-files subdirectory)))))) - result)) - -(export-always 'copy-directory) -(defun copy-directory (source destination &key exclude-subpath (exclude-types '("fasl")) verbose-p) ; REVIEW: Unused, but seem quite useful. - "Copy the content (the file tree) of SOURCE to DESTINATION." - (when verbose-p - (logger "copy ~s/* inside ~s." source destination)) - (mapc (lambda (file) - (unless (member (pathname-type file) exclude-types :test 'equalp) - (let ((destination-file - (merge-pathnames* - (subpathp file (ensure-directory-pathname source)) - (ensure-pathname destination :truenamize t :ensure-directory t)))) - (install-file file destination-file)))) - (list-directory source :exclude-subpath exclude-subpath - :exclude-types exclude-types))) - - -(defmethod asdf:input-files ((op asdf:compile-op) (component nasdf-source-directory)) - "Return all files of NASDF-SOURCE-DIRECTORY. -They are either listed with 'git ls-files' or directly if Git is not found." - (let ((source (asdf:component-pathname component)) - (root (asdf:system-source-directory (asdf:component-system component)))) - (handler-case - (uiop:with-current-directory (root) - (let ((absolute-exclusions (mapcar (lambda (exclusion) - (namestring - (merge-pathnames* - (uiop:ensure-directory-pathname exclusion) - (uiop:ensure-directory-pathname source)))) - (exclude-subpath component)))) - (remove-if (lambda (file) - (or (file-excluded-type file (exclude-types component)) - (let ((file-string (namestring file))) - (some (lambda (exclusion) - (uiop:string-prefix-p exclusion file-string)) - absolute-exclusions)))) - (mapcar (lambda (path) - (ensure-pathname path :truenamize t)) - (git-ls-files - root - source))))) - (error (c) - (warn "~a~&Git error, falling back to direct listing." c) - (uiop:with-current-directory (root) - (list-directory source :exclude-subpath (exclude-subpath component) - :exclude-types (exclude-types component))))))) - -(defmethod asdf:output-files ((op asdf:compile-op) (component nasdf-source-directory)) - (let ((root (asdf:system-source-directory (asdf:component-system component)))) - (values - (mapcar (lambda (path) - (merge-pathnames* (uiop:subpathp path root) (dest-source-dir component))) - (asdf:input-files op component)) - t))) diff --git a/nasdf/log.lisp b/nasdf/log.lisp deleted file mode 100644 index 879009e..0000000 --- a/nasdf/log.lisp +++ /dev/null @@ -1,17 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -;; TODO: Use full-fledged logging facility? -;; Maybe we want to keep this dependency-free though... - -(defvar *log-prefix* "; ") - -(defun logger (control-string &rest format-arguments) - "Like `format' but assumes `*error-output*' as a stream and ensures fresh lines." - (let ((*standard-output* *error-output*)) - (fresh-line ) - (princ *log-prefix*) - (apply #'format t control-string format-arguments) - (fresh-line))) diff --git a/nasdf/nasdf.asd b/nasdf/nasdf.asd deleted file mode 100644 index cba2332..0000000 --- a/nasdf/nasdf.asd +++ /dev/null @@ -1,18 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(defsystem "nasdf" - :version "0.1.4" - :author "Atlas Engineer LLC" - :homepage "https://github.com/atlas-engineer/ntemplate" - :description "ASDF helpers for system setup, testing and installation." - :license "BSD 3-Clause" - ;; It cannot depend on anything because it's also in charge of fetching dependencies. - :components ((:file "package") - (:file "log") - (:file "nasdf") - (:file "install") - (:file "submodules") - (:file "systems") - (:file "tests") - (:file "compilation-tests"))) diff --git a/nasdf/nasdf.lisp b/nasdf/nasdf.lisp deleted file mode 100644 index a27cdf5..0000000 --- a/nasdf/nasdf.lisp +++ /dev/null @@ -1,19 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(defmacro export-always (symbols &optional (package nil package-supplied?)) - "Like `export', but also evaluated at compile time." - `(eval-when (:compile-toplevel :load-toplevel :execute) - (export ,symbols ,@(and package-supplied? (list package))))) - -(defun env-true-p (env-variable) - (let ((value (uiop:getenv env-variable))) - (or (string-equal "true" value) - (string-equal "yes" value) - (string-equal "on" value) - (string-equal "1" value)))) - -(export-always '*git-program*) -(defvar *git-program* "git") diff --git a/nasdf/package.lisp b/nasdf/package.lisp deleted file mode 100644 index d633715..0000000 --- a/nasdf/package.lisp +++ /dev/null @@ -1,101 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -#+sb-package-locks -(eval-when (:compile-toplevel :load-toplevel :execute) - (when (find-package :nasdf) - (sb-ext:unlock-package :nasdf))) - -(uiop:define-package :nasdf - (:use :cl) - (:import-from :uiop - #:absolute-pathname-p - #:collect-sub*directories - #:copy-file - #:directory-files - #:ensure-all-directories-exist - #:ensure-directory-pathname - #:ensure-pathname - #:file-exists-p - #:getenv - #:inter-directory-separator - #:merge-pathnames* - #:native-namestring - #:quit - #:relativize-pathname-directory - #:run-program - #:split-string - #:strcat - #:subpathp - #:symbol-call) - (:import-from :asdf - #:clear-configuration - #:perform - #:system-relative-pathname - #:system-source-directory) - (:import-from - #+abcl #:mop - #+allegro #:mop - #+clisp #:clos - #+clozure #:ccl - #+cmu #:clos-mop - #+ecl #:clos - #+clasp #:clos - #+lispworks #:clos - #+mcl #:ccl - #+sbcl #:sb-mop - #+scl #:clos - #+mezzano #:mezzano.clos - #+sicl #:sicl-clos - #:standard-accessor-method - #:standard-reader-method - #:standard-writer-method) - (:documentation "ASDF helpers for system setup, testing and installation. - -To tell ASDF to fail loading a system on warnings, add this line to the system -definition: - - :around-compile \"NASDF:FAIL-ON-WARNINGS\" - -To report unbound exported symbols: - -(defsystem my-system - :defsystem-depends-on (\"nasdf\") - :class :nasdf-compilation-test-system - :depends-on (foo bar) - :packages (:foo)) - -A system that installs files: - -(defsystem \"my-project/install\" - :defsystem-depends-on (\"nasdf\") - :depends-on (alexandria) - :components ((:nasdf-desktop-file \"assets/my-project.desktop\") - (:nasdf-icon-directory \"assets/\") - (:nasdf-binary-file \"my-project\") - (:nasdf-library-file \"libraries/web-extensions/libmy.so\" - :if-does-not-exist nil) - (:nasdf-source-directory \"source\") - (:nasdf-source-directory \"nasdf\") - (:nasdf-source-directory \"libraries\" - :exclude-subpath (\"web-extensions\") ; Do not install this non-Lisp source. - :exclude-types (\"o\" \"c\" \"h\" ; C code and artifacts. - \"fasl\")))) - -A system that fetches the Git submodules: - -(defsystem \"my-project/submodules\" - :defsystem-depends-on (\"nasdf\") - :class :nasdf-submodule-system) - -Shell command to add a submodule to the default directory: - - git submodule add https://github.com/atlas-engineer/history-tree _build/history-tree - -To update it: - - git submodule update --remote _build/history-tree -")) - -#+sb-package-locks -(sb-ext:lock-package :nasdf) diff --git a/nasdf/readme.org b/nasdf/readme.org deleted file mode 100644 index 7be8696..0000000 --- a/nasdf/readme.org +++ /dev/null @@ -1,53 +0,0 @@ -#+TITLE: NASDF - -NASDF is an ASDF extension providing utilities to ease system setup, testing -and installation. - -** Features - -- Simple way to fetch Git submodules and "do the right thing" for setup. This - may effectively supersede Quicklisp. A benefit of using Git submodules over - the default Quicklisp distribution is improved reproducibility. -- Test helpers, like distinction between offline and online tests, or continuous - integration options, and warning reports. -- Installation helpers, for instance to install libraries, icons and desktop - files to the right directories. - -See [[file:package.lisp]] for more details. - -** Environment variables - -NASDF exposes some environment variables which can be convenient in some cases -(say for continuous integration) to tweak some options. - -- =NASDF_SOURCE_PATH= :: See =nasdf:*dest-source-dir*=. -- =NASDF_SUBMODULES_DIR= :: See =nasdf:*submodules-directory*=. -- =NASDF_SUBMODULES_JOBS= :: See =nasdf:*submodules-jobs*=. -- =NASDF_USE_LOGICAL_PATHS= :: Allow non-expanded logical pathnames in system - pathnames. - This is particularly useful when shipping the source. - Disable it if your tooling (e.g. SLIME) encounters issues to find the - definition of symbols. - See =asdf:nasdf-file=. -- =NASDF_COMPRESS= :: Compress the application executable. - Only works with some compilers like SBCL. May increase startup time. - See =asdf:nasdf-file=. -- =NASDF_TESTS_NO_NETWORK= :: Do no run tests that have the =:online= tag. - See =nasdf:nasdf-test-system=. -- =NASDF_TESTS_QUIT_ON_FAIL= :: Quit the Lisp on test failure. This is useful - to tell the continuous integration environment that tests failed, otherwise - they silently fail. - -All boolean environment variables try to be smart enough to understand what you -mean; for instance both =on= and =true= are valid values to enable the feature. - -** History - -NASDF was originally developed for [[https://nyxt.atlas.engineer][Nyxt]]. - -** Change log - -*** 0.1.1 - -- Fix compilation-tests. -- Fix =env-true-p= to accept =yes= as =T=. diff --git a/nasdf/submodules.lisp b/nasdf/submodules.lisp deleted file mode 100644 index 0e0e731..0000000 --- a/nasdf/submodules.lisp +++ /dev/null @@ -1,74 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(export-always '*submodules-directory*) -(defvar *submodules-directory* (or (getenv "NASDF_SUBMODULES_DIR") - "_build") - "Where to store the Git submodules. -The \"_build\" directory is ignored by ASDF by default, which makes it a useful -destination for developers who have their own dependencies elsewhere and just -want to test the build as would happen on the end user system.") - -(export-always '*submodules-jobs*) -(defvar *submodules-jobs* (or (getenv "NASDF_SUBMODULES_JOBS") - 4) - "Number of parallel 'git clone' jobs to fetch the Git submodules. -A naive benchmark on a 16 Mbps bandwidth gives us - - 1 job: 5m17s - 2 jobs: 3m38s - 4 jobs: 2m51s - 8 jobs: 2m21s") - -(export-always 'nasdf-submodule-system) -(defclass nasdf-submodule-system (asdf:system) () - (:documentation "This system sole purpose is to fetch the Git submodules found in '.gitmodules' next to the system definition file.")) -(import 'nasdf-submodule-system :asdf-user) - -(defmethod asdf:perform ((o asdf:compile-op) (c nasdf-submodule-system)) - (fetch-submodules c)) - -(defun register-submodules (component) - ;; Ideally we should avoid writing global, stateful files to the user file - ;; system. So instead of writing to the ASDF config file, we register the - ;; sudmodule directory with CL_SOURCE_REGISTRY. This locally overrides - ;; CL_SOURCE_REGISTRY, but it's fine since submodules are only meant for - ;; non-developers (who probably don't set CL_SOURCE_REGISTRY). - ;; - ;; We must set this globally because the information would be lost within a - ;; Lisp compiler subprocess (e.g. as used by linux-packaging). - (flet ((ensure-absolute-path (path component) - (if (absolute-pathname-p path) - path - (system-relative-pathname component path)))) - (setf (getenv "CL_SOURCE_REGISTRY") - (strcat - (native-namestring - (ensure-directory-pathname - (ensure-absolute-path *submodules-directory* component))) - ;; Double-slash tells ASDF to traverse the tree recursively. - "/" - ;; Register this directory so that the system's ASD is included, just in case. - (inter-directory-separator) - (native-namestring (system-source-directory component)) - (if (getenv "CL_SOURCE_REGISTRY") - (strcat (inter-directory-separator) (getenv "CL_SOURCE_REGISTRY")) - ;; End with an empty string to tell ASDF to inherit configuration. - (inter-directory-separator))))) - (clear-configuration) - (format t "; CL_SOURCE_REGISTRY: ~s~%" (getenv "CL_SOURCE_REGISTRY"))) - -(export-always 'fetch-submodules) -(defmethod fetch-submodules ((component asdf:component)) - (let ((cmd (list *git-program* - "-C" (namestring (system-source-directory component)) - "submodule" "update" "--init" "--force" - "--jobs" (write-to-string *submodules-jobs*)))) - (logger "running ~s" cmd) - (run-program cmd - :ignore-error-status t - :output t - :error-output t)) - (register-submodules component)) diff --git a/nasdf/systems.lisp b/nasdf/systems.lisp deleted file mode 100644 index 7d69522..0000000 --- a/nasdf/systems.lisp +++ /dev/null @@ -1,139 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(export-always 'nasdf-system) -(defclass nasdf-system (asdf:system) () - (:documentation "Extended ASDF system. -It enables features such as: -- Togglable logical-pathnames depending on NASDF_USE_LOGICAL_PATHS. -- Togglable executable compression with NASDF_COMPRESS. -- Executable dependencies are made immutable for ASDF to prevent accidental reloads.")) -;; TODO: This is how `prove' does it, not very clean. -;; Alternatively, we could switch package in the .asd, but this seems cumbersome too. -(import 'nasdf-system :asdf-user) - -#+sb-core-compression -(defmethod asdf:perform ((o asdf:image-op) (c nasdf-system)) - (uiop:dump-image (asdf:output-file o c) - :executable t - :compression (when (getenv "NASDF_COMPRESS") - (or (parse-integer (getenv "NASDF_COMPRESS") - :junk-allowed t) - (string-equal "T" (getenv "NASDF_COMPRESS")))))) - -(defmethod asdf:perform :before ((o asdf:image-op) (c nasdf-system)) - "Perform some last minute tweaks to the final image. - -- Register immutable systems to prevent compiled images from -trying to recompile the application and its dependencies. -See `asdf::*immutable-systems*'. - -- If on SBCL, include `sb-sprof', the statistical profiler, since it's one of -the few modules that's not automatically included in the image." - #+sbcl - (require :sb-sprof) - (map () 'asdf:register-immutable-system (asdf:already-loaded-systems))) - -(defun set-new-translation (host logical-directory - root-directory - &optional (translated-directory (string-downcase (substitute #\/ #\; logical-directory)))) - "Add default translations for LOGICAL-DIRECTORY (e.g. \"foo;bar;\") in HOST. -Default translations: -- FASL files are expanded as usual with `asdf:apply-output-translations' (should default to the ASDF cache). -- Other files are expanded to their absolute location. - -This effectively makes the logical pathname behave as if it had been a physical -pathname." - (let* ((logical-directory (if (uiop:string-suffix-p logical-directory ";") - logical-directory - (uiop:strcat logical-directory ";"))) - (logical-path (uiop:strcat host ":" logical-directory "**;*.*.*")) - (logical-fasl-path (uiop:strcat host ":" logical-directory "**;*.fasl.*")) - (path-translation (uiop:ensure-pathname - (uiop:subpathname* root-directory - translated-directory) - :ensure-directory t - :wilden t)) - (fasl-translation (uiop:ensure-pathname - (asdf:apply-output-translations - (uiop:subpathname* root-directory - translated-directory)) - :wilden t))) - (if (ignore-errors (logical-pathname-translations host)) - (flet ((set-alist (key value) - (let ((pair (assoc key (logical-pathname-translations host) - :key #'namestring - :test #'string-equal))) - (if pair - (setf (rest pair) (list value)) - (push (list key value) - (logical-pathname-translations host)))))) - (set-alist logical-path path-translation) - (set-alist logical-fasl-path fasl-translation) - ;; Return this for consistency: - (list (list logical-fasl-path fasl-translation) - (list logical-path path-translation))) - (setf (logical-pathname-translations host) - ;; WARNING: fasl path must come first as it's more specific. - (list (list logical-fasl-path fasl-translation) - (list logical-path path-translation)))))) - -(defun logical-word-or-lose (word) ; From `sb-impl::logical-word-or-lose'. - (declare (string word)) - (when (string= word "") - (error 'namestring-parse-error - :complaint "Attempted to treat invalid logical hostname ~ - as a logical host:~% ~S" - :args (list word) - :namestring word :offset 0)) - (let ((word (string-upcase word))) - (dotimes (i (length word)) - (let ((ch (schar word i))) - (unless (and (typep ch 'standard-char) - (or (alpha-char-p ch) (digit-char-p ch) (char= ch #\-))) - (error 'namestring-parse-error - :complaint "logical namestring character which ~ - is not alphanumeric or hyphen:~% ~S" - :args (list ch) - :namestring word :offset i)))) - (coerce word 'string))) - -(defun parse-logical-pathname (pathname) - "Return two values: -- the host; -- the directory." - (let* ((name (namestring pathname)) - (pos (position #\: name))) - (when pos - (let ((host (subseq name 0 (position #\: name)))) - (when (ignore-errors (logical-word-or-lose host)) - (values host - (subseq name (1+ (position #\: name))))))))) - -;; Both `nasdf:component-pathname' and `asdf:component-pathname' work, but it -;; seems more semantically correct to specialize `asdf:component-pathname' for -;; this. -(defmethod asdf:component-pathname ((system nasdf-system)) - "If NASDF_USE_LOGICAL_PATHS environment variable is set, use logical path source -location, otherwise use the translated path. - -Tools such as Emacs (SLIME and SLY) may fail to make use of logical paths, say, -to go to the compilation error location." - (let ((path (call-next-method))) - (when path - (let ((final-path (let ((host (parse-logical-pathname path))) - (if host - (progn - (set-new-translation host - (subseq (namestring path) (1+ (length host))) - (asdf:system-source-directory system)) - ;; The #p reader macro expands to logical pathnames only if - ;; the host is already defined, which may not be the case at - ;; this point, so we remake the pathname. - (make-pathname :defaults path)) - path)))) - (if (env-true-p "NASDF_USE_LOGICAL_PATHS") - final-path - (translate-logical-pathname final-path)))))) diff --git a/nasdf/tests.lisp b/nasdf/tests.lisp deleted file mode 100644 index 613c113..0000000 --- a/nasdf/tests.lisp +++ /dev/null @@ -1,122 +0,0 @@ -;;;; SPDX-FileCopyrightText: Atlas Engineer LLC -;;;; SPDX-License-Identifier: BSD-3-Clause - -(in-package :nasdf) - -(export-always 'nasdf-test-system) -(defclass nasdf-test-system (asdf:system) - ((targets - :initform '() ;; (error "Targets required") - :initarg :targets - :reader targets - :documentation "Arguments passed to `lisp-unit2:run-tests'. -Example: - - :targets '(:package my-app/tests :exclude-tags (:foo my-app/tests::bar))")) - (:documentation "Specialized systems for enhanced testing. -It automatically depends on Lisp-Unit2 and calls the appropriate invocation for tests. -You must list what to test, see the `targets' slot. - -If the NASDF_TESTS_QUIT_ON_FAIL environment variable is set, quit Lisp on failure. -This is useful for some continuous integration systems. - -If the NASDF_TESTS_NO_NETWORK environment variable is set, tests with the `:online' tags are excluded.")) -(import 'nasdf-test-system :asdf-user) - -(defmethod asdf:component-depends-on ((op asdf:prepare-op) (c nasdf-test-system)) - `((asdf:load-op "lisp-unit2") - ,@(call-next-method))) - -(defmethod asdf:perform :around ((op asdf:test-op) (c nasdf-test-system)) - (let ((*debugger-hook* (if (env-true-p "NASDF_TESTS_QUIT_ON_FAIL") - nil ; We are non-interactive. - *debugger-hook*))) - (handler-bind ((error (lambda (c) - (logger "Errors:~&~a" c) - (when (env-true-p "NASDF_TESTS_QUIT_ON_FAIL") - ;; Arbitrary but hopefully recognizable exit code. - (quit 18))))) - (call-next-method)))) - -;; TODO: Can we avoid duplicating this `test-op' / `load-op' setup? -(defmethod asdf:perform :around ((op asdf:load-op) (c nasdf-test-system)) - (logger "NASDF_TESTS_QUIT_ON_FAIL=~a~&" (getenv "NASDF_TESTS_QUIT_ON_FAIL")) - (let ((*debugger-hook* (if (env-true-p "NASDF_TESTS_QUIT_ON_FAIL") - nil ; We are non-interactive. - *debugger-hook*))) - (handler-bind ((error (lambda (c) - (logger "Errors:~&~a" c) - (when (env-true-p "NASDF_TESTS_QUIT_ON_FAIL") - ;; Arbitrary but hopefully recognizable exit code. - (quit 18))))) - (call-next-method)))) - -(defmethod asdf:perform ((op asdf:test-op) (c nasdf-test-system)) - (destructuring-bind (&key package tags exclude-tags &allow-other-keys) - (targets c) - (let ((exclude-tags (append (when (getenv "NASDF_TESTS_NO_NETWORK") - '(:online)) - exclude-tags))) - (let ((missing-packages (remove-if #'find-package (uiop:ensure-list package)))) - (when missing-packages - (logger "Undefined test packages: ~s" missing-packages))) - ;; Binding `*package*' to test package makes for more reproducible tests. - (let* ((*package* (find-package package)) - (test-results - (uiop:symbol-call :lisp-unit2 :run-tests - :package package - :tags tags - :exclude-tags exclude-tags - :run-contexts (find-symbol "WITH-SUMMARY-CONTEXT" :lisp-unit2)))) - (when (and - (or - (uiop:symbol-call :lisp-unit2 :failed test-results) - (uiop:symbol-call :lisp-unit2 :errors test-results)) - ;; TODO: Always raise error or not? - (getenv "NASDF_TESTS_QUIT_ON_FAIL")) - (error "Tests failed.")))))) - -(export-always 'print-benchmark) -(defun print-benchmark (benchmark-results) - (labels ((rat->float (num) - (if (integerp num) num (float num))) - (print-times (entry) - (let ((title (first entry)) - (attr (rest entry))) - (unless (or (member (symbol-name title) '("RUN-TIME" "SYSTEM-RUN-TIME")) ; Not so interesting. - (and (member (symbol-name title) '("PAGE-FAULTS" "EVAL-CALLS") - :test #'string=) - (zerop (getf attr :average)))) - (format t " ~a: ~,9t~a" (string-downcase title) (rat->float (getf attr :average))) - (format t "~32,8t[~a, ~a]" - (rat->float (getf attr :minimum)) - (rat->float (getf attr :maximum))) - (format t "~56,8t(median ~a, deviation ~a, total ~a)" - (rat->float (getf attr :median)) - (rat->float (getf attr :deviation)) - (rat->float (getf attr :total))) - (format t "~%"))))) - (dolist (mark benchmark-results) - (format t "~a (~a sample~:p):~%" (first mark) - (getf (rest (second mark)) :samples)) - (mapc #'print-times (rest mark))))) - -(defun redefinition-p (condition) ; From Slynk. - (and (typep condition 'style-warning) - (every #'char-equal "redefin" (princ-to-string condition)))) - -#+ccl -(defun osicat-warning-p (condition) - ;; Osicat triggers a warning on CCL because of some unimplemented chunk. - ;; See https://github.com/osicat/osicat/issues/37. - (and (typep condition 'style-warning) - (search "Undefined function OSICAT::MAKE-FD-STREAM" (princ-to-string condition)))) - -(export-always 'fail-on-warnings) -(defun fail-on-warnings (thunk) ; TODO: Is it possible to report the offending component? - (handler-bind ((warning (lambda (c) - (unless (or (redefinition-p c) - #+ccl - (osicat-warning-p c)) - (cerror "Continue" "Compilation warning: ~a" c))))) - (funcall thunk))) From 7060b2174b61158650a4ab4e27b975acff3b59e0 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Thu, 23 Nov 2023 13:01:30 +0200 Subject: [PATCH 2/4] prompter.asd: Refactor. --- prompter.asd | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/prompter.asd b/prompter.asd index ab8dd55..3ceed3c 100644 --- a/prompter.asd +++ b/prompter.asd @@ -23,27 +23,18 @@ (:file "filter") (:file "prompter-source") (:file "prompter")) - :in-order-to ((test-op (test-op "prompter/tests") - (test-op "prompter/tests/compilation")))) - -(defsystem "prompter/submodules" - :defsystem-depends-on ("nasdf") - :class :nasdf-submodule-system) + :in-order-to ((test-op (test-op "prompter/tests")))) (defsystem "prompter/tests" - :defsystem-depends-on ("nasdf") - :class :nasdf-test-system - :depends-on ("prompter") - :targets (:package :prompter/tests) + :depends-on ("prompter" "lisp-unit2") :serial t :pathname "tests/" :components ((:file "package") (:file "tests") (:file "fuzzy") - (:file "submatches"))) - -(defsystem "prompter/tests/compilation" - :defsystem-depends-on ("nasdf") - :class :nasdf-compilation-test-system - :depends-on ("prompter") - :packages (:prompter)) + (:file "submatches")) + :perform (test-op (op c) + (eval-input + "(lisp-unit2:run-tests + :package :prompter/tests + :run-contexts #'lisp-unit2:with-summary-context)"))) From 510c35ad92705e27ad8ba6b636fb2d43cf3679b0 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Fri, 24 Nov 2023 14:38:13 +0200 Subject: [PATCH 3/4] .github/workflows/tests: Refactor. --- .github/workflows/tests.yml | 78 +++++++------------------------------ 1 file changed, 14 insertions(+), 64 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b91e715..402f839 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,8 @@ # SPDX-FileCopyrightText: Atlas Engineer LLC # SPDX-License-Identifier: BSD-3 Clause -# Inspired by http://3bb.cc/blog/2020/09/11/github-ci/. + name: Tests -# We tell GitHub to not duplicate the checks in pull requests. See -# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662/15 on: push: branches: [ master ] @@ -17,76 +15,28 @@ jobs: name: ${{ matrix.lisp }} on ${{ matrix.os }} strategy: matrix: - # Use ccl-bin/1.12.1 instead of 'ccl' because of - # https://github.com/roswell/roswell/issues/534. - # TODO: Revert when Roswell is functional again. - lisp: [sbcl-bin, ccl-bin/1.12.1] - rosargs: [dynamic-space-size=3072] - os: [ubuntu-latest, macos-latest] # try windows-latest when we understand commands to install Roswell on it - - # run the job on every combination of "lisp" and "os" above + lisp: [sbcl-bin] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} steps: - # Check out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Cache .roswell - id: cache-dot-roswell - uses: actions/cache@v1 + - uses: actions/checkout@v4 with: - path: ~/.roswell - key: ${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-${{ hashFiles('**/*.asd') }} - restore-keys: | - ${{ runner.os }}-dot-roswell-${{ matrix.lisp }}- - ${{ runner.os }}-dot-roswell- - - - name: Install Roswell - shell: bash - # always run install, since it does some global installs and setup that isn't cached - env: - LISP: ${{ matrix.lisp }} - # TODO: Update Roswell to latest version (may need Ubuntu 20.* or above). - run: curl -L https://raw.githubusercontent.com/roswell/roswell/v20.06.14.107/scripts/install-for-ci.sh | sh -x + show-progress: 'false' + submodules: 'true' - - name: Check Lisp - continue-on-error: true - shell: bash - run: | - ros ${{ matrix.rosargs }} -e '(format t "~&~a: ~a on ~a~%" (lisp-implementation-type) (lisp-implementation-version) (machine-type))' - ros ${{ matrix.rosargs }} -e '(format t "ASDF: ~a~%" (asdf:asdf-version))' - ros ${{ matrix.rosargs }} -e '(format t "fixnum bits: ~a~%" (integer-length most-positive-fixnum))' - ros ${{ matrix.rosargs }} -e '(format t "features: ~s~%" *features*)' - - - name: Register current checkout path in ASDF - shell: bash + - name: Register submodules in ASDF run: | mkdir -p ~/.config/common-lisp/source-registry.conf.d/ echo "(:tree \"$PWD\")" > ~/.config/common-lisp/source-registry.conf.d/asdf.conf + echo "(:tree \"$PWD/_build\")" >> ~/.config/common-lisp/source-registry.conf.d/asdf.conf - - name: Fetch Common Lisp third-party dependencies - shell: bash - run: | - ros ${{ matrix.rosargs }} -e '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "Error: ~a~&" a) (uiop:quit 17)))) (asdf:load-system :prompter/submodules))' - mkdir -p ~/.config/common-lisp/source-registry.conf.d/ - echo "(:tree \"$PWD/_build/submodules\")" >> ~/.config/common-lisp/source-registry.conf.d/asdf.conf - - - name: Load the system - shell: bash - run: | - # TODO: Can we make CCL backtraces more readable? With trivial-backtrace maybe? - ros ${{ matrix.rosargs }} -e '(asdf:load-system :prompter/submodules)' -e '(handler-bind ((error (lambda (a) (uiop:print-condition-backtrace a) (format *error-output* "Error: ~a~&" a) (uiop:quit 17)))) (asdf:load-system :prompter))' - - # Load tests separately to not clutter the test output. - - name: Load tests - shell: bash - run: | - ros ${{ matrix.rosargs }} -e '(asdf:load-system :prompter/submodules)' -e '(handler-bind ((error (lambda (a) (uiop:print-backtrace) (format *error-output* "~a~&" a) (uiop:quit 17)))) (asdf:load-system :prompter/tests) (asdf:load-system :prompter/tests/compilation))' + - name: Install Roswell + env: + LISP: ${{ matrix.lisp }} + run: curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x - name: Run tests - shell: bash - # Export CI to tell ASDF to quit on test errors. - env: - NASDF_TESTS_QUIT_ON_FAIL: yes run: | - ros ${{ matrix.rosargs }} -e '(asdf:load-system :prompter/submodules)' -e '(asdf:test-system :prompter)' + ros -e '(handler-case (asdf:load-system :prompter/tests) (error (c) (format t "Error: ~s~%~a~%" c c) (uiop:quit 1)))' \ + -e '(let ((output (lisp-unit2:run-tests :package :prompter/tests))) (lisp-unit2:print-summary output) (when (or (lisp-unit2:failed output) (lisp-unit2:errors output)) (uiop:quit 1)))' From 44c829233bd8ae3e648adeefdc24f2b9194c04cb Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Fri, 24 Nov 2023 14:57:09 +0200 Subject: [PATCH 4/4] guix.scm: Simplify. --- guix.scm | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/guix.scm b/guix.scm index 580a290..dcf6680 100644 --- a/guix.scm +++ b/guix.scm @@ -3,36 +3,17 @@ ;;; Commentary: ;; -;; GNU Guix development package. To build and install, clone this repository, -;; switch directory to here and run: +;; GNU Guix development package. To start the REPL: ;; -;; guix package --install-from-file=guix.scm -;; -;; To start the REPL: -;; -;; guix shell -f guix.scm sbcl -- sbcl +;; guix shell -f path/to/guix.scm sbcl -- sbcl ;; ;;; Code: (use-modules (guix packages) (guix gexp) - (guix build-system asdf) - (gnu packages) - (gnu packages lisp) (gnu packages lisp-xyz)) -(define-public sbcl-prompter-dev - (package - (inherit sbcl-prompter) - (source - (local-file (dirname (current-filename)) - #:recursive? #t - #:select? (lambda (file stat) (not (string=? (basename file) "nasdf"))))))) - -(define-public cl-prompter-dev - (sbcl-package->cl-source-package sbcl-prompter-dev)) - -(define-public ecl-prompter-dev - (sbcl-package->ecl-package sbcl-prompter-dev)) - -cl-prompter-dev +(package + (inherit cl-prompter) + (version "dev") + (source (local-file (dirname (current-filename)) #:recursive? #t)))