changelog shortlog graph tags branches files raw help

Mercurial > core / changeset: skel upgrades, added skel/net

changeset 663: cc89b337384b
parent 662: a53be64410c5
child 664: 4d8451fe5423
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 21 Sep 2024 22:58:22 -0400
files: emacs.sk lisp.sk lisp/bin/skel.lisp lisp/lib/skel/comp/asd.lisp lisp/lib/skel/comp/cargo.lisp lisp/lib/skel/comp/container.lisp lisp/lib/skel/comp/dir-locals.lisp lisp/lib/skel/comp/makefile.lisp lisp/lib/skel/comp/org.lisp lisp/lib/skel/core/obj.lisp lisp/lib/skel/core/pkg.lisp lisp/lib/skel/core/print.lisp lisp/lib/skel/core/proto.lisp lisp/lib/skel/net/client.lisp lisp/lib/skel/net/pkg.lisp lisp/lib/skel/net/server.lisp lisp/lib/skel/pkg.lisp lisp/lib/skel/skel.asd lisp/lib/skel/tests.lisp lisp/lib/skel/tools/pkg.lisp
description: skel upgrades, added skel/net
     1.1--- a/emacs.sk	Sat Sep 21 18:18:14 2024 -0400
     1.2+++ b/emacs.sk	Sat Sep 21 22:58:22 2024 -0400
     1.3@@ -2,4 +2,26 @@
     1.4 :name "core/emacs"
     1.5 :path "emacs"
     1.6 ;; :components ((:org "babel"))
     1.7-:rules ()
     1.8\ No newline at end of file
     1.9+:bind ((dotemacs (merge-pathnames ".emacs.d/" (user-homedir-pathname)))
    1.10+       (config () (directory "emacs/*.el"))
    1.11+       (lib () (directory "emacs/lib/*.el")))
    1.12+:rules 
    1.13+((install ()
    1.14+          (mapcar
    1.15+           (lambda (el)
    1.16+             (std:with-open-files
    1.17+                 ((in el :direction :input)
    1.18+                  (out (merge-pathnames (file-namestring el) dotemacs) :direction :output))
    1.19+               (std:copy-stream in out :finish-output t)))
    1.20+           config)
    1.21+          (mapcar
    1.22+           (lambda (el)
    1.23+             (std:with-open-files
    1.24+                 ((in el :direction :input)
    1.25+                  (out (merge-pathnames (file-namestring el) 
    1.26+                                        (ensure-directories-exist 
    1.27+                                         (merge-pathnames "lib/" dotemacs))) 
    1.28+                       :direction :output))
    1.29+               (std:copy-stream in out :finish-output t)))
    1.30+           lib)))
    1.31+                 
     2.1--- a/lisp.sk	Sat Sep 21 18:18:14 2024 -0400
     2.2+++ b/lisp.sk	Sat Sep 21 22:58:22 2024 -0400
     2.3@@ -3,7 +3,8 @@
     2.4 :src "lisp"
     2.5 :description "CC Lisp Core"
     2.6 :components
     2.7-((:lisp-system "prelude.asd")
     2.8- (:lisp-system "user.asd")
     2.9- (:lisp-system "core.asd")
    2.10- (:lisp-system "std/std.asd"))
    2.11+((:asd "prelude")
    2.12+ (:asd "user")
    2.13+ (:asd "core")
    2.14+ (:mod "std" (:asd "std")))
    2.15+       
     3.1--- a/lisp/bin/skel.lisp	Sat Sep 21 18:18:14 2024 -0400
     3.2+++ b/lisp/bin/skel.lisp	Sat Sep 21 22:58:22 2024 -0400
     3.3@@ -59,7 +59,7 @@
     3.4 	#P".")
     3.5     :load t)))
     3.6 
     3.7-#+tools
     3.8+#+gui
     3.9 (defcmd skc-view
    3.10   (if *args* 
    3.11       (let ((stuff (loop for a in *args*
    3.12@@ -132,7 +132,7 @@
    3.13 (defcmd skc-show
    3.14   (if *args*
    3.15       (mapc (lambda (x) (when-let ((ret (sk-slot-case x))) (println ret))) *args*)
    3.16-      (describe (if (boundp '*skel-project*) *skel-project*
    3.17+      (sk-print (if (boundp '*skel-project*) *skel-project*
    3.18                     (if (boundp '*skel-user-config*) *skel-user-config*
    3.19                         (if (boundp '*skel-system-config*) *skel-system-config*
    3.20                             (skel-simple-error "skel config files not installed")))))))
     4.1--- a/lisp/lib/skel/comp/asd.lisp	Sat Sep 21 18:18:14 2024 -0400
     4.2+++ b/lisp/lib/skel/comp/asd.lisp	Sat Sep 21 22:58:22 2024 -0400
     4.3@@ -12,7 +12,7 @@
     4.4 ;;; Code:
     4.5 (in-package :skel/comp/asd)
     4.6 
     4.7-(defclass sk-lisp-system (sk-module asdf:system)
     4.8+(defclass sk-lisp-system (sk-mod asdf:system)
     4.9   ;; these slots are inferred in ASDF:SYSTEM. Since we are primarily concerned
    4.10   ;; with generating ASDF:SYSTEM definitions rather than parsing them we restore them here.
    4.11   ((serial :initform nil :type boolean :accessor sk-lisp-system-serial)
    4.12@@ -43,9 +43,12 @@
    4.13 (defmethod sk-load ((self sk-lisp-system) &key force force-not verbose version)
    4.14   (asdf:load-system self :force force :force-not force-not :verbose verbose :version version))
    4.15 
    4.16-(defmethod sk-load-component ((kind (eql :lisp-system)) (form pathname) &optional (path *default-pathname-defaults*))
    4.17+(defmethod sk-load-component ((kind (eql :asd)) (form pathname) &optional (path *default-pathname-defaults*))
    4.18   (declare (ignore kind))
    4.19-  (parse-sk-lisp-system (pathname-name form) (merge-pathnames form path)))
    4.20+  (let* ((type (pathname-type form))
    4.21+         (name (namestring (if type (pathname-name form) form)))
    4.22+         (fname (if type form (make-pathname :name name :type "asd"))))
    4.23+    (parse-sk-lisp-system name (merge-pathnames fname path))))
    4.24 
    4.25 (defmethod sk-compile ((self sk-lisp-system) &key force force-not verbose version &allow-other-keys)
    4.26   (asdf:compile-system self :force force :force-not force-not :verbose verbose :version version))
     5.1--- a/lisp/lib/skel/comp/cargo.lisp	Sat Sep 21 18:18:14 2024 -0400
     5.2+++ b/lisp/lib/skel/comp/cargo.lisp	Sat Sep 21 22:58:22 2024 -0400
     5.3@@ -12,7 +12,7 @@
     5.4 (defparameter *default-cargo-manifest* "Cargo.toml")
     5.5 (defparameter *cargo-manifest-extension* "toml")
     5.6 
     5.7-(defclass sk-rust-system (sk-module)
     5.8+(defclass sk-rust-system (sk-mod)
     5.9   ())
    5.10 
    5.11 (defclass sk-rust-component (sk-component)
     6.1--- a/lisp/lib/skel/comp/container.lisp	Sat Sep 21 18:18:14 2024 -0400
     6.2+++ b/lisp/lib/skel/comp/container.lisp	Sat Sep 21 22:58:22 2024 -0400
     6.3@@ -29,7 +29,7 @@
     6.4   (declare (ignore kind))
     6.5   (sk-convert (deserialize
     6.6                (make-pathname :name *default-containerfile* :type (namestring name)
     6.7-                              :directory path)
     6.8+                              :directory (namestring path))
     6.9                :containerfile)))
    6.10 
    6.11 (defmethod sk-write-file ((self sk-containerfile) &key path)
     7.1--- a/lisp/lib/skel/comp/dir-locals.lisp	Sat Sep 21 18:18:14 2024 -0400
     7.2+++ b/lisp/lib/skel/comp/dir-locals.lisp	Sat Sep 21 22:58:22 2024 -0400
     7.3@@ -16,4 +16,4 @@
     7.4 (defmethod sk-load-component ((kind (eql :dir-locals)) (form pathname) &optional (path *default-pathname-defaults*))
     7.5   (declare (ignore kind))
     7.6   (sk-new :dir-locals :ast (read-sxp-file (make-pathname :name (namestring form) :type "el"
     7.7-                                                         :directory path))))
     7.8+                                                         :directory (namestring path)))))
     8.1--- a/lisp/lib/skel/comp/makefile.lisp	Sat Sep 21 18:18:14 2024 -0400
     8.2+++ b/lisp/lib/skel/comp/makefile.lisp	Sat Sep 21 22:58:22 2024 -0400
     8.3@@ -39,9 +39,9 @@
     8.4 
     8.5 ;; https://www.gnu.org/software/make/manual/html_node/Makefile-Contents.html
     8.6 (defclass makefile (skel sk-meta)
     8.7-  ((directives :initform (make-array 0 :element-type 'sk-command :adjustable t :fill-pointer 0) 
     8.8-	       :type (vector sk-command) :accessor mk-directives)
     8.9-   (variables :initform (make-hash-table) 
    8.10+  ((directives :initform (make-array 0 :adjustable t :fill-pointer 0)
    8.11+	       :type (vector list) :accessor mk-directives)
    8.12+   (variables :initform (make-hash-table)
    8.13 	      :type (hash-table) :accessor mk-vars)
    8.14    (explicit :initform (make-array 0 :element-type 'sk-rule :adjustable t :fill-pointer 0)
    8.15 	     :type (vector sk-rule) :accessor mk-erules)
    8.16@@ -54,7 +54,7 @@
    8.17       (vector-push-extend self (mk-irules place))
    8.18       (vector-push-extend self (mk-erules place))))
    8.19 
    8.20-(defmethod push-mk-directive ((self sk-command) (place makefile))
    8.21+(defmethod push-mk-directive ((self list) (place makefile))
    8.22   (vector-push-extend self (mk-directives place)))
    8.23 
    8.24 (defmethod push-mk-var ((self cons) (place makefile))
    8.25@@ -67,7 +67,8 @@
    8.26     (with-slots (directives variables explicit implicit) self
    8.27       ;; directives
    8.28       (loop for d across directives
    8.29-	    do (sk-writeln d s))
    8.30+	    do (write d :stream s)
    8.31+            do (terpri s))
    8.32       ;; variables
    8.33       (maphash (lambda (x y) (format s "~A=~A~%" x y)) variables)
    8.34       ;; explicit rules
    8.35@@ -75,7 +76,8 @@
    8.36 	    do (format s "~A:~A;~A~%" 
    8.37 		       (sk-rule-target exp)
    8.38 		       (sk-rule-source exp)
    8.39-		       (sk-write-string (sk-rule-recipe exp))))
    8.40+                       (when-let ((recipe (sk-rule-recipe exp)))
    8.41+		         (sk-write-string recipe))))
    8.42       ;; TODO implicit rules
    8.43       (loop for imp across implicit
    8.44 	    do (format s "~A:~A;~A~%" 
     9.1--- a/lisp/lib/skel/comp/org.lisp	Sat Sep 21 18:18:14 2024 -0400
     9.2+++ b/lisp/lib/skel/comp/org.lisp	Sat Sep 21 22:58:22 2024 -0400
     9.3@@ -18,7 +18,7 @@
     9.4 (defmethod sk-load-component ((kind (eql :org)) (form pathname) &optional (path *default-pathname-defaults*))
     9.5   (declare (ignore kind))
     9.6   (let* ((name (namestring form))
     9.7-         (p (make-pathname :name name :type "org" :directory path))
     9.8+         (p (make-pathname :name name :type "org" :directory (namestring path)))
     9.9          (comp (sk-convert (org-parse :document p))))
    9.10     (setf (sk-name comp) name)
    9.11     (setf (sk-path comp) p)
    10.1--- a/lisp/lib/skel/core/obj.lisp	Sat Sep 21 18:18:14 2024 -0400
    10.2+++ b/lisp/lib/skel/core/obj.lisp	Sat Sep 21 22:58:22 2024 -0400
    10.3@@ -65,17 +65,50 @@
    10.4 
    10.5 ;;; Module
    10.6 
    10.7-;; Again just like ASDF, we define a SK-MODULE class which subclasses
    10.8-;; SK-COMPONENT. The SK-MODULE class is used for components which have
    10.9+;; Again just like ASDF, we define a SK-MOD class which subclasses
   10.10+;; SK-COMPONENT. The SK-MOD class is used for components which have
   10.11 ;; sub-components themselves.
   10.12 
   10.13-(defclass sk-module (sk-component sk-meta)
   10.14+(defclass sk-mod (sk-component sk-meta)
   10.15   ((components :initarg :components :accessor sk-components)))
   10.16 
   10.17+(defun make-sk-mod (form)
   10.18+  "Make a new SK-MOD."
   10.19+  (if (listp form)
   10.20+      (apply #'make-instance 'sk-mod
   10.21+             (let ((name (pop form))
   10.22+                   (components 
   10.23+                     (mapcar 
   10.24+                      (lambda (f)
   10.25+                        (sk-load-component (car f) (cdr f)))
   10.26+                      form)))
   10.27+               `(:name ,name :components ,components)))
   10.28+      (make-instance 'sk-mod :name form :components nil)))
   10.29+  
   10.30+(defmethod sk-new ((self (eql :mod)) &key form path)
   10.31+  (let ((mod (make-sk-mod form)))
   10.32+    (when path (setf (sk-path mod) path))
   10.33+    mod))
   10.34+
   10.35+(defmethod sk-load-component ((kind (eql :mod)) (form t) &optional (path *default-pathname-defaults*))
   10.36+  (sk-new kind :form form :path path))
   10.37+
   10.38 ;;; Script
   10.39+
   10.40+;; Scripts are always assumed to point to an executable file. They can be ran
   10.41+;; directly with SK-RUN.
   10.42+
   10.43 (defclass sk-script (sk-component sk-meta sxp)
   10.44   ((kind :initform nil :initarg :kind :type (or null script-designator) :accessor sk-kind)))
   10.45 
   10.46+(defmethod sk-new ((self (eql :script)) &key form path)
   10.47+  (let ((script (make-sk-script form)))
   10.48+    (setf (sk-path script) path)
   10.49+    script))
   10.50+
   10.51+(defmethod sk-load-component ((kind (eql :script)) (form t) &optional (path *default-pathname-defaults*))
   10.52+  (sk-new kind :form form :path path))
   10.53+
   10.54 (defmethod write-sxp-stream ((self sk-script) stream &key (pretty t) (case :downcase) &allow-other-keys)
   10.55   (write `(,(sk-path self)) :stream stream :pretty pretty :case case :readably t :array t :escape t))
   10.56 
   10.57@@ -102,25 +135,7 @@
   10.58 
   10.59 (defmethod print-object ((self sk-script) stream)
   10.60   (print-unreadable-object (self stream :type t)
   10.61-    (format stream "~A :~A ~A" (format-sxhash (id self)) (sk-kind self) (sk-name self))))
   10.62-
   10.63-;;; Snippet
   10.64-(defstruct sk-snippet
   10.65-  (name "" :type string)
   10.66-  (form "" :type form))
   10.67-
   10.68-(defmethod sk-new ((self (eql :snippet)) &key name form)
   10.69-  (declare (ignore self))
   10.70-  (make-sk-snippet :name name :form form))
   10.71-
   10.72-;;; Abbrev
   10.73-(defstruct sk-abbrev
   10.74-  (match nil :type form) 
   10.75-  (expansion nil :type form))
   10.76-
   10.77-(defmethod sk-new ((self (eql :abbrev)) &key match expansion)
   10.78-  (declare (ignore self))
   10.79-  (make-sk-abbrev :match match :expansion expansion))
   10.80+    (format stream ":~A ~A" (sk-kind self) (sk-name self))))
   10.81 
   10.82 ;;; Config
   10.83 (defclass sk-config (skel sxp) 
   10.84@@ -165,9 +180,14 @@
   10.85           (when (bound-string-p self 'store) (setf (sk-store self) (merge-pathnames (sk-store self) (sk-dir self))))
   10.86           (when (bound-string-p self 'cache) (setf (sk-cache self) (merge-pathnames (sk-cache self) (sk-dir self))))
   10.87           (when (bound-string-p self 'registry) (setf (sk-registry self) (merge-pathnames (sk-registry self) (sk-dir self))))
   10.88-          (when (bound-string-p self 'scripts) (setf (sk-scripts self)
   10.89-                                                     ;; TODO 2023-10-14: convert into list of script names
   10.90-                                                     (merge-pathnames (sk-scripts self) (sk-dir self))))
   10.91+          ;; SCRIPTS
   10.92+          (if (bound-string-p self 'scripts)
   10.93+              (if-let* ((path (probe-file (pathname (the simple-string (sk-scripts self))))))
   10.94+                       (setf (sk-scripts self)
   10.95+                             (if (directory-path-p path)
   10.96+                                 (find-files path)
   10.97+                                 (list path)))
   10.98+                       (warn! (format nil "ignoring missing scripts directory: ~A" (sk-scripts self)))))
   10.99           (unless *keep-ast* (setf (ast self) nil))
  10.100           self)
  10.101         ;; invalid ast, signal error
  10.102@@ -240,51 +260,27 @@
  10.103 (defvar *skel-user-config* nil)
  10.104 (defvar *skel-system-config* nil)
  10.105 
  10.106-;;; Command
  10.107-(defclass sk-command (skel)
  10.108-  ((body :initform nil :initarg :body :accessor sk-body)))
  10.109-
  10.110-(defmethod sk-new ((self (eql :command)) &key body)
  10.111-  (make-instance 'sk-command :body body))
  10.112-
  10.113-(defmethod sk-write ((self sk-command) stream)
  10.114-  (if (stringp (sk-body self)) (format stream "~A" (sk-body self))))
  10.115-
  10.116-(defmethod sk-write-string ((self sk-command))
  10.117-  (with-output-to-string (s)
  10.118-    (sk-write self s)))
  10.119+;;; Rule
  10.120+(defstruct (sk-rule (:constructor %make-sk-rule (target source recipe)))
  10.121+"Maps a SOURCE to a corresponding TARGET
  10.122+via the special form stored in RECIPE."
  10.123+  (target "" :type string)
  10.124+  (source nil :type list)
  10.125+  (recipe nil :type list))
  10.126 
  10.127-(defmethod sk-writeln ((self sk-command) stream)
  10.128-  (sk-write self stream)
  10.129-  (format stream "~%"))
  10.130-
  10.131-(defmethod write-sxp-stream ((self sk-command) stream &key (pretty t) (case :downcase) &allow-other-keys)
  10.132-  (write `(,@(sk-body self)) :stream stream :pretty pretty :case case :readably t :array t :escape t))
  10.133-
  10.134-(defmethod sk-run ((self sk-command))
  10.135-  (mapcar (lambda (x) (funcall x :output t))
  10.136-          (sk-body self)))
  10.137-
  10.138-;;; Rule
  10.139-(defclass sk-rule (skel)
  10.140-  ;; RESEARCH 2024-05-11: consider more options for extending target slot
  10.141-  ((target :initarg :target :type string :accessor sk-rule-target)
  10.142-   (source :initform nil :initarg :source :type list :accessor sk-rule-source)
  10.143-   (recipe :initform (make-instance 'sk-command) :initarg :recipe :type sk-command :accessor sk-rule-recipe))
  10.144-  (:documentation "Skel rules. Maps a SOURCE to a corresponding TARGET
  10.145-via the special form stored in RECIPE."))
  10.146+(declaim (inline make-sk-rule))
  10.147+(defun make-sk-rule (target &optional source recipe)
  10.148+  (%make-sk-rule (string target) source recipe))
  10.149 
  10.150 (defmethod sk-new ((self (eql :rule)) &rest args)
  10.151   (declare (ignore self))
  10.152   (apply #'sk-new 'sk-rule args))
  10.153 
  10.154-(defmethod write-sxp-stream ((self sk-rule) stream &key (pretty t) (case :downcase) &allow-other-keys)
  10.155-  (write `(,(sk-rule-target self) ,(sk-rule-source self) ,@(sk-body (sk-rule-recipe self))) :stream stream :pretty pretty :case case :readably t :array t :escape t))
  10.156+(defmethod id ((self sk-rule))
  10.157+  (sxhash (list (sk-rule-target self) (sk-rule-source self))))
  10.158 
  10.159-(defun make-sk-rule (target source recipe)
  10.160-  "Make a new SK-RULE."
  10.161-  (let ((r (make-instance 'sk-command :body recipe)))
  10.162-    (make-instance 'sk-rule :target (format nil "~(~a~)" target) :source source :recipe r)))
  10.163+(defmethod write-sxp-stream ((self sk-rule) stream &key (pretty t) (case :downcase) &allow-other-keys)
  10.164+  (write `(,(sk-rule-target self) ,(sk-rule-source self) ,@(sk-rule-recipe self)) :stream stream :pretty pretty :case case :readably t :array t :escape t))
  10.165 
  10.166 (defmethod print-object ((self sk-rule) stream)
  10.167   (print-unreadable-object (self stream :type t)
  10.168@@ -299,20 +295,20 @@
  10.169               (etypecase x
  10.170                 ((or symbol function) (funcall x :output t))
  10.171                 (t (eval x))))
  10.172-            (sk-body recipe))))
  10.173+            recipe)))
  10.174 
  10.175 (defmethod sk-write ((self sk-rule) stream)
  10.176   (with-slots (target source recipe) self
  10.177-    (write-string target) ;; target isn't typep SK-OBJECT
  10.178-    (sk-write-string source)
  10.179-    (sk-write-string recipe)))
  10.180+    (write-string (sk-rule-target target) stream) ;; target isn't typep SK-OBJECT
  10.181+    (write (sk-rule-source self) :stream stream)
  10.182+    (write (sk-rule-recipe self) :stream stream)))
  10.183 
  10.184 (defun sk-run-with-sources (obj rule)
  10.185   (when-let ((sources (sk-rule-source rule)))
  10.186     (mapcar
  10.187      (lambda (src)
  10.188        (if-let* ((sr (sk-find-rule src obj)))
  10.189-                ;; check if we need to rerun sources
  10.190+                ;; TODO: check if we need to rerun sources
  10.191                 (sk-make obj sr)
  10.192                 (warn! "unhandled source:" src "for rule:" rule)))
  10.193      sources))
  10.194@@ -368,7 +364,6 @@
  10.195    (store :initarg :store :accessor sk-store :type pathname)
  10.196    (components :initform #() :initarg :components :accessor sk-components :type (vector sk-component))
  10.197    (bind :initarg :bind :initform nil :accessor sk-bind :type list)
  10.198-   ;; (env :initarg :env :initform nil :accessor sk-env :type list)
  10.199    (phases :initarg :phases
  10.200            :initform (make-hash-table)
  10.201            :accessor sk-phases
  10.202@@ -377,10 +372,6 @@
  10.203           :initform (make-array 0 :element-type 'sk-rule :adjustable t)
  10.204           :accessor sk-rules
  10.205           :type (vector sk-rule))
  10.206-   (scripts :initarg :scripts
  10.207-            :initform (make-array 0 :element-type 'sk-script :adjustable t)
  10.208-            :accessor sk-scripts
  10.209-            :type (vector sk-script))
  10.210    (include :initarg :include
  10.211             :initform (make-array 0 :element-type 'pathname :adjustable t)
  10.212             :accessor sk-include
  10.213@@ -388,12 +379,11 @@
  10.214 
  10.215 (defmethod print-object ((self sk-project) stream)
  10.216   (print-unreadable-object (self stream :type t)
  10.217-    (format stream "~A [c=~A;i=~A;r=~A;s=~A] :id ~A"
  10.218+    (format stream "~A [c=~A;i=~A;r=~A] :id ~A"
  10.219             (sk-name self)
  10.220             (length (sk-components self))
  10.221             (length (sk-include self))
  10.222             (length (sk-rules self))
  10.223-            (length (sk-scripts self))
  10.224             (format-sxhash (id self)))))
  10.225 
  10.226 (defmethod sk-new ((self (eql :project)) &rest args)
  10.227@@ -433,6 +423,12 @@
  10.228           (let ((*default-pathname-defaults* (make-pathname :defaults (namestring *skel-path*))))
  10.229             (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (the simple-string (sk-stash self)))))
  10.230             (when (bound-string-p self 'store) (setf (sk-store self) (pathname (the simple-string (sk-store self)))))
  10.231+            ;; VC
  10.232+            (when-let ((vc (sk-vc self)))
  10.233+              (etypecase vc
  10.234+                ((or sk-vc-meta null) nil)
  10.235+                (vc-designator (setf (sk-vc self) (make-sk-vc-meta vc)))
  10.236+                (list (setf (sk-vc self) (apply #'make-sk-vc-meta vc)))))
  10.237             ;; INCLUDE
  10.238             (when-let ((include (sk-include self)))
  10.239               (setf (sk-include self) (map 'vector
  10.240@@ -446,18 +442,12 @@
  10.241             (when (slot-boundp self 'components)
  10.242               (setf (sk-components self) (map 'vector
  10.243                                               (lambda (c)
  10.244-                                                (sk-load-component (car c) (pathname (cadr c)) (namestring *default-pathname-defaults*)))
  10.245+                                                (sk-load-component 
  10.246+                                                 (car c) 
  10.247+                                                 (let ((val (cadr c)))
  10.248+                                                   (if (listp val) val (pathname val)))
  10.249+                                                 *default-pathname-defaults*))
  10.250                                               (sk-components self)))))
  10.251-          ;; SCRIPTS
  10.252-          (if (bound-string-p self 'scripts)
  10.253-              (if-let* ((path (probe-file (pathname (the simple-string (sk-scripts self))))))
  10.254-                       (setf (sk-scripts self)
  10.255-                             (if (directory-path-p path)
  10.256-                                 (find-files path)
  10.257-                                 (list path)))
  10.258-                       (warn! (format nil "ignoring missing scripts directory: ~A" (sk-scripts self)))))
  10.259-          (when-let ((scripts (sk-scripts self)))
  10.260-            (setf (sk-scripts self) (map 'vector #'make-sk-script scripts)))
  10.261           ;; ;; ENV
  10.262           ;; ;; TODO
  10.263           ;; (when-let ((env (sk-env self)))
  10.264@@ -539,14 +529,7 @@
  10.265                                recipe))
  10.266                              (make-sk-rule target source recipe))))
  10.267                      (coerce rules 'list)))
  10.268-                   '(vector sk-rule))))
  10.269-          ;; VC
  10.270-          (when-let ((vc (sk-vc self)))
  10.271-            (etypecase vc
  10.272-              ((or sk-vc-meta null) nil)
  10.273-              (vc-designator (setf (sk-vc self) (make-sk-vc-meta vc)))
  10.274-              (list (setf (sk-vc self) (apply #'make-sk-vc-meta vc)))))
  10.275-          
  10.276+                   '(vector sk-rule))))          
  10.277           (unless *keep-ast* (setf (ast self) nil))
  10.278           (setf (id self) (sxhash (cons (sk-name self) (sk-version self))))
  10.279           self)
  10.280@@ -630,5 +613,17 @@
  10.281 (defmethod sk-call ((self sk-project) (arg t))
  10.282   (sk-make self (sk-find-rule arg self)))
  10.283 
  10.284+(defmethod sk-call ((self sk-project) (arg (eql :compile)))
  10.285+  (loop for c across (sk-components self)
  10.286+        collect (sk-compile self)))
  10.287+
  10.288+(defmethod sk-call ((self sk-project) (arg (eql :build)))
  10.289+  (loop for c across (sk-components self)
  10.290+        collect (sk-build self)))
  10.291+
  10.292+(defmethod sk-call ((self sk-project) (arg (eql :load)))
  10.293+  (loop for c across (sk-components self)
  10.294+        collect (sk-load self)))
  10.295+
  10.296 (defmethod sk-call* ((self sk-project) &rest args)
  10.297   (mapcar (lambda (arg) (sk-call self arg)) args))
    11.1--- a/lisp/lib/skel/core/pkg.lisp	Sat Sep 21 18:18:14 2024 -0400
    11.2+++ b/lisp/lib/skel/core/pkg.lisp	Sat Sep 21 22:58:22 2024 -0400
    11.3@@ -80,7 +80,7 @@
    11.4    :sk-snippets :sk-snippet :sk-abbrevs :sk-abbrev
    11.5    :sk-user-config :sk-system-config
    11.6    :*skel-user-config* :*skel-system-config*
    11.7-   :sk-src :sk-component :sk-components :sk-module
    11.8+   :sk-src :sk-component :sk-components :sk-mod
    11.9    :sk-parent
   11.10    :sk-phases))
   11.11 
    12.1--- a/lisp/lib/skel/core/print.lisp	Sat Sep 21 18:18:14 2024 -0400
    12.2+++ b/lisp/lib/skel/core/print.lisp	Sat Sep 21 22:58:22 2024 -0400
    12.3@@ -24,5 +24,15 @@
    12.4 
    12.5 (sb-ext:defglobal *sk-print-dispatch-table* (sb-pretty::make-pprint-dispatch-table #() nil nil))
    12.6 
    12.7-(defmethod sk-print ((self skel))
    12.8-  (pprint (cons (keywordicate (class-name (class-of self))) (format-sxhash (obj/id:id self)))))
    12.9+(defmethod sk-print ((self skel) &key (stream t) (id t) &allow-other-keys)
   12.10+  (if id
   12.11+      (format stream "~S ~A~%" (keywordicate (class-name (class-of self))) (format-sxhash (obj/id:id self)))
   12.12+      (format stream "~S~%" (keywordicate (class-name (class-of self)))))
   12.13+  (mapcar 
   12.14+   (lambda (slot)
   12.15+     (let ((name (sb-mop:slot-definition-name slot)))
   12.16+       (when (slot-boundp self name)
   12.17+         (when-let ((val (slot-value self name)))
   12.18+           (format stream ":~A ~A~%" name val)))))
   12.19+   (sb-mop:class-direct-slots (class-of self)))
   12.20+  self)
    13.1--- a/lisp/lib/skel/core/proto.lisp	Sat Sep 21 18:18:14 2024 -0400
    13.2+++ b/lisp/lib/skel/core/proto.lisp	Sat Sep 21 22:58:22 2024 -0400
    13.3@@ -15,7 +15,7 @@
    13.4   (:documentation "Call SELF with ARG."))
    13.5 (defgeneric sk-call* (self &rest args)
    13.6   (:documentation "Call SELF with ARGS."))
    13.7-(defgeneric sk-print (self)
    13.8+(defgeneric sk-print (self &key &allow-other-keys)
    13.9   (:documentation "Print object SELF."))
   13.10 (defgeneric sk-load (self &key &allow-other-keys)
   13.11   (:documentation "Load or reload object SELF."))
    14.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2+++ b/lisp/lib/skel/net/client.lisp	Sat Sep 21 22:58:22 2024 -0400
    14.3@@ -0,0 +1,6 @@
    14.4+;;; client.lisp --- Skel Network Client
    14.5+
    14.6+;; 
    14.7+
    14.8+;;; Code:
    14.9+(in-package :skel/net/client)
    15.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2+++ b/lisp/lib/skel/net/pkg.lisp	Sat Sep 21 22:58:22 2024 -0400
    15.3@@ -0,0 +1,10 @@
    15.4+;;; skel/net/pkg.lisp --- Skel Networking
    15.5+
    15.6+;; 
    15.7+
    15.8+;;; Code:
    15.9+(defpackage :skel/net/client
   15.10+  (:use :cl :std :net :skel/core/proto :skel/core/obj))
   15.11+
   15.12+(defpackage :skel/net/server
   15.13+  (:use :cl :std :net :skel/core/proto :skel/core/obj))
    16.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2+++ b/lisp/lib/skel/net/server.lisp	Sat Sep 21 22:58:22 2024 -0400
    16.3@@ -0,0 +1,6 @@
    16.4+;;; server.lisp --- Skel Network Server
    16.5+
    16.6+;; 
    16.7+
    16.8+;;; Code:
    16.9+(in-package :skel/net/server)
    17.1--- a/lisp/lib/skel/pkg.lisp	Sat Sep 21 18:18:14 2024 -0400
    17.2+++ b/lisp/lib/skel/pkg.lisp	Sat Sep 21 22:58:22 2024 -0400
    17.3@@ -41,6 +41,10 @@
    17.4   (:use-reexport :skel/comp/asd :skel/comp/cargo :skel/comp/makefile
    17.5    :skel/comp/container :skel/comp/dir-locals :skel/comp/org))
    17.6 
    17.7+(pkg:defpkg :skel/net
    17.8+  (:use :cl :std)
    17.9+  (:use-reexport :skel/net/client :skel/net/server))
   17.10+  
   17.11 (pkg:defpkg :skel
   17.12   (:nicknames :sk)
   17.13   (:use :cl :std)
   17.14@@ -48,4 +52,4 @@
   17.15 
   17.16 (pkg:defpkg :sk-user
   17.17   (:use :cl :std :std-user :cl-user :log :sb-debug :sb-ext :net/proto/dns :net/fetch :cli/tools/sbcl :pod :cli/clap)
   17.18-  (:use :skel :skel/core :skel/comp))
   17.19+  (:use :skel :skel/core :skel/comp :skel/net))
    18.1--- a/lisp/lib/skel/skel.asd	Sat Sep 21 18:18:14 2024 -0400
    18.2+++ b/lisp/lib/skel/skel.asd	Sat Sep 21 22:58:22 2024 -0400
    18.3@@ -8,7 +8,7 @@
    18.4                      :pod :net :box
    18.5                      (:feature :ext :krypt)
    18.6                      (:feature :ext :packy)
    18.7-                     (:feature :tools :clouseau))
    18.8+                     (:feature :gui :clouseau))
    18.9   :serial t
   18.10   :components 
   18.11   ((:module "core"
   18.12@@ -33,21 +33,24 @@
   18.13      (:file "org")
   18.14      (:file "dir-locals")
   18.15      (:file "makefile")))
   18.16+   (:module "net"
   18.17+    :components
   18.18+    ((:file "pkg")
   18.19+     (:file "server")
   18.20+     (:file "client")))
   18.21    (:file "pkg")
   18.22    (:module "tools"
   18.23     :components
   18.24     ((:file "pkg")
   18.25-     (:file "deploy")
   18.26-     (:file "viz"))
   18.27-    :if-feature :tools)
   18.28+     (:file "deploy" :if-feature :deploy)
   18.29+     (:file "viz" :if-feature :gui)))
   18.30    (:module "ext"
   18.31     :components
   18.32     ((:file "pkg")
   18.33      (:file "asdf")
   18.34-     (:file "inspect" :if-feature :clouseau)
   18.35+     (:file "inspect" :if-feature :gui)
   18.36      (:file "krypt")
   18.37-     (:file "packy")
   18.38-     (:file "net"))
   18.39+     (:file "packy"))
   18.40     :if-feature :ext))
   18.41   :in-order-to ((test-op (test-op "skel/tests"))))
   18.42 
    19.1--- a/lisp/lib/skel/tests.lisp	Sat Sep 21 18:18:14 2024 -0400
    19.2+++ b/lisp/lib/skel/tests.lisp	Sat Sep 21 22:58:22 2024 -0400
    19.3@@ -43,16 +43,19 @@
    19.4   "Make sure makefiles are making out ok."
    19.5     (with-tmp-file (f :name "" :type "mk")
    19.6       (flet ((mk (&optional path) (make-instance 'makefile :name (gensym)
    19.7-							   :path (or path (pathname *tmp*)) :description "barfood"))
    19.8+							   :path (or 
    19.9+                                                                  (when path (merge-pathnames path *tmp*))
   19.10+                                                                  *tmp*)
   19.11+                                                           :description "barfood"))
   19.12 	     (src (path) (list path))
   19.13-	     (cmd (body) (make-instance 'sk-command :body body))
   19.14-	     (rule (tr sr) (make-sk-rule tr sr nil)))
   19.15+	     (cmd (&rest body) body)
   19.16+	     (rule (tr sr) (make-sk-rule (file-namestring tr) sr)))
   19.17 	(is (null (sk-write-file (mk) :if-exists :supersede :path (tmp-path "mk"))))
   19.18 	(let* ((tr1 (tmp-path "t1"))
   19.19 	       (tr2 (tmp-path "t2"))
   19.20 	       (sr (src (tmp-path "s1")))
   19.21 	       (r1 (rule tr1 sr))
   19.22-	       (r2 (rule sr tr2))
   19.23+	       (r2 (rule (car sr) (src tr2)))
   19.24 	       (mk1 (mk "test.mk")))
   19.25 	  (is (push-mk-rule r1 mk1))
   19.26 	  (is (push-mk-rule r2 mk1))
   19.27@@ -63,8 +66,9 @@
   19.28 	  (is (push-mk-var '(a b) mk1))
   19.29 	  (is (push-mk-var '(b c) mk1))
   19.30 	  ;; FIXME
   19.31-	  (is (null (sk-write-file mk1 :if-exists :supersede :path (pathname (tmp-path "mk")))))
   19.32-	  ))))
   19.33+	  (is 
   19.34+           (null 
   19.35+            (sk-write-file mk1 :if-exists :supersede :path (merge-pathnames (tmp-path "mk") *tmp*))))))))
   19.36 
   19.37 (deftest vm ()
   19.38   "EXPERIMENTAL"
    20.1--- a/lisp/lib/skel/tools/pkg.lisp	Sat Sep 21 18:18:14 2024 -0400
    20.2+++ b/lisp/lib/skel/tools/pkg.lisp	Sat Sep 21 22:58:22 2024 -0400
    20.3@@ -1,9 +1,11 @@
    20.4 (in-package :sk-user)
    20.5 
    20.6+#+gui
    20.7 (defpkg :skel/tools/viz
    20.8   (:use :cl :std :skel :dat/dot :obj/graph)
    20.9   (:export :sk-view))
   20.10 
   20.11+#+deploy
   20.12 (defpkg :skel/tools/deploy
   20.13   (:use :cl :std :skel)
   20.14   (:export))