feat(install): auto-lock all platforms after tool installation#8277
feat(install): auto-lock all platforms after tool installation#8277
Conversation
When `mise install/upgrade/use` installs new tools, the lockfile now automatically resolves checksums and URLs for all common platforms (not just the current one). This prevents unexpected dirty git state when other developers on different platforms run `mise install`. Closes discussion #8270 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @jdx, 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 enhances mise's lockfile management by proactively populating lockfile entries for all common operating system architectures when new tools are installed or used. This change addresses a common issue where developers on different platforms would encounter modified lockfiles, leading to unnecessary git changes. By centralizing platform determination and introducing an auto-locking mechanism, the system ensures a consistent and complete lockfile across diverse development environments, improving collaboration and reducing friction. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces an automatic locking mechanism for all common platforms after a tool is installed or updated. This is a significant improvement for multi-platform development environments, as it ensures that the lockfile is populated with checksums and URLs for all relevant platforms, preventing dirty git states when developers on different OS/architectures run mise install. The implementation refactors the platform determination logic into a shared helper and adds an asynchronous auto_lock_new_versions function that runs concurrently. My feedback focuses on optimizing redundant I/O operations and improving the efficiency of backend lookups within the concurrent tasks.
src/lockfile.rs
Outdated
| let mut lockfile = Lockfile::read(&lockfile_path) | ||
| .unwrap_or_else(|err| handle_lockfile_read_error(err, &lockfile_path)); | ||
|
|
||
| let target_platforms = determine_target_platforms(&lockfile_path); |
There was a problem hiding this comment.
This call to determine_target_platforms results in a redundant read of the lockfile from disk, as Lockfile::read was already called on line 699. You can optimize this by refactoring determine_target_platforms to accept an already loaded Lockfile object.
| let target_platforms = determine_target_platforms(&lockfile_path); | |
| let target_platforms = determine_target_platforms_from_lockfile(&lockfile); |
src/lockfile.rs
Outdated
| jset.spawn(async move { | ||
| let _permit = semaphore.acquire().await; | ||
| let target = PlatformTarget::new(variant.clone()); | ||
| let backend = crate::backend::get(&ba); |
|
bugbot run |
There was a problem hiding this comment.
Pull request overview
This pull request implements auto-locking of all common platforms (linux-x64, linux-arm64, macos-x64, macos-arm64, windows-x64) after tool installation to prevent unexpected dirty git state when developers on different platforms run mise install.
Changes:
- Extract shared
determine_target_platforms()helper function to avoid code duplication - Add
auto_lock_new_versions()async function that automatically resolves checksums and URLs for all common platforms after tool installation - Integrate auto-lock functionality into the post-install workflow
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/lockfile.rs | Added determine_target_platforms() helper and auto_lock_new_versions() function; defined AutoLockResult type alias |
| src/cli/lock.rs | Refactored to use shared determine_target_platforms() helper |
| src/config/mod.rs | Integrated auto-lock call after update_lockfiles() in rebuild flow |
| e2e/lockfile/test_lockfile_auto_lock | New e2e test verifying auto-lock behavior for use/install operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 x -- echo |
22.4 ± 0.4 | 21.8 | 28.0 | 1.00 |
mise x -- echo |
23.3 ± 0.5 | 22.5 | 28.2 | 1.04 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 env |
22.0 ± 0.7 | 21.3 | 28.3 | 1.00 |
mise env |
22.1 ± 0.4 | 21.4 | 24.9 | 1.00 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 hook-env |
22.7 ± 0.6 | 22.0 | 30.1 | 1.00 |
mise hook-env |
22.8 ± 0.4 | 22.1 | 25.1 | 1.00 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.17 ls |
20.1 ± 0.3 | 19.5 | 21.0 | 1.00 |
mise ls |
20.5 ± 0.5 | 19.6 | 24.0 | 1.02 ± 0.03 |
xtasks/test/perf
| Command | mise-2026.2.17 | mise | Variance |
|---|---|---|---|
| install (cached) | 125ms | 125ms | +0% |
| ls (cached) | 76ms | 76ms | +0% |
| bin-paths (cached) | 81ms | 80ms | +1% |
| task-ls (cached) | 784ms | 787ms | +0% |
- Fix clippy: &PathBuf -> &Path in Lock::determine_target_platforms - Avoid redundant lockfile read in auto_lock_new_versions by extracting determine_target_platforms_from_lockfile helper - Clone backend into spawned task instead of re-resolving via global lock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only auto-lock tools from MiseToml sources, matching the filter in update_lockfiles. Previously, tools from .tool-versions or idiomatic version files could produce unmanaged lockfile entries. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deduplicate the async task body and result-application code that was nearly identical between Lock::process_tools (cli/lock.rs) and auto_lock_new_versions (lockfile.rs). Introduces resolve_tool_lock_info() and apply_lock_result() as shared public functions, and a single LockResolutionResult type alias replacing both LockTaskResult and AutoLockResult. Also aligns conda error handling (both now use debug!). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change LockResolutionResult to use Result<PlatformInfo, String> so callers control the log level. Both mise lock and auto-lock use debug! since resolution failures are expected for platforms that lack builds (e.g. tools without Windows support). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| let ok = resolution.4.is_ok(); | ||
| if let Err(msg) = &resolution.4 { | ||
| debug!("{msg}"); | ||
| } |
There was a problem hiding this comment.
Resolution failures silently downgraded from warn to debug
Medium Severity
When a user explicitly runs mise lock, resolution failures (e.g., "failed to resolve X for linux-arm64") are now logged at debug! level instead of the previous warn! level. This means failures are silently swallowed in normal usage and only visible with verbose logging. The debug! level makes sense for the background auto_lock_new_versions path, but for the explicit mise lock command, users expect to see warnings about platforms that failed to resolve.
Replace unwrap_or_default() with explicit match that logs at debug! level, so conda failures are visible with MISE_DEBUG=1 rather than silently producing incomplete lockfiles. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [#8289](#8289) ### New Contributors - @altendky made their first contribution in [#8290](#8290) ## 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn)
## [2026.2.18](https://github.com/jdx/mise/compare/v2026.2.17..v2026.2.18) - 2026-02-21 ### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](jdx/mise#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](jdx/mise#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](jdx/mise#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](jdx/mise#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](jdx/mise#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](jdx/mise#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](jdx/mise#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](jdx/mise#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](jdx/mise#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](jdx/mise#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](jdx/mise#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](jdx/mise#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](jdx/mise#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](jdx/mise#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [#8289](jdx/mise#8289) ### New Contributors - @altendky made their first contribution in [#8290](jdx/mise#8290) ### 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn) ## [2026.2.17](https://github.com/jdx/mise/compare/v2026.2.16..v2026.2.17) - 2026-02-19 ### 🚀 Features - **(prepare)** update mtime of outputs after command is run by @halms in [#8243](jdx/mise#8243) ### 🐛 Bug Fixes - **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [#8234](jdx/mise#8234) - **(use)** write to config.toml instead of config.local.toml by @jdx in [#8240](jdx/mise#8240) - default legacy .mise.backend installs to non-explicit by @jean-humann in [#8245](jdx/mise#8245) ### 🚜 Refactor - **(config)** consolidate flat task_* settings into nested task.* by @jdx in [#8239](jdx/mise#8239) ### Chore - **(prepare)** refactor common code into ProviderBase by @halms in [#8246](jdx/mise#8246) ### 📦 Aqua Registry Updates #### Updated Packages (1) - [`namespacelabs/foundation/nsc`](https://github.com/namespacelabs/foundation/nsc)
) ## Summary - After `mise install/upgrade/use` installs new tools, automatically resolve checksums and URLs for all common platforms (linux-x64, linux-arm64, macos-x64, macos-arm64, windows-x64) — not just the current platform - Prevents unexpected dirty git state when other developers on different platforms run `mise install` (fixes jdx#8270) - Extracts shared `determine_target_platforms()` helper used by both `mise lock` and the new auto-lock logic ## Changes - **`src/lockfile.rs`**: Added `determine_target_platforms()` free function and `auto_lock_new_versions()` async function that resolves lock info for all common platforms for newly installed tools - **`src/cli/lock.rs`**: Refactored `Lock::determine_target_platforms()` to delegate to the shared helper when no `--platform` flag is given - **`src/config/mod.rs`**: Calls `auto_lock_new_versions()` after `update_lockfiles()` in `rebuild_shims_and_runtime_symlinks()` - **`e2e/lockfile/test_lockfile_auto_lock`**: New e2e test verifying auto-lock behavior for `mise use`, idempotent `mise install`, and adding new tools ## Test plan - [x] `mise run build` compiles successfully - [x] `mise run lint-fix` passes all lints - [x] `mise run test:unit` — all 481 unit tests pass - [x] `mise run test:e2e lockfile/test_lockfile_auto_lock` — new e2e test passes - [x] `mise run test:e2e lockfile/test_lockfile_install` — existing lockfile install tests still pass - [x] `mise run test:e2e cli/test_lock` — existing lock command tests still pass 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes lockfile update behavior and adds concurrent cross-platform resolution after installs, which could impact performance or lockfile contents if resolution differs across backends/platform variants. > > **Overview** > After `mise install`/`upgrade`/`use` installs new tool versions, the lockfile is now automatically populated with checksum/URL data for the common platform set (plus current/existing platforms) so other developers on different OS/arch don’t trigger additional lockfile writes. > > This introduces shared lock-resolution utilities in `lockfile.rs` (platform selection, async multi-platform resolution, and result application), refactors the `mise lock` command to reuse them, and adds an e2e test asserting auto-locking, idempotent subsequent installs, and auto-locking when adding a new tool. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0dbf619. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [jdx#8277](jdx#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [jdx#8288](jdx#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [jdx#8276](jdx#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [jdx#8290](jdx#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [jdx#8292](jdx#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [jdx#8285](jdx#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [jdx#8275](jdx#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [jdx#8279](jdx#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [jdx#8274](jdx#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [jdx#8286](jdx#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [jdx#8291](jdx#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [jdx#8282](jdx#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [jdx#8273](jdx#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [jdx#8283](jdx#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [jdx#8289](jdx#8289) ### New Contributors - @altendky made their first contribution in [jdx#8290](jdx#8290) ## 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn)


Summary
mise install/upgrade/useinstalls new tools, automatically resolve checksums and URLs for all common platforms (linux-x64, linux-arm64, macos-x64, macos-arm64, windows-x64) — not just the current platformmise install(fixes Autorun `mise lock` on each lockfile change #8270)determine_target_platforms()helper used by bothmise lockand the new auto-lock logicChanges
src/lockfile.rs: Addeddetermine_target_platforms()free function andauto_lock_new_versions()async function that resolves lock info for all common platforms for newly installed toolssrc/cli/lock.rs: RefactoredLock::determine_target_platforms()to delegate to the shared helper when no--platformflag is givensrc/config/mod.rs: Callsauto_lock_new_versions()afterupdate_lockfiles()inrebuild_shims_and_runtime_symlinks()e2e/lockfile/test_lockfile_auto_lock: New e2e test verifying auto-lock behavior formise use, idempotentmise install, and adding new toolsTest plan
mise run buildcompiles successfullymise run lint-fixpasses all lintsmise run test:unit— all 481 unit tests passmise run test:e2e lockfile/test_lockfile_auto_lock— new e2e test passesmise run test:e2e lockfile/test_lockfile_install— existing lockfile install tests still passmise run test:e2e cli/test_lock— existing lock command tests still pass🤖 Generated with Claude Code
Note
Medium Risk
Changes lockfile update behavior and adds concurrent cross-platform resolution after installs, which could impact performance or lockfile contents if resolution differs across backends/platform variants.
Overview
After
mise install/upgrade/useinstalls new tool versions, the lockfile is now automatically populated with checksum/URL data for the common platform set (plus current/existing platforms) so other developers on different OS/arch don’t trigger additional lockfile writes.This introduces shared lock-resolution utilities in
lockfile.rs(platform selection, async multi-platform resolution, and result application), refactors themise lockcommand to reuse them, and adds an e2e test asserting auto-locking, idempotent subsequent installs, and auto-locking when adding a new tool.Written by Cursor Bugbot for commit 0dbf619. This will update automatically on new commits. Configure here.