Skip to content

fix(install): apply precompiled options to all platforms in lockfile#8396

Merged
jdx merged 1 commit intomainfrom
fix/lock-host-arch-split
Mar 1, 2026
Merged

fix(install): apply precompiled options to all platforms in lockfile#8396
jdx merged 1 commit intomainfrom
fix/lock-host-arch-split

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Mar 1, 2026

Summary

  • Fix mise lock splitting host platform into a separate [[tools.python]] entry when precompiled_flavor or similar settings are configured
  • Apply precompiled options (precompiled_flavor, precompiled_arch, precompiled_os) uniformly to all platforms in resolve_lockfile_options instead of only the current/host platform
  • Apply the same fix for node.flavor

The root cause was that resolve_lockfile_options gated precompiled settings behind is_current_platform, producing different options for host vs non-host platforms. Since set_platform_info groups entries by (version, options), mismatched options caused the host platform to get its own separate entry.

Fixes #8390

Test plan

  • Run mise lock with python.precompiled_flavor set and verify a single [[tools.python]] entry is produced
  • Run mise lock without any precompiled settings and verify behavior is unchanged
  • Run mise lock with python.compile=true and verify the compile entry is still separate (expected, since compiling is platform-specific)

🤖 Generated with Claude Code


Note

Medium Risk
Changes how resolve_lockfile_options is computed for node and python, which can alter generated lockfiles and potentially which binaries are selected during cross-platform installs. Scope is limited to lockfile option metadata and keeps compile platform-specific.

Overview
Prevents mise lock from generating separate host-only tool entries when platform-specific settings are configured.

For python, precompiled selectors (precompiled_arch, precompiled_os, precompiled_flavor) are now written into lockfile options for all targets (when not compiling) rather than only the current platform. For node, flavor is likewise applied to all targets so lockfile entries stay grouped by (version, options) instead of splitting per host vs non-host platform.

Written by Cursor Bugbot for commit 8adfeee. This will update automatically on new commits. Configure here.

Previously, `resolve_lockfile_options` only included precompiled settings
(flavor, arch, os) for the current/host platform. This caused `mise lock`
to split the host platform into a separate `[[tools.python]]` entry since
its options differed from non-host platforms.

Apply precompiled options uniformly to all platforms so they share a single
lockfile entry. The `compile` option remains host-only since compiling from
source is inherently platform-specific.

Fixes #8390

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue where mise lock was generating multiple lockfile entries for the same tool version due to platform-specific application of precompiled options. By modifying the logic to apply these options uniformly across all platforms, the change ensures consistent lockfile generation and prevents unnecessary duplication, particularly for Python and Node.js tools.

Highlights

  • Python Lockfile Fix: Resolved an issue where mise lock would create separate [[tools.python]] entries for the host platform when precompiled_flavor or similar settings were configured.
  • Uniform Precompiled Options: Ensured that Python's precompiled options (precompiled_flavor, precompiled_arch, precompiled_os) are now applied uniformly to all platforms within resolve_lockfile_options, rather than being restricted to only the current/host platform.
  • Node.js Flavor Consistency: Applied a similar fix for node.flavor to prevent lockfile entry splitting, ensuring it is also applied consistently across all platforms.
Changelog
  • src/plugins/core/node.rs
    • Removed the is_current_platform check when applying node.flavor to ensure it's included for all platforms.
    • Added a comment explaining the change prevents lockfile splitting.
  • src/plugins/core/python.rs
    • Removed the is_current_platform check when applying precompiled_arch, precompiled_os, and precompiled_flavor options.
    • Added a comment clarifying that precompiled options are now included for all platforms to avoid lockfile entry splitting.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly addresses the issue of precompiled options causing split lockfile entries by applying them to all platforms. The changes in node.rs and python.rs effectively remove the is_current_platform guard, ensuring consistent options across platforms for precompiled builds.

I've added a couple of suggestions to improve the code's efficiency and idiomaticity by changing how Option values are handled. These are minor improvements but contribute to better code maintainability.

Comment on lines +706 to 708
if let Some(flavor) = settings.node.flavor.clone() {
opts.insert("flavor".to_string(), flavor);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While the current implementation is correct, it can be made slightly more efficient and idiomatic by borrowing instead of cloning the Option. This avoids cloning the Option itself and only clones the inner String when it's present.

Suggested change
if let Some(flavor) = settings.node.flavor.clone() {
opts.insert("flavor".to_string(), flavor);
}
if let Some(flavor) = &settings.node.flavor {
opts.insert("flavor".to_string(), flavor.clone());
}

@greptile-apps
Copy link

greptile-apps bot commented Mar 1, 2026

Greptile Summary

This PR correctly fixes the lockfile entry splitting issue by removing is_current_platform checks for user-configured binary variant preferences (precompiled_flavor, precompiled_arch, precompiled_os for Python, and flavor for Node). These settings are global user preferences that should apply uniformly across all platforms in the lockfile.

Key changes:

  • python.rs: Precompiled options now apply to all platforms (not just current), while keeping compile option platform-specific as intended
  • node.rs: Flavor option now applies to all platforms (not just current), while keeping compile option platform-specific as intended
  • Both changes include clear comments referencing the issue (`mise lock` should not treat host arch specially #8390)

The fix correctly addresses the root cause: set_platform_info groups lockfile entries by (version, options), so mismatched options between host and non-host platforms were causing unwanted splits. By ensuring these user preferences apply uniformly, all platforms will have matching options and be grouped into a single entry.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are minimal, focused, and correctly address the root cause of the lockfile splitting issue. The fix properly preserves platform-specific behavior for compile options while making user preference options uniform across platforms. The logic is sound and matches the grouping behavior in set_platform_info.
  • No files require special attention

Important Files Changed

Filename Overview
src/plugins/core/python.rs Removes is_current_platform check for precompiled options, ensuring they apply uniformly across all platforms to prevent lockfile entry splitting
src/plugins/core/node.rs Removes is_current_platform check for flavor option, ensuring it applies uniformly across all platforms to prevent lockfile entry splitting

Last reviewed commit: 8adfeee

@jdx jdx enabled auto-merge (squash) March 1, 2026 23:08
@jdx jdx merged commit 88ba85e into main Mar 1, 2026
37 of 38 checks passed
@jdx jdx deleted the fix/lock-host-arch-split branch March 1, 2026 23:14
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.23 x -- echo 27.2 ± 0.5 26.2 33.5 1.00
mise x -- echo 30.9 ± 0.8 28.7 37.4 1.14 ± 0.04
⚠️ Warning: Performance variance for x -- echo is 14%

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.23 env 25.1 ± 1.1 24.0 39.8 1.00
mise env 29.1 ± 1.1 27.7 45.7 1.16 ± 0.07
⚠️ Warning: Performance variance for env is 16%

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.23 hook-env 26.5 ± 1.0 25.1 41.9 1.00
mise hook-env 30.1 ± 0.6 28.6 32.2 1.14 ± 0.05
⚠️ Warning: Performance variance for hook-env is 14%

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.2.23 ls 23.5 ± 0.4 22.5 25.3 1.00
mise ls 24.0 ± 1.2 22.7 35.3 1.02 ± 0.06

xtasks/test/perf

Command mise-2026.2.23 mise Variance
install (cached) 162ms 164ms -1%
ls (cached) 91ms 93ms -2%
bin-paths (cached) 95ms 98ms -3%
task-ls (cached) 838ms 832ms +0%

jdx pushed a commit that referenced this pull request Mar 2, 2026
### 🚀 Features

- **(hooks)** add task references to hooks and watch_files by @jdx in
[#8400](#8400)
- **(prepare)** add git-submodule built-in provider by @jdx in
[#8407](#8407)
- **(prepare)** add human-readable stale reasons to prepare output by
@jdx in [#8408](#8408)
- **(prepare)** add dependency ordering to prepare steps by @jdx in
[#8401](#8401)
- **(prepare)** add --explain flag for provider diagnostics by @jdx in
[#8409](#8409)
- **(prepare)** add per-provider timeout support by @jdx in
[#8405](#8405)
- **(prepare)** add blake3 content-hash freshness checking by @jdx in
[#8404](#8404)
- **(tasks)** monorepo vars and per-task vars by @halms in
[#8248](#8248)

### 🐛 Bug Fixes

- **(aqua)** restore bin_paths disk cache with fresh_file invalidation
by @jdx in [#8398](#8398)
- **(idiomatic)** use generic parser for idiomatic files by @risu729 in
[#8171](#8171)
- **(install)** apply precompiled options to all platforms in lockfile
by @jdx in [#8396](#8396)
- **(install)** normalize "v" prefix when matching lockfile versions by
@jdx in [#8413](#8413)
- **(prepare)** improve git submodule parser and fix check_staleness
error handling by @jdx in [#8412](#8412)
- **(python)** respect precompiled settings in lock file generation by
@jdx in [#8399](#8399)
- **(python)** clarify uv_venv_auto docs + prevent uv shim recursion in
venv creation by @halms in
[#8402](#8402)
- **(task)** remove deprecated `# mise` task header syntax by @jdx in
[#8403](#8403)
- **(vfox)** avoid eager metadata loading during config file detection
by @jdx in [#8397](#8397)
- clarify GitHub attestations to be artifact ones by @scop in
[#8394](#8394)
- ignore comments in idiomatic version files by @iloveitaly in
[#7682](#7682)

### 🚜 Refactor

- unify archive detection by @risu729 in
[#8137](#8137)

### 📚 Documentation

- remove duplicated docs for npm.package_manager by @risu729 in
[#8414](#8414)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant