changelog shortlog graph tags branches files raw help

Mercurial > infra / changeset: add ublksrv and blake3

changeset 256: 9d6a767d72f0
parent 255: ad70dec68fa1
child 257: f4376b952d35
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 14 Jun 2024 20:36:18 +0000
files: autogen.lisp bootstrap.sh infra.asd scripts/get-blake3.sh scripts/get-ublksrv.sh skelfile
description: add ublksrv and blake3
     1.1--- a/autogen.lisp	Fri Jun 14 19:20:13 2024 +0000
     1.2+++ b/autogen.lisp	Fri Jun 14 20:36:18 2024 +0000
     1.3@@ -26,6 +26,7 @@
     1.4                         (unless (probe-file hcfg)
     1.5                           (print #0$./check.sh$#))
     1.6                         hcfg)))
     1.7+
     1.8 (defun gethost (k) (getf *host* k))
     1.9 (defun getprofile (k) (getf *profile* k))
    1.10 (init-skel-vars)
    1.11@@ -43,6 +44,7 @@
    1.12   "Auto-generate the INFRA system."
    1.13   (info! "starting autogen.lisp" sb-ext:*core-pathname*)
    1.14   (terpri)
    1.15+  ;; print host, env, profile
    1.16   (format t "core: ~A~%" *core*)
    1.17   (terpri)
    1.18   (println "host:")
    1.19@@ -55,17 +57,21 @@
    1.20   (println "profile:")
    1.21   (loop for (k v) on *profile* by 'cddr
    1.22         do (format t "  ~A = ~A~%" k v))
    1.23-
    1.24-;;; init stash (via skel)
    1.25-  (sk-call* *skel-project* :clean :src)
    1.26-
    1.27+  ;; 
    1.28+  (sk-call* *skel-project* :clean :bootstrap)
    1.29   (let ((rocksdb-builder (sb-thread:make-thread (lambda () (sk-call* *skel-project* :rocksdb))))
    1.30         (sbcl-builder (sb-thread:make-thread (lambda () (sk-call* *skel-project* :sbcl :sbcl-shared))))
    1.31         (archlinux-pod-builder (sb-thread:make-thread (lambda () (sk-call *skel-project* :archlinux :operator))))
    1.32         (alpine-pod-builder (sb-thread:make-thread (lambda () (sk-call *skel-project* :alpine :worker)))))
    1.33     (std/thread:wait-for-threads
    1.34      (list rocksdb-builder sbcl-builder archlinux-pod-builder alpine-pod-builder))))
    1.35+
    1.36 ;;; *host*
    1.37+;; The host profile is generated automatically by 'check.sh'. After running
    1.38+;; the script you'll have a file HOST.sxp.
    1.39 
    1.40 ;;; *profile*
    1.41+;; The default profile is defined in 'default.sxp'. You can use that as a base
    1.42+;; configuration and override it with INFRA_PROFILE
    1.43+
    1.44 ;; (sb-ext:quit)
     2.1--- a/bootstrap.sh	Fri Jun 14 19:20:13 2024 +0000
     2.2+++ b/bootstrap.sh	Fri Jun 14 20:36:18 2024 +0000
     2.3@@ -19,23 +19,36 @@
     2.4     exit 1
     2.5   fi
     2.6   ensure mkdir -p "${_stash}/src"
     2.7+  ensure mkdir -p "${_stash}/share/lisp/fasl"
     2.8   ensure mkdir -p "${_stash}/bin"
     2.9+  ensure mkdir -p "${_stash}/lib"
    2.10+  ensure mkdir -p "${_stash}/include"
    2.11+  ensure mkdir -p "${_stash}/pack"
    2.12   cd "${_stash}"
    2.13   hg clone https://vc.compiler.company/comp/core src/core
    2.14-  local _sbcl_url="${_url}/pack/sbcl.tar.zst"
    2.15-  local _rocksdb_url="${_url}/pack/rocksdb.tar.zst"
    2.16-  local _core_url="${_url}/pack/core.tar.zst"
    2.17-  ensure download "$_sbcl_url" "sbcl.tar.zst" "$_arch"
    2.18-  unzstd "sbcl.tar.zst"
    2.19-  tar -xvf "sbcl.tar"
    2.20-  ensure download "$_rocksdb_url" "rocksdb.tar.zst" "$_arch"
    2.21-  unzstd "rocksdb.tar.zst"
    2.22-  tar -xvf "rocksdb.tar"
    2.23-  chmod +x bin/*
    2.24-  say "${_stash}/src/sbcl"
    2.25-  say "${_stash}/src/rocksdb"
    2.26-  say "${_stash}/bin/cl"
    2.27-  rm -rf *.tar*
    2.28+  local _sbcl_pack="pack/sbcl.tar.zst"
    2.29+  local _rocksdb_pack="pack/rocksdb.tar.zst"
    2.30+  local _core_pack="pack/core.tar.zst"
    2.31+  local _sbcl_url="${_url}/${_sbcl_pack}"
    2.32+  local _rocksdb_url="${_url}/${_rocksdb_pack}"
    2.33+  local _core_url="${_url}/${_core_pack}"
    2.34+  ensure download "$_sbcl_url" "$_sbcl_pack" "$_arch"
    2.35+  unzstd "${_sbcl_pack}"
    2.36+  tar -xvf "pack/sbcl.tar"
    2.37+  cd sbcl && INSTALL_ROOT=$(realpath ..) sh install.sh && cd ..
    2.38+  ensure download "$_rocksdb_url" "${_rocksdb_pack}" "$_arch"
    2.39+  unzstd "${_rocksdb_pack}"
    2.40+  tar -xvf "pack/rocksdb.tar"
    2.41+  mv rocksdb/include/* include/
    2.42+  mv rocksdb/*.so lib/
    2.43+  ensure download "$_core_url" "${_core_pack}" "$_arch"
    2.44+  unzstd "${_core_pack}"
    2.45+  tar -xvf "pack/core.tar"
    2.46+  mv core/bin/* bin/
    2.47+  mv core/fasl/* share/lisp/fasl
    2.48+  # chmod +x "bin/*"
    2.49+  rm -rf core rocksdb sbcl
    2.50+  rm -rf pack/*.tar
    2.51 }
    2.52 
    2.53 _read() {
     3.1--- a/infra.asd	Fri Jun 14 19:20:13 2024 +0000
     3.2+++ b/infra.asd	Fri Jun 14 20:36:18 2024 +0000
     3.3@@ -1,5 +1,5 @@
     3.4 (defsystem :infra
     3.5-  :depends-on (:std :dat :cli :skel :log :net :packy)
     3.6+  :depends-on (:std :dat :cli :skel :log :net :packy :pod :box :organ)
     3.7   :components ((:file "autogen")
     3.8                (:file "deploy"))
     3.9   :build-pathname ".stash/bin/infra")
     4.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2+++ b/scripts/get-blake3.sh	Fri Jun 14 20:36:18 2024 +0000
     4.3@@ -0,0 +1,3 @@
     4.4+#!/usr/bin/env bash
     4.5+# get blake3 source code
     4.6+git clone https://vc.compiler.company/packy/blake3.git .stash/src/blake3
     5.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2+++ b/scripts/get-ublksrv.sh	Fri Jun 14 20:36:18 2024 +0000
     5.3@@ -0,0 +1,3 @@
     5.4+#!/usr/bin/env bash
     5.5+# get ublksrv source code
     5.6+git clone https://vc.compiler.company/packy/ublksrv.git .stash/src/ublksrv
     6.1--- a/skelfile	Fri Jun 14 19:20:13 2024 +0000
     6.2+++ b/skelfile	Fri Jun 14 20:36:18 2024 +0000
     6.3@@ -24,6 +24,7 @@
     6.4  ;; programs
     6.5  (src () #$mkdir -pv .stash/src$#)
     6.6  (bin () #$mkdir -pv .stash/bin$#)
     6.7+ (bootstrap () #$./bootstrap.sh$#)
     6.8  (emacs (src) #$./scripts/get-emacs.sh$#
     6.9         #$cd .stash/src/emacs && ./autogen.sh$#
    6.10         #$./scripts/build-emacs.sh$#)
    6.11@@ -60,6 +61,15 @@
    6.12  (xcaddy () #$go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest$#)
    6.13  (caddy-webdav (xcaddy) #$xcaddy build --output .stash/caddy --with github.com/mholt/caddy-webdav
    6.14  (rust () #$scripts/get-rust.sh$#)
    6.15+ (ublk () #$scripts/get-ublksrv.sh$#
    6.16+       #$cd .stash/src/ublksrv && autoreconf -i && ./configure && make$#)
    6.17+ (ublk-install () #$cd .stash/src/ublksrv && make install$#)
    6.18+ ;; ref: https://github.com/BLAKE3-team/BLAKE3/tree/master/c#building
    6.19+ (blake3 () #$scripts/get-blake3.sh$#
    6.20+         #$cd .stash/src/blake3/c && gcc -shared -O3 -o libblake3.so blake3.c blake3_dispatch.c blake3_portable.c \
    6.21+         blake3_sse2_x86-64_unix.S blake3_sse41_x86-64_unix.S blake3_avx2_x86-64_unix.S \
    6.22+         blake3_avx512_x86-64_unix.S$#)
    6.23+ (blake3-install () #$cd .stash/src/blake3/c && cp libblake3.so /usr/local/lib/ && cp blake3.h /usr/local/include/$#)
    6.24  ;; install
    6.25  (tree-sitter-langs (src) #$./scripts/tree-sitter-install-langs.sh$#)
    6.26  (cargo-tools () #$scripts/install-cargo-tools.sh$#)