changelog shortlog graph tags branches files raw help

Mercurial > infra / changeset: profile in sxp only

changeset 219: b1a96e0e3add
parent 218: f88e8a46080b
child 220: 2039e29599cd
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 01 May 2024 20:16:42 -0400
files: .hgignore bootstrap.lisp check.sh default.sxp install.sh profile.sh
description: profile in sxp only
     1.1--- a/.hgignore	Tue Apr 30 22:35:33 2024 -0400
     1.2+++ b/.hgignore	Wed May 01 20:16:42 2024 -0400
     1.3@@ -1,4 +1,4 @@
     1.4 .*[.](fasl|lock|elc|eln|scratch|tar)$
     1.5 .*(target|dist|node_modules|target-trunk|build)/.*
     1.6 linux/linux-[0-9]+[.].*/.*
     1.7-host.sxp
     1.8\ No newline at end of file
     1.9+.*[.]sxp
    1.10\ No newline at end of file
     2.1--- a/bootstrap.lisp	Tue Apr 30 22:35:33 2024 -0400
     2.2+++ b/bootstrap.lisp	Wed May 01 20:16:42 2024 -0400
     2.3@@ -9,23 +9,33 @@
     2.4   (:use :cl :skel :log :std/named-readtables
     2.5         :dat/json :dat/sxp :net/fetch :net/util
     2.6         :cli/progress :cli/ansi :cli/ed :cli/prompt
     2.7-        :cli/shell :std/hash-table :std/alien))
     2.8+        :cli/shell :std/hash-table :std/alien :std/macs
     2.9+        :std/fmt))
    2.10 (in-package :infra/bootstrap)
    2.11 (in-readtable :shell)
    2.12 
    2.13 (eval-when (:compile-toplevel)
    2.14-  (defstruct host name cpus mem os kernel core)
    2.15-  (defparameter *config-file* (or (pathname (sb-posix:getenv "BUILD_PROFILE")) #P"default.sxp"))
    2.16-  (defparameter *build-config* (read-sxp-file *config-file*))
    2.17-  (defparameter *host-config* (make-host :name (sb-unix:unix-gethostname) :cpus (num-cpus) :mem #+nil (mem-total) 15815828
    2.18-                                   :os "archlinux" :kernel "linux" :core sb-ext:*core-pathname*))
    2.19+  (defstruct host name cpus mem arch kernel core)
    2.20+  (defparameter *profile* (read-sxp-file
    2.21+                           (if-let ((profile (sb-posix:getenv "BUILD_PROFILE")))
    2.22+                             profile
    2.23+                             #P"default.sxp")))
    2.24+  (defparameter *core* sb-ext:*core-pathname*)
    2.25+  (defparameter *host-config* (read-sxp-file
    2.26+                               (let ((hcfg (format nil "~a.sxp" (sb-unix:unix-gethostname))))
    2.27+                                 (unless (probe-file hcfg)
    2.28+                                   (print #0$./check.sh$#))
    2.29+                                 hcfg)))
    2.30   (defparameter *env* (let ((table (make-hash-table :test 'equal))
    2.31-                      (keys (list "CC" "AR" "STASH" "STORE" "DIST" "PACKY_URL" "VC_URL" "PREFIX")))
    2.32+                            (keys (list "STASH" "STORE" "DIST" "PACKY_URL" "VC_URL" "INSTALL_PREFIX"
    2.33+                                        "CC" "AR" "HG" "GIT" "LISP" "RUST" "LD" "SHELL" "DEV" "DEV_HOME"
    2.34+                                        "DEV_ID" "WORKER" "WORKER_ID" "WORKER_HOME" "CARGO_HOME" "RUSTUP_HOME"
    2.35+                                        "LISP_HOME")))
    2.36                   (dolist (k keys table)
    2.37                     (setf (gethash k table) (sb-posix:getenv k))))))
    2.38 
    2.39 (info! "starting bootstrap.lisp")
    2.40-(debug! "host:" sb-sys::*machine-version*)
    2.41+(println sb-sys::*machine-version*)
    2.42 (trace! "env:" (hash-table-alist *env*))
    2.43 
    2.44 ;; build-config
     3.1--- a/check.sh	Tue Apr 30 22:35:33 2024 -0400
     3.2+++ b/check.sh	Wed May 01 20:16:42 2024 -0400
     3.3@@ -11,12 +11,12 @@
     3.4   need_cmd zstd
     3.5   need_cmd hg
     3.6   need_cmd git
     3.7-  need_cmd clang
     3.8+  # need_cmd clang
     3.9   need_cmd grep
    3.10   need_cmd awk
    3.11   need_cmd head
    3.12   need_cmd tail
    3.13-  host_config_file=host.sxp
    3.14+  host_config_file=$(cat /proc/sys/kernel/hostname).sxp
    3.15   rm -f $host_config_file
    3.16   check_mem
    3.17   local _mem_total="$RETVAL"
    3.18@@ -41,12 +41,17 @@
    3.19     *)
    3.20       _write ":ext nil"
    3.21   esac
    3.22+  print_env
    3.23 }
    3.24 
    3.25 say() {
    3.26   printf '%s\n' "$1"
    3.27 }
    3.28 
    3.29+say_var() {
    3.30+  say "$1=$(eval echo "\$$1" 2> /dev/null)"
    3.31+}
    3.32+
    3.33 _write() {
    3.34   say "$1" >> $host_config_file
    3.35 }
    3.36@@ -395,4 +400,29 @@
    3.37   fi
    3.38 }
    3.39 
    3.40+print_env () {
    3.41+  say_var STASH
    3.42+  say_var STORE
    3.43+  say_var DIST
    3.44+  say_var PACKY_URL
    3.45+  say_var VC_URL
    3.46+  say_var INSTALL_PREFIX
    3.47+  say_var CC
    3.48+  say_var AR
    3.49+  say_var HG
    3.50+  say_var GIT
    3.51+  say_var LISP
    3.52+  say_var RUST
    3.53+  say_var LD
    3.54+  say_var SHELL
    3.55+  say_var DEV
    3.56+  say_var DEV_HOME
    3.57+  say_var ID
    3.58+  say_var WORKER
    3.59+  say_var WORKER_ID
    3.60+  say_var WORKER_HOME
    3.61+  say_var CARGO_HOME
    3.62+  say_var RUSTUP_HOME
    3.63+}
    3.64+
    3.65 main "$@" || exit 1
     4.1--- a/default.sxp	Tue Apr 30 22:35:33 2024 -0400
     4.2+++ b/default.sxp	Wed May 01 20:16:42 2024 -0400
     4.3@@ -1,13 +1,12 @@
     4.4 ;; -*- mode:skel -*-
     4.5-:sbcl-version "2.4.4"
     4.6-:stash ".stash"
     4.7-:dist nil
     4.8-:install-root "/usr/local"
     4.9-:log-level :debug
    4.10-:features
    4.11-(:sbcl
    4.12- :sbcl-docs
    4.13- :rust :cargo-tools
    4.14- :tree-sitter :tree-sitter-langs
    4.15- :skel :packy
    4.16- :emacs-mini)
    4.17+:sbcl-version "2.4.4" ;; SBCL is always required for bootstrap
    4.18+
    4.19+:stash ".stash" ;; local build stash
    4.20+
    4.21+:dist nil ;; remote distribution directory, or nil to use the stash
    4.22+          ;; instead
    4.23+
    4.24+:install-root "/usr/local" ;; default installation directory
    4.25+
    4.26+:log-level :debug ;; should usually be set to at least :DEBUG, set to
    4.27+                  ;; :TRACE or T for verbose output
     5.1--- a/install.sh	Tue Apr 30 22:35:33 2024 -0400
     5.2+++ b/install.sh	Wed May 01 20:16:42 2024 -0400
     5.3@@ -2,21 +2,18 @@
     5.4 set -eu
     5.5 main() {
     5.6   downloader --check
     5.7-  need_cmd uname
     5.8-  need_cmd mktemp
     5.9-  need_cmd chmod
    5.10-  need_cmd mkdir
    5.11-  need_cmd rm
    5.12-  need_cmd rmdir
    5.13+
    5.14   get_architecture || return 1
    5.15   local _arch="$RETVAL"
    5.16   assert_nz "$_arch" "arch"
    5.17+
    5.18   local _ext=""
    5.19   case "$_arch" in
    5.20     *windows*)
    5.21       _ext=".exe"
    5.22       ;;
    5.23   esac
    5.24+
    5.25   local _url="https://packy.compiler.company/dist/${_arch}/cc-install${_ext}"
    5.26   local _dir
    5.27   if ! _dir="$(ensure mktemp -d)"; then
    5.28@@ -25,7 +22,8 @@
    5.29     exit 1
    5.30   fi
    5.31   local _file="${_dir}/cc-install${_ext}"
    5.32-  printf '%s\n' 'info: installing artifacts...' 1>&2
    5.33+
    5.34+  printf '%s\n' 'info: starting cc-install...' 1>&2
    5.35   ensure mkdir -p "$_dir"
    5.36   ensure downloader "$_url" "$_file" "$_arch"
    5.37   ensure chmod u+x "$_file"
     6.1--- a/profile.sh	Tue Apr 30 22:35:33 2024 -0400
     6.2+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3@@ -1,1 +0,0 @@
     6.4-#!/bin/sh