Skip to content

fix(lockfile): respect existing platforms during auto-lock#9621

Merged
jdx merged 2 commits intomainfrom
chore/bump-dev-tools
May 5, 2026
Merged

fix(lockfile): respect existing platforms during auto-lock#9621
jdx merged 2 commits intomainfrom
chore/bump-dev-tools

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented May 5, 2026

Summary

Auto-lock (the path triggered after mise install) was always unioning Platform::common_platforms() into its target set, so platforms removed from mise.lock would silently reappear on the next install. The explicit mise lock path (determine_existing_platforms) already treats existing entries as authoritative; auto-lock should behave the same way once the lockfile has been curated.

The trick is distinguishing "user-curated lockfile" from "fresh first-install" without breaking either. Counting platforms doesn't work — it bans 1-platform lockfiles. The signal that does work: was the lockfile populated before this install ran, or only as a side-effect of it?

This PR snapshots lockfile.all_platform_keys() before update_lockfiles writes any current-platform entries (src/config/mod.rs), threads the snapshot through into auto_lock_new_versions, and uses it in determine_target_platforms_from_lockfile:

  • pre-install snapshot is empty → fresh lockfile → expand to common defaults (preserves touch mise.lock; mise use jq UX).
  • pre-install snapshot is non-empty → user-curated → respect those platforms (plus current). Works for any size from 1 to N.

The lockfile_platforms setting still wins as the explicit override.

Also bumps several dev tools (aube, bun, fd, gh, hk, lua-language-server, sops, stylua, usage) and drops the now-stale platforms.macos-x64 / platforms.macos-x64-baseline rows from mise.lock — without the fix above, autofix.ci would put them right back.

Regression coverage

Unit tests in src/lockfile.rs:

  • test_determine_target_platforms_respects_pre_install_keys — multi-platform pre-install snapshot, common defaults must NOT leak in.
  • test_determine_target_platforms_one_platform_lockfile_is_authoritative — pre-install snapshot of one platform stays as one platform.
  • test_determine_target_platforms_expands_for_fresh_lockfile — empty pre-install snapshot → all common platforms targeted.

E2E test (e2e/lockfile/test_lockfile_auto_lock) extended:

  • Test 4: drop platforms.macos-x64 from a populated lockfile, then mise install another tool — macos-x64 stays removed.

Test plan

  • cargo test --bin mise lockfile:: — 28 passed
  • mise run test:e2e lockfile/test_lockfile_auto_lock — passes locally (covers fresh, no-op, new-tool, and removed-platform cases)
  • CI passes

🤖 Generated with Claude Code


Note

Medium Risk
Changes the platform-selection logic used during mise install auto-locking, which can alter lockfile contents across developer environments. Risk is moderate due to behavioral changes in a core workflow, though it’s covered by new unit and e2e tests.

Overview
Auto-lock during mise install now respects curated lockfiles. The install flow snapshots each affected lockfile’s pre-install platform keys and uses that snapshot to decide which platforms to auto-resolve, preventing deleted platforms from being silently reintroduced.

auto_lock_new_versions is updated to take the pre-install snapshot and target either (a) the existing platform set (plus current platform) when the lockfile already had platform entries, or (b) the common platform set for a fresh/empty lockfile; lockfile_platforms remains an override. Adds unit tests for these cases and extends the e2e lockfile suite to assert that removing platforms.macos-x64 persists across subsequent installs.

Separately updates the repo mise.lock with new tool versions and removes several platforms.macos-x64 / platforms.macos-x64-baseline entries, and switches aube in mise.toml to latest.

Reviewed by Cursor Bugbot for commit 752e1e8. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 5, 2026

Greptile Summary

  • Fixes auto_lock_new_versions to snapshot platform keys before update_lockfiles writes any entries, then uses those keys to distinguish a fresh lockfile (empty → expand to common_platforms()) from a curated one (non-empty → authoritative, plus current platform). Two new unit tests and one new e2e test case cover the curated and fresh paths.
  • Drops macos-x64 / macos-x64-baseline rows from mise.lock for all dev tools (actionlint, aube, bun, cargo-binstall, cargo-insta, fd, gh, git-cliff, cargo-release, jq, and others); these were the stale entries the bug was silently re-adding after each install.
  • Bumps several dev tool versions in mise.lock (aube 1.1.0→1.8.0, bun 1.3.10→1.3.13, fd 10.3.0→10.4.2, gh 2.87.3→2.92.0, hk 1.44.3→1.45.0) and switches aube in mise.toml to "latest".

Confidence Score: 5/5

Safe to merge; the logic change is well-reasoned, fully tested, and the lockfile updates are expected consequences of the fix.

No P0 or P1 issues found. The curated-vs-fresh heuristic is correct (snapshot before write, non-empty → authoritative), unit tests cover all three branches (multi-platform curated, single-platform curated, fresh/empty), and the e2e test validates the end-to-end regression scenario.

No files require special attention.

Reviews (7): Last reviewed commit: "fix(lockfile): respect existing platform..." | Re-trigger Greptile

Copy link
Copy Markdown
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 updates several tool versions in the mise lockfile, including aube, bun, fd, gh, hk, lua-language-server, sops, stylua, and usage, and changes the aube version requirement to 'latest' in mise.toml. A critical issue was identified in the lockfile where the update to fd version 10.4.2 resulted in the removal of macos-x64 platform entries, which will break the development environment for users on Intel-based Macs.

Comment thread mise.lock

[[tools.fd]]
version = "10.3.0"
version = "10.4.2"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The update to fd version 10.4.2 in the lockfile has resulted in the removal of the macos-x64 and macos-x64-baseline platform entries. These were present in the previous version (10.3.0) and are still available in the upstream release. This change will break the development environment for users on Intel-based Macs. Please regenerate the lockfile to ensure all supported platforms are included.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.0 x -- echo 20.0 ± 0.8 18.2 23.1 1.00
mise x -- echo 20.5 ± 1.0 18.7 25.5 1.02 ± 0.07

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.0 env 19.5 ± 0.9 18.0 24.4 1.00
mise env 19.8 ± 1.2 18.3 33.3 1.02 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.0 hook-env 20.2 ± 0.9 18.4 25.9 1.00
mise hook-env 20.4 ± 1.0 18.8 26.4 1.01 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.0 ls 20.2 ± 0.9 18.2 26.0 1.17 ± 0.08
mise ls 17.3 ± 0.9 15.6 21.4 1.00
✅ Performance improvement for ls is 17%

xtasks/test/perf

Command mise-2026.5.0 mise Variance
install (cached) 128ms 127ms +0%
ls (cached) 62ms 60ms +3%
bin-paths (cached) 63ms 64ms -1%
task-ls (cached) 542ms 547ms +0%

Bumps aube to latest and refreshes mise.lock entries for several dev tools
(bun, fd, gh, hk, lua-language-server, sops, stylua, usage).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx force-pushed the chore/bump-dev-tools branch from 8385d4d to 1d7c57f Compare May 5, 2026 15:30
@jdx jdx changed the title chore: bump dev tool versions fix(lockfile): respect existing platforms during auto-lock May 5, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1d7c57f. Configure here.

Comment thread src/lockfile.rs Outdated
@jdx jdx force-pushed the chore/bump-dev-tools branch 2 times, most recently from 9e3e302 to bd1beea Compare May 5, 2026 16:06
`determine_target_platforms_from_lockfile` (the auto-lock path) always
unioned `Platform::common_platforms()` into the target set, which made
the lockfile additive: platforms removed from `mise.lock` would silently
reappear on the next `mise install` because auto-lock would re-resolve
them.

Match the explicit `mise lock` behavior in `determine_existing_platforms`:
when the lockfile already has platform entries, treat those (plus the
current platform) as authoritative; only fall back to common defaults
when the lockfile has no entries yet. The `lockfile_platforms` setting
remains the highest-priority override.

Also drops the now-stale `platforms.macos-x64` and
`platforms.macos-x64-baseline` entries from `mise.lock`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jdx jdx force-pushed the chore/bump-dev-tools branch from bd1beea to 752e1e8 Compare May 5, 2026 16:15
@jdx jdx merged commit 2cda1f2 into main May 5, 2026
38 checks passed
@jdx jdx deleted the chore/bump-dev-tools branch May 5, 2026 16:39
mise-en-dev added a commit that referenced this pull request May 7, 2026
### 🚀 Features

- **(aqua)** support registry libc variants by @jdx in
[#9652](#9652)
- **(bin-paths)** add executable names output by @risu729 in
[#9617](#9617)

### 🐛 Bug Fixes

- **(aqua)** preserve configured file extensions by @risu729 in
[#9611](#9611)
- **(aqua)** support registry file links by @risu729 in
[#9610](#9610)
- **(backend)** reject bare package backend names by @risu729 in
[#9608](#9608)
- **(backend)** apply inline tool option overrides by @risu729 in
[#9306](#9306)
- **(backend)** skip versions host for local tool opts by @risu729 in
[#9568](#9568)
- **(github)** chmod explicit archive bin by @risu729 in
[#9609](#9609)
- **(install)** skip remote-versions refresh in prefer-offline mode by
@jdx in [#9627](#9627)
- **(lock)** scope targets to active project root by @risu729 in
[#9319](#9319)
- **(lockfile)** respect existing platforms during auto-lock by @jdx in
[#9621](#9621)
- **(pipx)** filter yanked pypi releases by @risu729 in
[#9607](#9607)
- **(pipx)** declare python as a backend dependency by @jdx in
[#9678](#9678)
- **(schema)** update refs to $defs in mise-registry-tool.json by
@risu729 in [#9671](#9671)
- **(task)** terminate parallel siblings on failure via process groups
by @jdx in [#9655](#9655)
- **(task)** stable MISE_PROJECT_ROOT for monorepo tasks, add
MISE_MONOREPO_ROOT by @jdx in
[#9657](#9657)
- **(trust)** run enter hooks after trusting config by @risu729 in
[#9634](#9634)
- **(ui)** stop clearing screen for prompts by @jdx in
[#9619](#9619)
- use /bin/cp on macos by @pdehlke in
[#9656](#9656)

### 🚜 Refactor

- **(aqua)** store aqua var defaults as strings by @risu729 in
[#9645](#9645)
- **(config)** support structured TOML values in registry backend
options by @risu729 in [#9584](#9584)
- **(deps)** remove serde_derive dependency by @risu729 in
[#9670](#9670)
- **(deps)** remove anyhow dependency by @risu729 in
[#9661](#9661)
- **(deps)** use std::sync::LazyLock instead of once_cell::Lazy by
@risu729 in [#9668](#9668)
- **(schema)** generate task schema from mise schema by @risu729 in
[#9581](#9581)
- **(schema)** reuse task props with unevaluatedProperties by @risu729
in [#9582](#9582)
- **(schema)** reuse registry common types by @risu729 in
[#9648](#9648)
- **(schema)** reuse plugin script config by @risu729 in
[#9647](#9647)
- **(schema)** use $defs in schema files by @risu729 in
[#9646](#9646)

### 📚 Documentation

- **(node)** add tips for enabling node idiomatic by @fu050409 in
[#9675](#9675)

### 🧪 Testing

- **(cli)** remove nondeterministic tool depends assertion by @risu729
in [#9633](#9633)
- **(e2e)** pin uv to 0.11.8 around astral-sh/uv#19278 by @jdx in
[#9618](#9618)
- **(e2e)** wait for docker env cleanup by @risu729 in
[#9631](#9631)
- **(zig)** use official zig instead of mach mirror by @jdx in
[#9659](#9659)

### 📦️ Dependency Updates

- fall through to hash check when providers have no outputs by @jdx in
[#9622](#9622)
- bump Cargo.lock by @jdx in
[#9625](#9625)

### 📦 Registry

- remove registry depends by @risu729 in
[#9571](#9571)
- add code-review-graph (pipx:code-review-graph) by @chautruonglong in
[#9673](#9673)

### Chore

- **(ci)** split large registry test-tool changes by @risu729 in
[#9628](#9628)
- **(ci)** make perf script robust to runner noise by @jdx in
[#9635](#9635)
- **(ci)** skip hyperfine comments without permission by @risu729 in
[#9629](#9629)

### New Contributors

- @chautruonglong made their first contribution in
[#9673](#9673)
- @pdehlke made their first contribution in
[#9656](#9656)

## 📦 Aqua Registry Updates

### New Packages (5)

-
[`anthropics/anthropic-cli`](https://github.com/anthropics/anthropic-cli)
- [`crates.io/wasmi_cli`](https://github.com/wasmi-labs/wasmi)
- [`openclaw/gogcli`](https://github.com/openclaw/gogcli)
- `racket-lang.org/racket-minimal`
- [`runs-on/cli`](https://github.com/runs-on/cli)

### Updated Packages (13)

- [`UpCloudLtd/upcloud-cli`](https://github.com/UpCloudLtd/upcloud-cli)
- [`aristocratos/btop`](https://github.com/aristocratos/btop)
- [`dprint/dprint`](https://github.com/dprint/dprint)
- [`j178/prek`](https://github.com/j178/prek)
- [`jdx/hk`](https://github.com/jdx/hk)
- [`jdx/mise`](https://github.com/jdx/mise)
- [`jdx/usage`](https://github.com/jdx/usage)
- [`jreleaser/jreleaser`](https://github.com/jreleaser/jreleaser)
-
[`jreleaser/jreleaser/standalone`](https://github.com/jreleaser/jreleaser)
- [`pnpm/pnpm`](https://github.com/pnpm/pnpm)
- [`suzuki-shunsuke/cmdx`](https://github.com/suzuki-shunsuke/cmdx)
- [`suzuki-shunsuke/ghir`](https://github.com/suzuki-shunsuke/ghir)
- [`twpayne/chezmoi`](https://github.com/twpayne/chezmoi)
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