Skip to content

chore - layout step 3: split the root crate into compiler and oven crates with an Incan-free Oven ring #1480

Description

@dannymeijer

Area

  • Compiler (frontend/backend/codegen)
  • Tooling (CLI/formatter/test runner)
  • Runtime / Core crates (stdlib/core/derive)

Summary

Step 3 of the workspace layout rewrite (parent: #1478). Split what remains of the root crate into incan_frontend, incan_ir, incan_emit, incan_format, incan_inspect, incan_oven_facet, and the Oven crates oven_model, oven_store, oven_rustc, oven_interop, oven_cargo_compat (with oven_registry reserved, empty). Relocate the root tests/ to the crates that own the behavior. Turn on the Oven-only compile guard.

The Oven boundary is the load-bearing part. Measured on dev.4, the proposed Oven sources reach into Incan rings in exactly these places, each of which moves to incan_oven_facet or becomes internal: oven/rustc.rscli::commands::build (internal after #1266); oven/legacy_cargo.rs → SDK inventory discovery, provider digests, backend::project::runner; oven/loaf.rs and dependency_resolver.rsincan_core::lang::stdlib::StdlibExtraCrateSource; lockfile.rsprovider::*, library_manifest::*, frontend::LibraryManifestIndex; dependency_resolver.rsfrontend::ast::Span, frontend::diagnostics::CompileError; backend/project/runner.rs → cfg-gated rust_inspect calls. The full table is in loaves/LAYOUT.md under "The Oven boundary".

Scope

  • In scope: the crate split; lockfile.rs and dependency_resolver.rs split into generic Oven halves and Incan-specific facet halves; the rust_inspect hook inversion in runner.rs; tests/ relocation per the disposition table; the CI guard.
  • Out of scope: behavior change; oven_registry implementation (RFC 125); the ra_ap_load-cargo to project-JSON loader change in incan_inspect (its own follow-up; the crate boundary does not depend on it); directory moves into loaves/ (step 4).
  • Risks: lockfile.rs embeds SDK-provider and library-manifest types in the lock schema, so the split needs an extension point in oven_model rather than a copy of the types. oven/rustc.rs is 10.5k lines and Oven failures surface as authority and fingerprint errors rather than compile errors; verify with the Oven replay lanes, not unit tests alone.

Plan

  1. incan_frontend, incan_ir, incan_emit, incan_format first: pure moves, snapshots must not change.
  2. oven_model, oven_store, oven_rustc, oven_interop, oven_cargo_compat next, with incan_oven_facet created in the same PR series so the facet absorbs each outward edge as it is cut.
  3. incan_inspect from crates/rust_inspect plus src/rust_inspect/.
  4. Relocate tests/: codegen and lowering to incan_emit; parity corpus, replacement, generated-Rust artifact and audit tests to incan_driver; CLI integration and layering guardrails to the CLI crate; Oven regressions to oven_rustc; property tests split by subject; fixtures beside their tests.
  5. Add to CI: cargo check -p oven_model -p oven_store -p oven_rustc -p oven_registry -p oven_interop -p oven_cargo_compat in a checkout with the compiler crates absent.

Done when

  • The Oven-only cargo check passes in CI with no compiler crates present.
  • No oven_* crate lists an incan_* crate as a dependency.
  • make test passes; codegen snapshots unchanged; the root tests/ directory is empty.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    choreA chore: small / contained unit of workincan compilerSuggestions, features, or bugs related to the Compiler (frontend/backend/codegen)runtime / core cratesSuggestions, features, or bugs related to the `incan-core`, `incan-stdlib`, 'incan-derive` cratestoolingSuggestions, features, or bugs related to the Tooling (CLI/formatter/test runner)

    Type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions