# HG changeset patch # User Richard Westhaver # Date 1714609002 14400 # Node ID b1a96e0e3add9f8a50d9319821e01ac6de5fb1b8 # Parent f88e8a46080b80ec83a6aa480ae3bd42a30f0d71 profile in sxp only diff -r f88e8a46080b -r b1a96e0e3add .hgignore --- a/.hgignore Tue Apr 30 22:35:33 2024 -0400 +++ b/.hgignore Wed May 01 20:16:42 2024 -0400 @@ -1,4 +1,4 @@ .*[.](fasl|lock|elc|eln|scratch|tar)$ .*(target|dist|node_modules|target-trunk|build)/.* linux/linux-[0-9]+[.].*/.* -host.sxp \ No newline at end of file +.*[.]sxp \ No newline at end of file diff -r f88e8a46080b -r b1a96e0e3add bootstrap.lisp --- a/bootstrap.lisp Tue Apr 30 22:35:33 2024 -0400 +++ b/bootstrap.lisp Wed May 01 20:16:42 2024 -0400 @@ -9,23 +9,33 @@ (:use :cl :skel :log :std/named-readtables :dat/json :dat/sxp :net/fetch :net/util :cli/progress :cli/ansi :cli/ed :cli/prompt - :cli/shell :std/hash-table :std/alien)) + :cli/shell :std/hash-table :std/alien :std/macs + :std/fmt)) (in-package :infra/bootstrap) (in-readtable :shell) (eval-when (:compile-toplevel) - (defstruct host name cpus mem os kernel core) - (defparameter *config-file* (or (pathname (sb-posix:getenv "BUILD_PROFILE")) #P"default.sxp")) - (defparameter *build-config* (read-sxp-file *config-file*)) - (defparameter *host-config* (make-host :name (sb-unix:unix-gethostname) :cpus (num-cpus) :mem #+nil (mem-total) 15815828 - :os "archlinux" :kernel "linux" :core sb-ext:*core-pathname*)) + (defstruct host name cpus mem arch kernel core) + (defparameter *profile* (read-sxp-file + (if-let ((profile (sb-posix:getenv "BUILD_PROFILE"))) + profile + #P"default.sxp"))) + (defparameter *core* sb-ext:*core-pathname*) + (defparameter *host-config* (read-sxp-file + (let ((hcfg (format nil "~a.sxp" (sb-unix:unix-gethostname)))) + (unless (probe-file hcfg) + (print #0$./check.sh$#)) + hcfg))) (defparameter *env* (let ((table (make-hash-table :test 'equal)) - (keys (list "CC" "AR" "STASH" "STORE" "DIST" "PACKY_URL" "VC_URL" "PREFIX"))) + (keys (list "STASH" "STORE" "DIST" "PACKY_URL" "VC_URL" "INSTALL_PREFIX" + "CC" "AR" "HG" "GIT" "LISP" "RUST" "LD" "SHELL" "DEV" "DEV_HOME" + "DEV_ID" "WORKER" "WORKER_ID" "WORKER_HOME" "CARGO_HOME" "RUSTUP_HOME" + "LISP_HOME"))) (dolist (k keys table) (setf (gethash k table) (sb-posix:getenv k)))))) (info! "starting bootstrap.lisp") -(debug! "host:" sb-sys::*machine-version*) +(println sb-sys::*machine-version*) (trace! "env:" (hash-table-alist *env*)) ;; build-config diff -r f88e8a46080b -r b1a96e0e3add check.sh --- a/check.sh Tue Apr 30 22:35:33 2024 -0400 +++ b/check.sh Wed May 01 20:16:42 2024 -0400 @@ -11,12 +11,12 @@ need_cmd zstd need_cmd hg need_cmd git - need_cmd clang + # need_cmd clang need_cmd grep need_cmd awk need_cmd head need_cmd tail - host_config_file=host.sxp + host_config_file=$(cat /proc/sys/kernel/hostname).sxp rm -f $host_config_file check_mem local _mem_total="$RETVAL" @@ -41,12 +41,17 @@ *) _write ":ext nil" esac + print_env } say() { printf '%s\n' "$1" } +say_var() { + say "$1=$(eval echo "\$$1" 2> /dev/null)" +} + _write() { say "$1" >> $host_config_file } @@ -395,4 +400,29 @@ fi } +print_env () { + say_var STASH + say_var STORE + say_var DIST + say_var PACKY_URL + say_var VC_URL + say_var INSTALL_PREFIX + say_var CC + say_var AR + say_var HG + say_var GIT + say_var LISP + say_var RUST + say_var LD + say_var SHELL + say_var DEV + say_var DEV_HOME + say_var ID + say_var WORKER + say_var WORKER_ID + say_var WORKER_HOME + say_var CARGO_HOME + say_var RUSTUP_HOME +} + main "$@" || exit 1 diff -r f88e8a46080b -r b1a96e0e3add default.sxp --- a/default.sxp Tue Apr 30 22:35:33 2024 -0400 +++ b/default.sxp Wed May 01 20:16:42 2024 -0400 @@ -1,13 +1,12 @@ ;; -*- mode:skel -*- -:sbcl-version "2.4.4" -:stash ".stash" -:dist nil -:install-root "/usr/local" -:log-level :debug -:features -(:sbcl - :sbcl-docs - :rust :cargo-tools - :tree-sitter :tree-sitter-langs - :skel :packy - :emacs-mini) +:sbcl-version "2.4.4" ;; SBCL is always required for bootstrap + +:stash ".stash" ;; local build stash + +:dist nil ;; remote distribution directory, or nil to use the stash + ;; instead + +:install-root "/usr/local" ;; default installation directory + +:log-level :debug ;; should usually be set to at least :DEBUG, set to + ;; :TRACE or T for verbose output diff -r f88e8a46080b -r b1a96e0e3add install.sh --- a/install.sh Tue Apr 30 22:35:33 2024 -0400 +++ b/install.sh Wed May 01 20:16:42 2024 -0400 @@ -2,21 +2,18 @@ set -eu main() { downloader --check - need_cmd uname - need_cmd mktemp - need_cmd chmod - need_cmd mkdir - need_cmd rm - need_cmd rmdir + get_architecture || return 1 local _arch="$RETVAL" assert_nz "$_arch" "arch" + local _ext="" case "$_arch" in *windows*) _ext=".exe" ;; esac + local _url="https://packy.compiler.company/dist/${_arch}/cc-install${_ext}" local _dir if ! _dir="$(ensure mktemp -d)"; then @@ -25,7 +22,8 @@ exit 1 fi local _file="${_dir}/cc-install${_ext}" - printf '%s\n' 'info: installing artifacts...' 1>&2 + + printf '%s\n' 'info: starting cc-install...' 1>&2 ensure mkdir -p "$_dir" ensure downloader "$_url" "$_file" "$_arch" ensure chmod u+x "$_file" diff -r f88e8a46080b -r b1a96e0e3add profile.sh --- a/profile.sh Tue Apr 30 22:35:33 2024 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -#!/bin/sh