← Catalog

RFC-008AcceptedToolchain

Build System

Depends: RFC-004RFC-005

Blocks: RFC-012RFC-013

1. Abstract

This RFC defines how Aura builds packages into artifacts: target graph (bin/lib/test), feature flags, profiles (dev/release), caching, cross-compilation, and the default product—a single native executable linking user code and the runtime.

The build orchestrator is implemented in Rust and invoked via aura build / aura check / aura test.

2. Motivation

2.1 Problem statement

Compilation alone is not enough: users need reproducible, incremental builds, profiles, and cross targets without writing bespoke scripts.

2.2 Why now

Packages (RFC-005) and compiler (RFC-004) need a graph executor; distribution (RFC-013) consumes outputs.

2.3 Success metrics

MetricTarget
Default artifactOne executable path
IncrementalNo-op rebuild ~instant when unchanged
CrossCross-compile to supported triples from CI

3. Goals

  • Clear target model and dependency graph.
  • dev vs release profiles with sensible defaults.
  • Cache compiled artifacts keyed by inputs.
  • Cross-compile support for v1 platform matrix.
  • Integration with tests and packaging.

4. Non-goals

  • Generic multi-language monorepo build (Bazel replacement).
  • Distributed remote execution in MVP.
  • Dynamic plugin loading as default artifact type.

5. Prior art & alternatives

SystemNotesTake
CargoProfiles, targets, featuresPrimary inspiration
Go buildSimpleUX contrast
GradleFlexible, heavyAvoid
MakeUniversalNot primary UX

6. Design

6.1 Overview

code
aura.toml targets
    → resolve packages ([RFC-005](/rfc/005))
    → build plan (topo units)
    → compile CGUs ([RFC-004](/rfc/004))
    → link runtime + objs
    → artifact in target/<profile>/

6.2 Targets

Target kindOutput
binExecutable (default ship form)
libLibrary for dependents (rlib-like intermediate)
testTest harness binary
benchLater
exampleOptional

Default binary name from package name.

6.3 Profiles

ProfileGoals
devFast compile, debuginfo, fewer opts, race detector optional
releaseLTO optional, strip, opts, no race detector
testLike dev + test cfg

User custom profiles in aura.toml (later).

6.4 Features

  • Additive feature flags on packages (Cargo-like).
  • default features set.
  • Unify across graph.

6.5 Caching

  • target/ directory layout versioned.
  • Key: compiler version, target triple, profile, features, source hash, dep hash.
  • aura clean removes artifacts.

6.6 Cross-compilation

  • --target <triple> for supported triples.
  • Toolchain ships or downloads sysroot/runtime libs for target (RFC-013).
  • Linker selection documented per host.

6.7 Linking model

  • Static link runtime by default → single file.
  • Optional dynamic (non-default) for advanced.
  • LTO: opt-in thin LTO for release when stable (not mandatory day-one).

6.8 Build scripts

  • No arbitrary build scripts in MVP; declarative settings in aura.toml only.
  • If introduced later: sandboxed, no network default.

6.9 Examples

code
aura build
aura build --release -o dist/server
aura build --target aarch64-unknown-linux-gnu
aura check

6.10 Error model / edge cases

CaseBehavior
Link errorSurface linker message + Aura context
Cache corruptRebuild unit; integrity hash fail
Feature cycleResolve error

6.11 Compatibility & migration

  • target/ format may bump with major toolchain.
  • Stable: CLI flags for profile/target/output.

7. Open questions

#QuestionOptionsOwnerStatus
1Thin LTO default on release?opt-in firstBuildResolved — opt-in
2build scripts MVP?noBuildResolved
3Intermediate lib formatBuildResolved — no stable lib format MVP; source→obj→link; rlib-like later

8. Rationale & trade-offs

Cargo-like graphs match the package model and developer expectations for compiled languages. Single-file default matches RFC-000. Avoiding build scripts early reduces supply-chain risk. Cost: less flexibility for exotic codegen until later.

9. Unresolved / future work

  • Remote cache
  • Workspaces build scheduling UX
  • Compile pipeline metrics HTML report

10. Security & safety considerations

  • No ambient network during build in MVP.
  • Cache poisoning mitigated by content hashes.
  • Untrusted build scripts (if ever) sandboxed.

11. Implementation plan (optional)

PhaseScopeExit criteria
B0Single bin local targetaura build hello
B1Dep graph + cacheRebuild incremental
B2Release + crossShip matrix CI

12. References


Changelog

DateAuthorChange
2026-07-16Lock no stable intermediate lib MVP; Status → Accepted
2026-07-16Status → In Review — Review: profiles/no-scripts direction solid; thin vs full build system
2026-07-15Initial skeleton
2026-07-15Solid draft: profiles, single binary link
2026-07-15Lock no build scripts MVP; LTO opt-in