skel

skel is the primary build tool for contributors and serves a similar role to language-agnostic build tools like GNU Make, but with the features and ease-of-use of language-specific build tools like Rust's Cargo.

features

configuration

The skel tool can be configured at runtime using the CLI flags, or via local configuration files. The configuration files are in the skelfile format and are assigned the following locations by default:

*default-user-skelrc*
$HOME/.skelrc
*default-system-skelrc*
/etc/skel/skelrc

Both files are optional and the user skelrc takes precedence over system.

Example ~/.skelrc:

cat ~/.skelrc

projects

Projects are the highest-level objects int the skel system. A project consists of a list of slots which are populated automatically or by the user. Once a project is initialized the slots can be accessed and a set of high-level operations can be performed.

The easiest way to initialize a project is with a skelfile. These files are parsed as a simplified Lisp dialect and generate sk-project objects based on their contents.

The simplest project looks like this:

:name hello-world

Don't worry, this is still lisp - the parentheses are implied. All we actually need is a name to generate an object, and we can fill in the blanks later as the project develops.

Here is a more verbose example, still with only metadata:

;;; skelfile --- core skelfile -*- mode: skel; -*-
:name "core"
:author "Richard Westhaver <ellis@rwest.io>"
:version "0.1.0"
:license "MPL"
:description "The Compiler Company Core"
:vc :hg
:tags ("core")
:docs ((:org "readme") (:org "install") (:org "tests") (:org "todo"))
:import ("lisp/lisp.sk" "rust/rust.sk")

Another example with rules and components:

;;; skelfile @ 2023-10-08.02:37:25 -*- mode: skel; -*-
:name skel
:author "ellis"
:version "0.1.0"
:description "a hacker's project compiler"
:license "MPL"
:vc :hg
:tags ("lisp")
:rules ((build () (print (asdf:make :skel/cli)))
        (clean () #$rm -rf */*.fasl$#))
:docs ((:org "readme"))
:components
((:elisp "sk"))
:stash "~/dev/comp/stash"

version control

skel integrates closely with our Version Control System which is built on Mercurial, but we also interact with and host many Git repositories.

The skel tool helps us abstract away the differences between git/hg and make maximum use of their utility. When you run a skel vc command the currently active sk-project and configuration are used to determine the appropriate VC backend to call. New backends can of course be added as extensions.

TODO compilers

  • State "TODO" from [2023-12-09 Sat 19:28]

One of the most unusual features of skel is the compiler set. With the skel CLI you can compile the following types of files for your project directly from a skelfile:

  • Makefile (.mk)
  • Lisp system defs (.asd)
  • Cargo.toml
  • Containerfile
  • .hgignore/.gitignore

We treat skelfiles as the mother of all build formats and consolidate different formats into our own project DSL. This helps reduce complexity while increasing capability and portability.

Project compilation occurs on demand with the sk compile command.

TODO virtualization

  • State "TODO" from [2023-12-09 Sat 18:55]

    skel offers a mechanism for generating and running Virtual Machines (VMs) and Containers. Under the hood we depend on podman for our container runtime as well as QEMU for some functionality.

TODO emacs integration

  • State "TODO" from [2023-12-09 Sat 19:30]

sk.el is the Emacs support package for skel. It contains a skel-mode for working with skelfiles and will soon contain additional built-in integrations for project.el, vc.el, and more.

TODO deployment

  • State "TODO" from [2023-12-09 Sat 19:37]

TODO visualization

  • State "TODO" from [2023-12-09 Sat 19:37]

help

skel -h
skel v0.1.1:cc89b337384b+ --- A hacker's project compiler.

  usage: skel [global] <command> [<arg>]

options:
  -h/--help* :  print this message
  -v/--version* :  print version
  -l/--level* :  set log level (warn,info,debug,trace)
  -c/--config* :  set a custom skel user config
  -i/--input* :  input source
  -o/--output* :  output target

commands:
  init : initialize a skelfile in the current directory
    -n/--name* 
    -n/--name 
    -d/--description* 
    -p/--project name 
    -k/--kind* 
    -s/--string* 
  new : make a new skel project
    -n/--name :  project name
  describe : describe a skelfile
  show : show project slots
    -f/--file :  path to skelfile
  vc : version control
    -r/--root :  repository path
  id : print the project id
  inspect : inspect the project skelfile
    -f/--file :  path to skelfile
  make : build project targets
    -t/--target :  target to build
  run : run a script or command
  compile : compile source code
  build : build programs and libraries
  save : save a file
  dist : distribute build artifacts
  install : install stuff
  pack : pack stuff
  unpack : unpack stuff
  bundle : bundle source code
  unbundle : unbundle source code
  clean : clean up the project
  test : run tests
  bench : run benchmark
  status : print the vc status
  push : push the current project upstream
  pull : pull the current project from remote
  clone : clone a remote project
  commit : commit changes to the project vc
    -m/--message :  commit message
  edit : edit a project file in emacs.
  shell : open the sk-shell interpreter