oxilean-build
Build System and Package Manager for OxiLean
oxilean-build implements the OxiLean build system and package manager. It handles package manifest parsing, dependency resolution (using a PubGrub-style algorithm), incremental compilation with content fingerprinting, DAG-based parallel build scheduling, remote caching, and package registry integration.
The design is intentionally analogous to Cargo: OxiLean projects declare their dependencies in a manifest file, and oxilean-build resolves, fetches, and compiles them in the correct order.
26,070 SLOC -- fully implemented build system (199 source files, 632 tests passing).
Part of the OxiLean project -- a Lean-compatible theorem prover implemented in pure Rust.
Overview
Module Reference
| Module | Description |
|---|---|
manifest |
Package manifest parsing and metadata validation |
resolver |
PubGrub-style version constraint solver |
incremental |
Incremental compilation with content-based fingerprinting |
opt_incremental |
Optimised incremental strategies (e.g. per-declaration caching) |
executor |
DAG-based parallel build job scheduler |
registry |
Package registry client (fetch, publish, search) |
remote_cache |
Remote build cache integration |
cache_eviction |
LRU / size-based local cache eviction policies |
scripts |
Custom build scripts and pre/post-build hooks |
distributed |
Distributed build coordination |
analytics |
Build telemetry and performance analytics |
Build Configuration
use BuildConfig;
// Debug build (default)
let config = default;
// Release build with 8 parallel jobs
let config = release.with_jobs.verbose;
Build Profiles
| Profile | Description |
|---|---|
Debug |
Fast compilation, full debug information, no optimisation |
Release |
Optimised output, stripped debug info |
Test |
Like debug but with test harness enabled |
Bench |
Like release but with benchmarking harness |
Incremental Compilation
Content-based fingerprinting means only changed declarations are recompiled:
File A.oxilean (unchanged hash) -> skip
File B.oxilean (hash changed) -> recompile B and all dependents
Fingerprints are stored in the build cache directory alongside compiled .olean-equivalent artefacts.
Dependency Resolution
The resolver takes a set of version constraints from manifests and finds a consistent assignment:
my-project:
depends: oxilean-std >= 0.1.1, < 0.2.0
my-lib >= 1.2.3
Resolution -> oxilean-std@0.1.1, my-lib@1.5.0
Usage
Add to your Cargo.toml:
[]
= "0.1.1"
Running a Build
use ;
let config = release.with_jobs;
let executor = new;
executor.build?;
Resolving Dependencies
use Resolver;
let mut resolver = new;
resolver.add_constraint;
let solution = resolver.solve?;
Dependencies
oxilean-kernel-- kernel types for compiled artefact representationoxilean-parse-- surface AST for dependency extraction from source files
Testing
License
Copyright COOLJAPAN OU (Team Kitasan). Apache-2.0 -- See LICENSE for details.