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
fix(native): break engine_version mismatch loop in CI hot-swap flows (#1074)
* fix(native): break engine_version mismatch loop in CI-hot-swap flows
The Rust orchestrator writes `build_meta.engine_version = CARGO_PKG_VERSION`
(the binary's value) and `check_version_mismatch` compares against it on the
next build. The JS post-processing was overwriting that with the platform
package.json version (`getNativePackageVersion()`), which drifts from the
binary in CI flows that hot-swap a freshly-built `.node` over the published
binary without also updating the platform package's `package.json`. The
mismatch promoted every incremental rebuild to a full rebuild, producing
the ~2s 1-file-rebuild floor reported in #1066.
- Plumb the binary's `engineVersion()` through `getActiveEngine` as a new
`binaryVersion` field, kept distinct from the package.json-preferred
display `version`.
- `PipelineContext.nativeBinaryVersion` carries it; `setBuildMeta` after
the orchestrator and `persistBuildMetadata` in finalize now write it
instead of `engineVersion`. `checkEngineSchemaMismatch` compares against
it for symmetry with what Rust reads.
- `scripts/ci-install-native.mjs` now also rewrites the platform package's
`package.json` `version` to match the just-built binary, sourcing the
value from `NATIVE_BUILD_VERSION` (preferred) or the in-tree `Cargo.toml`
(correct for flows that build without a version bump).
- `publish.yml`'s pre-publish-benchmark job — the only site where Cargo.toml
is bumped before the build artifact ships — sets `NATIVE_BUILD_VERSION`
from `compute-version.outputs.version`. Other call sites (CI test/parity,
publish preflight) build from current source without a bump, so the
Cargo.toml fallback resolves correctly.
Refs #1066.
* fix(native): align tryNativeOrchestrator write path with read fallback (#1074)
When ctx.nativeBinaryVersion is null (native addon lacks engineVersion()),
tryNativeOrchestrator was writing codegraph_version = ctx.engineVersion
(platform package.json), while checkEngineSchemaMismatch and
persistBuildMetadata both fall back to CODEGRAPH_VERSION (JS package).
The asymmetry could re-introduce a perpetual full-rebuild loop on older
addons whenever those two strings diverged — exactly the bug #1066 fixed.
`[ci-install-native] ${pkgJsonPath} version already ${binaryVersion} — no rewrite needed`,
117
+
);
118
+
}
119
+
}elseif(!binaryVersion){
120
+
console.warn(
121
+
'[ci-install-native] could not resolve binary version (NATIVE_BUILD_VERSION unset and Cargo.toml unreadable) — leaving platform package.json untouched',
0 commit comments