Skip to content

Mitts 0.2.0

Choose a tag to compare

@alex09x alex09x released this 18 Oct 04:26
· 393 commits to main since this release

Mitts 0.2.0 is the first release built on the native engine. Mitts plans the Cargo workspace itself and calls rustc directly. Each compile action is keyed by its full set of inputs and stored once in a machine-wide immutable cache. Any workspace, worktree or branch that needs the action restores it from there.

This release is meant to be tested against. It is not published to crates.io.

Engine and cache

  • Native DAG executor. Mitts calls rustc directly and pipelines on .rmeta. A managed jobserver keeps build scripts and compilers inside one shared token pool.
  • Path-independent action keys for workspace crates and pure proc-macros. Worktrees and clones of the same commit share artifacts.
  • Package identity is (name, version, source). Two packages with the same name and version from different sources no longer collide.
  • Per-unit input tracking. Inputs come from dep-info extras and dynamic keys for transitively dependent units. Unknown or unhashable inputs fail closed and the unit is rebuilt.
  • Build-script results are cached in the content-addressed store. OUT_DIR purity is checked against the unit's dep-info, and cached entries are read-only.
  • Fast no-op path. A clean rebuild with no changes skips planning when every tracked input is unchanged.
  • target/mitts/ is the only directory Mitts writes to. The Cargo registry is read-only. Fetched sources are published atomically into Mitts' own store.

Commands

  • build / check / clippy
    • Cargo package, target and feature selectors, --workspace and --all-targets.
    • check emits metadata only for non-host units.
    • clippy runs the driver and user arguments on primary targets only, including the package's build.rs.
  • test
    • Integration tests, custom harnesses (harness = false), doctests, filters, runner arguments.
    • --workspace and --exclude.
    • Cargo-compatible CARGO_BIN_EXE_<name> and CARGO_TARGET_TMPDIR.
  • run. Honours default-run, sets the Cargo package environment and the dynamic-library search path.
  • coverage. Respects workspace selection and --no-fail-fast.
  • fmt. Formats target roots only and inherits each package's edition.
  • explain. Shows the plan and action keys (--keys) and why a unit missed the cache.
  • fetch.
    • Parallel download and unpack into Mitts' own store, with an atomic .mitts-ok publish.
    • Git dependencies without a local checkout are reported as errors instead of being built from crates.io sources.
  • gc.
    • Builds, tests, runs and coverage hold a cache-wide lease, so the collector never prunes artifacts in use.
    • Temporary files are only removed after an age threshold.
  • clean. Deletes only directories carrying Mitts' ownership marker. It refuses /, $HOME, the project and workspace roots and their ancestors.

Cargo compatibility

  • Profiles: opt-level, debug, debug-assertions, overflow-checks, panic, lto, rpath, with separate host and target settings.
  • Flags: RUSTFLAGS / CARGO_ENCODED_RUSTFLAGS, [build] and [target.<cfg>] rustflags, [env], and the .cargo/config* chain.
  • Workspace inheritance: virtual workspaces, inherited check-cfg and lints, CARGO_PKG_RUST_VERSION.
  • Features (resolver 2): host and target decoupling, weak and optional dependencies, target-specific and dev-dependencies, renamed and multi-version dependencies.

Known limitations

  • No incremental compilation inside a crate. Editing a large crate in a single worktree can be slower than cargo with incremental compilation enabled.
  • Disk use on filesystems without reflink support (for example ext4) is higher than Cargo's, because artifacts are copied into both the cache and each workspace.
  • Some Cargo configuration keys are rejected rather than ignored. [env], target.<triple>.linker and target.<triple>.runner in any applicable .cargo/config.toml, including the global one, stop the build with an Unsupported build option error, because Mitts cannot track them yet.
  • Linux is the reference platform. macOS is being validated against this release.

Full history: v0.1.1...v0.2.0