You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 185da6d
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(apple): give snapshot and fold one native-build owner
Move the shared native-build cache, toolchain identity, and build host
out of snapshot-source into a domain-neutral packages/platform-apple/src
/native-build module group, so the fold helper no longer imports the
snapshot bridge's deadlines, errors, host construction, or host types
to compile a binary that needs none of them.
- native-build/{cache,deadline,host,toolchain-identity,errors}.ts carry
the one cache implementation, one lock implementation, and one
toolchain-identity read every runtime clang build in this package
shares (#2796, #2712); NativeBuildHost exposes only file access,
command execution, locking, and process identity, with no bridge
socket start/connect and no target-process inspection.
- NativeBuildError is domain-neutral (cancelled/timeout/unsupported);
no shared build module imports SnapshotSourceError or emits
bridge-specific error fields. snapshot-source/errors.ts and
deadline.ts map it onto SnapshotSourceError at the boundary, and
foldable/fold-helper-cache.ts maps it onto its own
fold-helper-build-failed AppError, preserving both public error
shapes byte for byte (see the moved and updated test suites).
- fold-helper-cache.ts drops its whole-snapshot-host construction
(building a full SnapshotSourceHost and overriding `run`) for
createNativeBuildHost(runAppleToolCommand), the narrow host the
compile actually needs.
- snapshot-source/host.ts drops its own copy of the lock-acquisition
implementation in favor of the shared one.
- cache-identity.ts keeps only the bridge's simulatorRuntime addition;
the toolchain retry/probe/cancellation logic it used to own moved to
native-build/toolchain-identity.ts with its test coverage.
Net production lines grow (+132 across the touched files, per
`git diff --numstat -M`) because achieving actual decoupling needs a
second, narrow error/deadline type and a translation boundary, not
because anything was merely relocated: the whole-snapshot-host
construction, the duplicate lock implementation, and the fold helper's
dependency on the bridge's deadline/error/host types are all deleted,
and NativeBuildHost's type now statically forbids a future build/cache
change from reaching back into bridge-only capabilities.
Live-validated on this Darwin host with the production code: a cache
miss then a cache-key-stable cache hit for both the snapshot bridge
(779ms build -> 127ms reuse) and the fold helper (2.9s build -> 2.2s
reuse, dominated by the unchanged per-call toolchain probe) via
ensureSnapshotBridgeBinary/ensureFoldHelperBinary directly. No Swift
changes.
0 commit comments