Maintain is the build orchestrator for Land. It covers the internals of the Maintain Rust binary: its architecture, module layout, data flow, integration with other Land elements, and configuration options.
Architecture 🏗
Maintain is a Rust binary and library. The CLI layer accepts subcommands and
delegates to the Rhai scripting engine or direct build functions. Configuration
editing is performed through toml_edit and json5 for structured, non-lossy
modifications to project configuration files.
Key Modules 🔌
| Path | Description |
|---|---|
Source/main.rs |
Binary entry point; dispatches to Build, Run, Eliminate or Architecture |
Source/Library.rs |
Library root; re-exports the four modules |
Source/Architecture.rs |
Emits the workspace architecture description |
Source/Build/CLI/ |
clap CLI: Cli.rs, Commands.rs, GetAllProfiles.rs, OutputFormat.rs |
Source/Build/Definition.rs |
Build group definitions: which elements to build, in what order |
Source/Build/Fn.rs |
Core build function dispatch: clean, compile, link, post-process |
Source/Build/Process/ |
Child process spawning (Process.rs) and plist environment assembly (BuildPlistEnvironment.rs) |
Source/Build/TomlEdit.rs |
Non-lossy TOML editing for Cargo.toml version bumps and dependency changes |
Source/Build/JsonEdit.rs |
JSON5-aware configuration editing for package.json and .json5 files |
Source/Build/PlistEdit.rs |
Editing of macOS Info.plist values during bundling |
Source/Build/Pascalize.rs |
PascalCase ↔ words conversion utilities for naming convention enforcement |
Source/Build/WordsFromPascal.rs |
The inverse conversion, used by naming checks |
Source/Build/GetTauriTargetTriple.rs |
Detects current Rust target triple for SideCar binary selection |
Source/Build/EnvironmentResolver.rs |
Resolves environment variables with fallbacks for build-time configuration |
Source/Build/Constant.rs |
Shared build constants |
Source/Build/Logger.rs |
Colored terminal output using the colored crate |
Source/Build/Error.rs |
Unified error type for build failures |
Source/Build/Rhai/ConfigLoader.rs |
Loads and parses Rhai build configuration scripts |
Source/Build/Rhai/ScriptRunner.rs |
Executes Rhai scripts within the build context with Land API bindings |
Source/Build/Rhai/EnvironmentResolver.rs |
Exposes environment variable resolution to Rhai scripts |
Source/Run/ |
The run pipeline: start an element or the editor from a built tree, with its own CLI.rs and Fn.rs |
Source/Eliminate/ |
The elimination pass: Transform/ and the configuration pruning it drives |
Data Flow 🔄
Integration Points 🔗
| Connecting Element | Direction | Mechanism | Description |
|---|---|---|---|
| Mountain | Build target | cargo build subprocess |
Maintain compiles Mountain as part of the debug/release build group |
| Air | Build target | cargo build subprocess |
Air daemon compiled alongside Mountain |
| Echo | Build target | cargo build subprocess |
Echo scheduler compiled as a dependency of Mountain |
| Rest | Build target | cargo build subprocess |
Rest compiler binary built for use by Output |
| SideCar | Build target | cargo build subprocess |
SideCar Download tool compiled and run as part of setup |
| Output | Build trigger | pnpm run prepublishOnly subprocess |
Maintain triggers TypeScript builds via pnpm |
| Wind / Sky | Build trigger | pnpm run prepublishOnly subprocess |
Frontend packages built through Turborepo via Maintain |
Configuration 🛠
| Option | CLI Flag | Description |
|---|---|---|
| Build mode | debug / release subcommand |
Controls --release flag and optimization level |
| Target triple | --target |
Rust target triple for cross-compilation |
| Element filter | --element |
Build only a specific element rather than the full group |
| Script path | --script |
Override the default Rhai build configuration script |
| Verbosity | --verbose |
Enable detailed subprocess output logging |
Shell Script Entry Points
| Script | Purpose |
|---|---|
Debug.sh |
Full debug build of all elements |
Dev-Mountain.sh |
Hot-reload development mode for Mountain |
Release.sh |
Optimized release build with all elements |
Profile.sh |
Release build with profiling instrumentation |
Debug/All.sh |
Debug all components including frontend |
Debug/Wind.sh |
Debug Wind TypeScript service layer only |
Related Documentation 📖
The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.
WORKING, 06
- FORM:
- BUILD ORCHESTRATOR
- WRITTEN IN:
- RUST RHAI
- BOUNDARY:
- COMMAND LINE
- DEPENDS ON:
- CARGO TAURI
- MANUAL:
-
/DOC/DEEP-DIVE-MAINTAIN - EVIDENCE:
- UNAVAILABLE NO MANIFEST IN THE BUILD
# TRACE / MAINTAIN 03 STEPS
- 01
Debug/Build.shTHE BUILD ENTRY - 02
Debug/Run.shTHE RUN ENTRY - 03
Debug/All.shEVERY PROFILE
SOURCE: /DOC/DEEP-DIVE-MAINTAIN