fix(node): include source build options in lock identity#9991
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces InstallManifest as a new source for tool options, allowing settings from the install manifest to be incorporated into the option resolution process. It also refactors the Node.js plugin to include additional build configurations, such as mirror_url and cflags, in the lockfile identity. Feedback identifies concerns regarding lockfile portability and stability in the Node.js plugin, specifically pointing out that platform-specific checks and direct environment variable access for build options can cause inconsistent lock identities across different systems.
Greptile SummaryThis PR fixes Node.js lock identity by introducing a
Confidence Score: 5/5Safe to merge — the change is a well-scoped refactor with no altered runtime behavior for common paths and comprehensive new tests covering settings-only, tool-options-override, and env-fallback scenarios. All option resolution paths flow through the new NodeOptions helper, which is exercised end-to-end by the three new node_lockfile_options tests. The previous gap where env-var compile inputs were excluded from lock identity is now closed. The only notable behavioral delta — removing the is_current_platform guard on compile in resolve_lockfile_options — is intentional per the PR description and consistent with the 'same effective options everywhere' goal. No files require special attention. Important Files Changed
Reviews (8): Last reviewed commit: "fix(node): remove unused settings helper..." | Re-trigger Greptile |
|
CI note: This comment was generated by an AI coding assistant. |
32762fe to
4a5da17
Compare
📝 WalkthroughWalkthroughresolve_lockfile_options now always builds lockfile options from ChangesNode Lockfile Options Refactoring
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
CI note: the current failures appear unrelated to this PR. I checked another recent non-Node PR/test run ( This comment was generated by an AI coding assistant. |
Summary
Classification
Mixed actual lock/install identity and stale-lock invalidation fix.
Actual identity:
compile, CFLAGS, configure options, make commands/options, and explicit Ninja selection can change the source-built Node output for the same version. A source tarball URL alone does not represent those build inputs.Stale-lock invalidation:
mirror_urlandflavorprimarily select a different binary archive URL/checksum. Once the lock entry is selected, the locked URL is enough to download it, but these selectors still need to be part of the current exact-options key so a lock entry produced for one mirror/flavor is not reused after config changes.Settings, tool options, and env fallback
Node install inputs now use this precedence: tool options in
[tools], thennode.*settings, then the legacy Node build environment variables that mise already honored (NODE_BUILD_MIRROR_URL,NODE_CFLAGS,NODE_CONFIGURE_OPTS,NODE_MAKE_OPTS, andNODE_MAKE_INSTALL_OPTS).The legacy env fallback is still required for lock identity because the installer still honors those variables during source builds. If they were ignored by lockfile option resolution, changing one of those env vars could reuse a lock entry produced for different source-build inputs. The
MISE_NODE_*env vars are covered through normal settings resolution.Verification
cargo fmt --checkgit diff --checkcargo test node_lockfile_optionscargo test mirror_url_forcargo clippy -- -D warnings