A content-addressed build store for fixpoint-linux.
fxstore reads a Dhall package set, computes the dependency closure as a least
fixed point with datalog-dafsa, assigns every package a content-addressed
store path, builds each package's typed recipe into the store, and garbage
collects unreachable artifacts. It is the storage + build layer of a
Nix-like, but-specified-in-Dhall system.
/fx/store/<sha256-of-input-closure>-<name>
- Spec in Dhall —
package-set.dhalldefinesPackage = { name, version, src, deps, build { target, recipe } }, whererecipeis the same typedList Actionunion thatdhakeexecutes. - Closure as a fixed point —
datalog-dafsacomputes transitive reachability (closure(X) :- root(X)./closure(Y) :- closure(X), dep(X,Y).). - Content addressing — a canonical, length-delimited serialization of the full input closure is sha256'd to form the store path; a change anywhere in a package's transitive dependency graph changes its path.
- Crash-consistent store — artifacts are built into a temp dir, atomically renamed to the final path, and then the metadata transaction commits (metadata-last: a crash leaves a reapable orphan dir, never dangling metadata).
- Time travel, native —
datalog-dafsaversioned snapshots + as-of queries are available for timeline / rollback (future work).
See the fixpoint-linux design.
Git submodules, initialized via git submodule update --init --recursive:
datalog-dafsa— the engine + vendored dafsa (undervendor/)dhall-c— the Dhall interpreter core (undervendor/)palisade— the stage3 inner sandbox binary (undervendor/)dhake— the build driver (Dhakefile.dhall, underdhake/)
Requires the cosmocc toolchain.
./dhake/dhake.com # builds ./fxstore (default target)
./dhake/dhake.com test # runs every test suite
./dhake/dhake.com fxstore-golden
./dhake/dhake.com stage3 # build the palisade stage3 sandbox binary
./dhake/dhake.com clean # remove the native binariesThe native build is driven entirely by ./Dhakefile.dhall (no Makefile); the
docs-site build lives in the same buildfile (./dhake/dhake.com dist/index.html).
fxstore init [dir] # scaffold a project (worked-example package-set.dhall)
fxstore build [--store DIR] [<pkg>...] # build the closure of <pkg>... (all when none),
# print each store path
fxstore query <pkg> [--store DIR] # print <pkg>'s closure names + store path
fxstore gc <root> [--store DIR] # prune store dirs/facts unreachable from <root>build/query load package-set.dhall from the current directory.
The two executing recipe actions (Shell, Run) run under
bwrap
(--unshare-all --die-with-parent, store + toolchain ro-bound, network off).
If bwrap is absent, fxstore falls back to plain fork/exec with a loud
non-hermetic warning. The pure-FS actions (Copy, Mkdir, …) run in-process
under a trusted-author model in v1 (the package-set author is trusted).
MIT.