From 2dec6cdff9133378d9b655ec074a88e1ada06452 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 22 Aug 2022 22:13:54 +0200 Subject: Remove `lib/sysexits` submodule Sysexits is now in Quicklisp. --- .gitmodules | 3 --- lib/sysexits | 1 - 2 files changed, 4 deletions(-) delete mode 160000 lib/sysexits diff --git a/.gitmodules b/.gitmodules index 4a28638..04f0797 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "l/lib/sysexits"] - path = lib/sysexits - url = https://github.com/teddywing/cl-sysexits.git [submodule "lib/wait-group"] path = lib/wait-group url = https://github.com/teddywing/cl-wait-group.git diff --git a/lib/sysexits b/lib/sysexits deleted file mode 160000 index 7691fd7..0000000 --- a/lib/sysexits +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7691fd7f8181b29c7a7bcc39eecde2294a5b2e2e -- cgit v1.2.3 From d6c18fde2f9bf32c022e1a474cd1b8e676ae71d4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Mon, 22 Aug 2022 22:15:47 +0200 Subject: Remove `lib/with-user-abort` submodule With-user-abort is now in Quicklisp. --- .gitmodules | 3 --- lib/with-user-abort | 1 - 2 files changed, 4 deletions(-) delete mode 160000 lib/with-user-abort diff --git a/.gitmodules b/.gitmodules index 04f0797..067aecd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "lib/wait-group"] path = lib/wait-group url = https://github.com/teddywing/cl-wait-group.git -[submodule "lib/with-user-abort"] - path = lib/with-user-abort - url = https://github.com/compufox/with-user-abort.git diff --git a/lib/with-user-abort b/lib/with-user-abort deleted file mode 160000 index 16cc952..0000000 --- a/lib/with-user-abort +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 16cc952d95d045b46c958309a4e988895f65d539 -- cgit v1.2.3 From add2fe905028b9f9926f10a9e862d2fec1511106 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 23 Aug 2022 00:51:38 +0200 Subject: Makefile: Add self-contained bundle target Add a target to create a self-contained bundle of the program that isn't dependent on Quicklisp. This code is based on what I did in Wajir. --- .gitignore | 4 ++++ Makefile | 12 ++++++++++++ bundle.lisp | 15 +++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 bundle.lisp diff --git a/.gitignore b/.gitignore index b47e879..7b6a21e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ /dist/ *.fasl + +/bundle/ +/lib/extreload/ +system-index.txt diff --git a/Makefile b/Makefile index 98bc97e..acfee9c 100644 --- a/Makefile +++ b/Makefile @@ -68,3 +68,15 @@ pkg: extreload_$(VERSION)_darwin-x86_64.tar.bz2 extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist + + +bundle: + mkdir -p lib/extreload + cp -a extreload.asd src lib/extreload/ + + $(LISP) --load bundle.lisp + +bundle/bundled-local-projects/0000/extreload/extreload: bundle + $(LISP) --load bundle/bundle.lisp \ + --eval '(asdf:make :extreload)' \ + --eval '(quit)' diff --git a/bundle.lisp b/bundle.lisp new file mode 100644 index 0000000..2069940 --- /dev/null +++ b/bundle.lisp @@ -0,0 +1,15 @@ +(setf ql:*local-project-directories* '("./lib")) + +(let ((dependencies (append + (asdf:system-depends-on (asdf:find-system :extreload)))) + (local-dependencies '("sysexits" + "wait-group"))) + (ql:bundle-systems + (set-difference + (sort dependencies #'string-lessp) + local-dependencies + :test #'equal) + :to "./bundle" + :include-local-projects t)) + +(quit) -- cgit v1.2.3 From e7e878e98ab8ba34720e8466f0cab10e8e70980a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 23 Aug 2022 00:57:09 +0200 Subject: Makefile: Add an `install` target Make it easy for package managers to build and install the program. --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Makefile b/Makefile index acfee9c..80344fc 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,14 @@ # along with Extreload. If not, see . +prefix ?= /usr/local +exec_prefix ?= $(prefix) +bindir ?= $(exec_prefix)/bin +datarootdir ?= $(prefix)/share +mandir ?= $(datarootdir)/man +man1dir ?= $(mandir)/man1 + + LISP ?= sbcl VERSION := $(shell fgrep ':version' extreload.asd | awk -F '"' '{ print $$2 }') @@ -80,3 +88,11 @@ bundle/bundled-local-projects/0000/extreload/extreload: bundle $(LISP) --load bundle/bundle.lisp \ --eval '(asdf:make :extreload)' \ --eval '(quit)' + + +.PHONY: install +install: bundle/bundled-local-projects/0000/extreload/extreload $(MAN_PAGE) + install -m 755 bundle/bundled-local-projects/0000/extreload/extreload $(DESTDIR)$(bindir) + + install -d $(DESTDIR)$(man1dir) + install -m 644 $(MAN_PAGE) $(DESTDIR)$(man1dir) -- cgit v1.2.3 From ccda038e714b1b48de214626ab68f4a9c0c6701c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 20:53:10 +0200 Subject: bundle.lisp: Remove `sysexits` from `local-dependencies` list Sysexits is now in Quicklisp so we don't need to load it here. --- bundle.lisp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundle.lisp b/bundle.lisp index 2069940..c5e9c66 100644 --- a/bundle.lisp +++ b/bundle.lisp @@ -2,8 +2,7 @@ (let ((dependencies (append (asdf:system-depends-on (asdf:find-system :extreload)))) - (local-dependencies '("sysexits" - "wait-group"))) + (local-dependencies '("wait-group"))) (ql:bundle-systems (set-difference (sort dependencies #'string-lessp) -- cgit v1.2.3 From bc3109dd27646004bf12430ddeb210f23ccda7f7 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 20:57:04 +0200 Subject: Makefile: Add dependencies on `bundle` target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 80344fc..34c25cf 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist -bundle: +bundle: extreload.asd src/*.lisp mkdir -p lib/extreload cp -a extreload.asd src lib/extreload/ -- cgit v1.2.3 From e830899cf2268f38ff21038c9c7edfd0b080b385 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 20:57:27 +0200 Subject: Makefile: Rewrite `pkg` target to include bundle and source Copy the `pkg` target from Wajir to make a tarball of the bundled dependencies in `bundle` and the Extreload source code. This tarball can then be distributed and the program can be built and installed from it using the Makefile. By distributing the source, an executable can be built for more architectures and systems. --- Makefile | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 34c25cf..8f2abfa 100644 --- a/Makefile +++ b/Makefile @@ -71,13 +71,6 @@ $(DIST_MAN_PAGE): $(DIST)/share/man/man1 $(MAN_PAGE) cp $(MAN_PAGE) $< -.PHONY: pkg -pkg: extreload_$(VERSION)_darwin-x86_64.tar.bz2 - -extreload_$(VERSION)_darwin-x86_64.tar.bz2: dist - tar cjv -s /dist/extreload_$(VERSION)_darwin-x86_64/ -f $@ dist - - bundle: extreload.asd src/*.lisp mkdir -p lib/extreload cp -a extreload.asd src lib/extreload/ @@ -90,6 +83,21 @@ bundle/bundled-local-projects/0000/extreload/extreload: bundle --eval '(quit)' +.PHONY: pkg +pkg: extreload_$(VERSION).tar.bz2 + +extreload_$(VERSION).tar.bz2: bundle extreload.asd src/*.lisp + git archive \ + --prefix=extreload_$(VERSION)/ \ + --output=extreload_$(VERSION).tar \ + HEAD + tar -r \ + -s ,bundle,extreload_$(VERSION)/bundle, \ + -f extreload_$(VERSION).tar \ + bundle + bzip2 extreload_$(VERSION).tar + + .PHONY: install install: bundle/bundled-local-projects/0000/extreload/extreload $(MAN_PAGE) install -m 755 bundle/bundled-local-projects/0000/extreload/extreload $(DESTDIR)$(bindir) -- cgit v1.2.3 From 78cffb2b919e10a675bec6bfebf94a84f58aad0a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:16:04 +0200 Subject: extreload.asd: Turn off SSL in `websocket-driver-client` SSL is unnecessary for our purposes, and including it causes a runtime error when the path to `libcrypto.dylib` is different on the executing machine than it is on the build machine. This is the error I got when running `extreload` on an Apple Silicon machine with Homebrew, using a package bundled by an x86 machine with Homebrew: $ extreload debugger invoked on a SIMPLE-ERROR in thread #: Error opening shared object "/usr/local/opt/openssl/lib/libcrypto.dylib": dlopen(/usr/local/opt/openssl/lib/libcrypto.dylib, 0x000A): tried: '/usr/local/opt/openssl/lib/libcrypto.dylib' (no such file). Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL. restarts (invokable by number or by possibly-abbreviated name): 0: [CONTINUE ] Skip this shared object and continue. 1: [RETRY ] Retry loading this shared object. 2: [CHANGE-PATHNAME] Specify a different pathname to load the shared object from. 3: [ABORT ] Exit from the current thread. (SB-SYS:DLOPEN-OR-LOSE #S(SB-ALIEN::SHARED-OBJECT :PATHNAME #P"/usr/local/opt/openssl/lib/libcrypto.dylib" :NAMESTRING "/usr/local/opt/openssl/lib/libcrypto.dylib" :HANDLE NIL :DONT-SAVE NIL)) 0] --- extreload.asd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extreload.asd b/extreload.asd index 19e736d..5d1e2cb 100644 --- a/extreload.asd +++ b/extreload.asd @@ -16,6 +16,11 @@ ;;; along with Extreload. If not, see . +;; SSL is not required for Extreload. Including it can cause a dynamic library +;; load path error if the runtime paths are different from those on the build +;; machine. +(push :websocket-driver-no-ssl *features*) + (asdf:defsystem extreload :version "0.0.2" :depends-on (:jsown -- cgit v1.2.3 From ab47e8726d57daa115f3d292a40a36fa1e768818 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:25:33 +0200 Subject: Update copyright dates after bundle changes --- Makefile | 2 +- bundle.lisp | 18 ++++++++++++++++++ extreload.asd | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8f2abfa..c070882 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Teddy Wing +# Copyright (c) 2021–2022 Teddy Wing # # This file is part of Extreload. # diff --git a/bundle.lisp b/bundle.lisp index c5e9c66..6bc04ac 100644 --- a/bundle.lisp +++ b/bundle.lisp @@ -1,3 +1,21 @@ +;;; Copyright (c) 2022 Teddy Wing +;;; +;;; This file is part of Extreload. +;;; +;;; Extreload is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; Extreload is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Extreload. If not, see . + + (setf ql:*local-project-directories* '("./lib")) (let ((dependencies (append diff --git a/extreload.asd b/extreload.asd index 5d1e2cb..d0c943f 100644 --- a/extreload.asd +++ b/extreload.asd @@ -1,4 +1,4 @@ -;;; Copyright (c) 2021 Teddy Wing +;;; Copyright (c) 2021–2022 Teddy Wing ;;; ;;; This file is part of Extreload. ;;; -- cgit v1.2.3 From 9bff543aefa274a7a2362802c9c78e1b672d5ce3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:35:31 +0200 Subject: option.lisp: Define version string at compile time Otherwise we get a runtime error when running the binary on a different machine than the one that built it: $ extreload -V error: Failed to find the WRITE-DATE of /private/tmp/extreload-20220825-3720-17mi6k3/extreload_0.0.2/bundle/local-projects/: No such file or directory --- src/option.lisp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/option.lisp b/src/option.lisp index 2a4721f..5848a8d 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -60,6 +60,8 @@ with code `exit-code`." `condition` and exits with EX_USAGE." (exit-with-error condition sysexits:+usage+)) +(defconstant *version* (asdf:component-version (asdf:find-system :extreload))) + (defun parse-options () "Parse command line options." (multiple-value-bind (options free-args) @@ -79,7 +81,7 @@ with code `exit-code`." (opts:exit sysexits:+usage+)) (when-option (options :version) - (format t "~a~%" (asdf:component-version (asdf:find-system :extreload))) + (format t "~a~%" *version*) (opts:exit sysexits:+ok+)) -- cgit v1.2.3 From 186ebc945392931844270b71ce73e3c5b1d0189a Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Aug 2022 21:38:16 +0200 Subject: option.lisp: Update copyright year --- src/option.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/option.lisp b/src/option.lisp index 5848a8d..5b01ca8 100644 --- a/src/option.lisp +++ b/src/option.lisp @@ -1,6 +1,6 @@ ;;;; Command line options. -;;; Copyright (c) 2021 Teddy Wing +;;; Copyright (c) 2021–2022 Teddy Wing ;;; ;;; This file is part of Extreload. ;;; -- cgit v1.2.3