# HG changeset patch # User ellis # Date 1685836630 14400 # Node ID 3166a511fafbd91900e52f023add5c54ecacbe8b # Parent fd19fdc77a20774e44240ef28a25372fe7056c15 notes and dockerfile init diff -r fd19fdc77a20 -r 3166a511fafb Dockerfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Dockerfile Sat Jun 03 19:57:10 2023 -0400 @@ -0,0 +1,65 @@ +ARG ROSWELL_IMAGE=fukamachi/roswell +ARG ROSWELL_VERSION +ARG OS=debian +FROM fukamachi/roswell:latest-$OS AS build-env +ARG OS +ARG VERSION +ADD https://github.com/sbcl/sbcl/archive/sbcl-$VERSION.tar.gz sbcl.tar.gz + +RUN set -x; \ + arch="$(case $(uname -m) in amd64|x86_64) echo x86-64;; aarch64) echo arm64;; *) uname -m ;; esac)"; \ + if [ "$OS" = "alpine" ]; then \ + apk add --update build-base linux-headers zstd-dev; \ + else \ + apt-get update && apt-get -y install --no-install-recommends \ + build-essential \ + zlib1g-dev \ + libzstd-dev \ + time; \ + fi; \ + ros install sbcl-bin/2.2.7 && \ + tar xvfz sbcl.tar.gz && rm sbcl.tar.gz && cd "sbcl-sbcl-${VERSION}" && \ + echo "\"$VERSION\"" > version.lisp-expr && \ + (sh make.sh \ + --with-sb-core-compression \ + "--xc-host=ros -L sbcl-bin without-roswell=t --no-rc run" \ + "--prefix=$HOME/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/" || true) \ + && sh install.sh && \ + rm -f "/root/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/lib/sbcl/sbcl.core.old" \ + && rm -f "/root/.roswell/impls/$arch/linux/sbcl-bin/$VERSION/bin/sbcl.old" \ + && find "/root/.roswell/impls/$arch/linux/sbcl-bin" -maxdepth 1 -mindepth 1 | grep -v "/sbcl-bin/$VERSION$" | xargs rm -rf || true \ + && rm -rf "/root/.roswell/impls/log" + +FROM $ROSWELL_IMAGE:$ROSWELL_VERSION-$OS +# hadolint ignore=DL3010 +COPY --from=build-env /root/.roswell/impls /root/.roswell/impls + +ARG BUILD_DATE +ARG VCS_REF +ARG OS +ARG VERSION + +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url="https://github.com/fukamachi/dockerfiles" \ + org.label-schema.version=$VERSION \ + org.label-schema.schema-version="1.0" + +# hadolint ignore=DL3018 +RUN set -x; \ + if [ "$OS" = "alpine" ]; then \ + apk add --update --no-cache zstd-libs; \ + fi; \ + printf "setup.time\t0\t%s\n" "$(( $(date +%s) + 2208988800 ))" > ~/.roswell/config && \ + printf "sbcl-bin.version\t0\t%s\n" "$VERSION" >> ~/.roswell/config && \ + printf "default.lisp\t0\tsbcl-bin\n" >> ~/.roswell/config && \ + ros setup && \ + ros -e '(mapc (function ql-dist:uninstall) (ql-dist:installed-releases t))' \ + && rm -f /root/.roswell/lisp/quicklisp/tmp/quicklisp.tar \ + && rm -rf /root/.roswell/archives/* /root/.roswell/src/sbcl-* /root/.cache/common-lisp/sbcl-*/root/.roswell/lisp/quicklisp/dists/quicklisp/software + +RUN set -x; \ + printf '#!/bin/sh\nexec ros run -- "$@"\n' > /usr/local/bin/sbcl \ + && chmod u+x /usr/local/bin/sbcl + +ENTRYPOINT ["/usr/local/bin/sbcl"] \ No newline at end of file diff -r fd19fdc77a20 -r 3166a511fafb demo.asd --- a/demo.asd Mon May 29 21:55:22 2023 -0400 +++ b/demo.asd Sat Jun 03 19:57:10 2023 -0400 @@ -26,9 +26,9 @@ (:file "ui") (:file "demo")) ;; :in-order-to ((test-op (test-op "demo/tests"))) - ;; :defsystem-depends-on (:deploy) - ;; :build-operation "deploy" - :build-pathname "out/demo" + :defsystem-depends-on (:deploy) + :build-operation "deploy-op" + :build-pathname "demo" :entry-point "demo:main") ;; (asdf:defsystem "cl-demo:tests" @@ -36,3 +36,8 @@ ;; :components ((:file "tests")) ;; :perform (test-op (o c) (symbol-call :fiveam '#:run! :cl-demo)) ;; ) + +;; (deploy:define-library cl+ssl::libssl +;; :path "/usr/local/Cellar/openssl@3/3.1.1/lib/libssl.dylib") +;; (deploy:define-library cl+ssl::libcrypto +;; :path "/usr/local/Cellar/openssl@3/3.1.1/lib/libcrypto.dylib") diff -r fd19fdc77a20 -r 3166a511fafb docs/notes.org --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/notes.org Sat Jun 03 19:57:10 2023 -0400 @@ -0,0 +1,20 @@ +* research +** [[https://github.com/screenshotbot/screenshotbot-oss][screenshotbot-oss]] +- monolithic repo, includes third-party dependencies + - full quicklisp source + - asdf, etc +- addresses many of my concerns about running CL in prod +- the repo is too heavy for my liking though +- I do like the idea of having many systems though +** DB +*** [[https://github.com/fukamachi/mito][mito]] +ORM, sqlite, postgres, mysql support +*** [[https://github.com/fukamachi/cl-dbi][cl-dbi]] +database independent interface +*** [[https://github.com/fukamachi/sxql][sxql]] +SQL generator +** LOGGING +*** [[https://github.com/sharplispers/log4cl/][log4cl]] +supports slime +** UI +[[https://mcclim.common-lisp.dev/][mcclim]] diff -r fd19fdc77a20 -r 3166a511fafb install.lisp --- a/install.lisp Mon May 29 21:55:22 2023 -0400 +++ b/install.lisp Sat Jun 03 19:57:10 2023 -0400 @@ -4,9 +4,9 @@ (let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" (user-homedir-pathname)))) (when (probe-file quicklisp-init) (load quicklisp-init))) -(load "demo.asd") + +(asdf:load-asd "cl-demo.asd") +(asdf:loadload "demo.asd") (ql:quickload :demo) -;; (asdf:load-asd "cl-demo.asd") -;; (asdf:load-system "demo") ;; (asdf:make :demo) (sb-ext:save-lisp-and-die "out/demo" :toplevel #'demo:main :executable t) diff -r fd19fdc77a20 -r 3166a511fafb makefile --- a/makefile Mon May 29 21:55:22 2023 -0400 +++ b/makefile Sat Jun 03 19:57:10 2023 -0400 @@ -1,15 +1,23 @@ -M ?= release #mode -L ?= sbcl #lisp -P ?= python3 #python -RS:Cargo.toml build.rs lib.rs obj fig +M?=release +L?=sbcl +L_C=$(L) --no-userinit +L_S=$(L) --script +P?=python3 +ARCH?= +A_C=ifeq ($(ARCH),x86_64) A_C=arch -$(ARCH) endif +.PHONY: +RS:Cargo.toml build.rs lib.rs obj CL:*.asd *.lisp +deps:; clean:;rm -rf *.fasl;cargo clean fmt:$(RS);cargo fmt -build:$(RS) $(CL);cargo build --$(M);$L --script install.lisp +build:$(RS) $(CL);cargo build --$(M);$L --load demo.asd \ + --eval '(ql:quickload :demo)' \ + --eval '(asdf:make :demo)' \ + --eval '(quit)' ffi:build;cp target/$(M)/libdemo.dylib ffi;cd ffi;$(P) ffi/build.py docs:$(RS);cargo doc test:$(RS) $(CL);cargo test;$L tests.lisp #pack:;scripts/pack.ros #check:;scripts/check.ros ci:clean fmt build ffi docs test; -.PHONY:build diff -r fd19fdc77a20 -r 3166a511fafb pkg.lisp --- a/pkg.lisp Mon May 29 21:55:22 2023 -0400 +++ b/pkg.lisp Sat Jun 03 19:57:10 2023 -0400 @@ -2,7 +2,7 @@ demo > (demo:main) |# -(defpackage #:demo +(defpackage :demo (:use #:cl #:cffi) (:local-nicknames ;; (#:rdb #:cl-rocksdb)