Files
el/crates/el-build/src/lib.rs
T
Will Anderson 48b72843e1 feat: package manager, build system, native cross-compilation, plugin system
Add three new crates and extend the compiler and CLI toolchain:

- el-manifest: el.toml manifest parser using serde + toml crate; supports
  package info, registry/path/version deps, build config with seal key
  sources, cross targets, and plugins; Manifest::find_manifest() walks up
  the directory tree

- el-registry: HTTP registry client (reqwest + tokio) for
  packages.neurontechnologies.ai; PackageMetadata, fetch/download/publish/
  search, BLAKE3 checksum verification, local cache at ~/.engram/packages/

- el-build: build orchestrator with incremental builds (BLAKE3 file hashes
  in .el/build-cache.json), cross-compilation target tagging, dep resolution,
  plugin registry with on_ast/on_typed_ast/on_bytecode hooks, test runner,
  fmt/check/clean commands

- CrossTarget and NativeTarget enums with triple() and artifact_extension()
  methods; NativeTarget::Host detects compile-time platform via cfg! macros

- Plugin system: CompilerPlugin trait + PluginRegistry; dynamic loading is
  a marked TODO with clear extension point for libloading

- CLI extended with: new, add, remove, update, build --cross, run, test,
  check, fmt, clean, publish, search, plugin add/remove/list; old
  single-file commands moved to build-file/seal/unseal subcommands

- Fix pre-existing debugger.rs borrow error (unwrap_or temporary lifetime)
- Fix checker.rs and codegen.rs to handle TestDef/Seed/Assert Stmt variants
- Add spec/language.md sections 12-14: package system, build system,
  plugin system, cross-compilation targets table

130 tests passing, zero warnings
2026-04-27 19:08:25 -05:00

31 lines
976 B
Rust

//! el-build — Build orchestrator for the Engram language toolchain.
//!
//! Reads `el.toml`, resolves dependencies, compiles source files, and produces
//! artifacts. Supports incremental builds via BLAKE3 file hashes stored in
//! `.el/build-cache.json`.
//!
//! # Usage
//! ```rust,no_run
//! use el_build::BuildSystem;
//! use el_manifest::Manifest;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let manifest = Manifest::from_file(std::path::Path::new("el.toml"))?;
//! let bs = BuildSystem::new(manifest, std::env::current_dir()?);
//! let output = bs.build(None).await?;
//! println!("artifact: {}", output.artifact_path.display());
//! # Ok(())
//! # }
//! ```
mod build;
mod cache;
mod error;
mod plugin;
mod test_runner;
pub use build::{BuildOutput, BuildSystem, DepSource, ResolvedDep, TestReport};
pub use cache::BuildCache;
pub use error::{BuildError, BuildResult};
pub use plugin::{CompilerPlugin, PluginError, PluginRegistry};