Contributing: hybrid mirror (in-cli ↔ rust-driver)
The in crate (in-cli) vendors hybrid pipeline sources that must stay aligned with compiler/rust-driver. The published inauguration package is built from in-cli; drift between these trees breaks publish parity with the workspace compiler (different behavior, duplicated fixes, or CI that passes in one layout but not the other).
Treat edits to either side as edits to both until extraction or automation lands (see native Swift master plan — Phase 0).
Mirrored paths
in-cli source | compiler/rust-driver crate (canonical lib.rs) |
|---|---|
in-cli/src/hybrid_core.rs | compiler/rust-driver/crates/core/src/lib.rs |
in-cli/src/hybrid_scheduler.rs | compiler/rust-driver/crates/scheduler/src/lib.rs |
in-cli/src/hybrid_sil.rs | compiler/rust-driver/crates/sil/src/lib.rs |
in-cli/src/hybrid_pipeline.rs | compiler/rust-driver/crates/pipeline/src/lib.rs |
Rust module boundaries inside each crate may split across src/lib.rs and submodules in the future; compare directory trees and entry APIs, not only single files.
Manual sync checklist
Before opening a PR that touches hybrid logic on either side:
-
Identify the canonical side for your change (prefer fixing in
compiler/rust-driverfirst, then mirror intoin-cli, unless the change is CLI-specific glue). -
Diff the mirrored pairs after copying or editing. From the repo root, each workspace crate is a single
lib.rsinlined into the matchinghybrid_*.rs(expectusepath differences:hybrid_*usescrate::hybrid_*, crates usehybrid_*/ workspace deps):diff -u compiler/rust-driver/crates/core/src/lib.rs in-cli/src/hybrid_core.rs diff -u compiler/rust-driver/crates/scheduler/src/lib.rs in-cli/src/hybrid_scheduler.rs diff -u compiler/rust-driver/crates/sil/src/lib.rs in-cli/src/hybrid_sil.rs diff -u compiler/rust-driver/crates/pipeline/src/lib.rs in-cli/src/hybrid_pipeline.rsIf a crate later splits into submodules, diff the touched subtree against the corresponding section of the vendored file.
-
Run tests on both workspaces:
cd compiler/rust-driver && cargo test --all cd in-cli && cargo test -
Confirm
in teststill passes from the repo root (project gate).
If automated mirroring is added later, keep this checklist as the human fallback when scripts fail or paths diverge.
Why drift matters
- crates.io / release binaries ship
in-clisources;rust-driveris the in-tree compiler workspace. Unmirrored fixes can ship to users without landing in the driver (or vice versa). - Reviewers may only glance at one tree; explicit diff discipline reduces silent skew.
For roadmap context and Phase 0 exit criteria, see native-swift-master-plan.md.