-
-
Notifications
You must be signed in to change notification settings - Fork 769
refactor(lockfile): use compact inline table format #7141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses inconsistent lockfile generation by removing the size field from being written to lockfiles. The size field was only populated during installation but not during mise lock commands, leading to lockfile entries with inconsistent data. The change maintains backward compatibility by allowing existing lockfiles to still read the size field.
Key Changes
- Modified the
PlatformInfostruct to skip serializing thesizefield while maintaining deserialization support - Commented out the code that writes the size field in the
From<PlatformInfo> for toml::Valueimplementation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // TODO: Add size back if we find a good way to generate it with `mise lock` | ||
| // Currently size is only available during installation, not during lockfile generation | ||
| #[serde(skip_serializing, default)] | ||
| pub size: Option<u64>, |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The TODO comment spans multiple lines and lacks clarity on ownership and next steps. Consider reformatting as a single-line comment or adding an issue reference for tracking. Example: // TODO(#issue): Add size back when lockfile generation can populate it
| // TODO: Add size back if we find a good way to generate it with `mise lock` | |
| // Currently size is only available during installation, not during lockfile generation | |
| #[serde(skip_serializing, default)] | |
| pub size: Option<u64>, | |
| // TODO: Add size back when lockfile generation can populate it | |
| #[serde(skip_serializing, default)] | |
| pub size: Option<u64>, | |
| pub size: Option<u64>, |
src/lockfile.rs
Outdated
| // if let Some(size) = platform_info.size { | ||
| // table.insert("size".to_string(), (size as i64).into()); | ||
| // } |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented-out code should typically be removed rather than kept in the codebase. If this needs to be preserved for reference, consider adding a note about why it's kept or link to the same TODO tracking issue mentioned in the struct definition.
| // if let Some(size) = platform_info.size { | |
| // table.insert("size".to_string(), (size as i64).into()); | |
| // } |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 x -- echo |
18.3 ± 0.4 | 17.5 | 21.4 | 1.00 |
mise x -- echo |
19.2 ± 0.6 | 18.4 | 24.2 | 1.05 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 env |
17.7 ± 0.6 | 16.9 | 23.9 | 1.00 |
mise env |
18.4 ± 0.3 | 17.7 | 20.0 | 1.04 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 hook-env |
18.1 ± 0.6 | 17.2 | 24.2 | 1.00 |
mise hook-env |
19.3 ± 0.6 | 18.1 | 23.9 | 1.06 ± 0.05 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 ls |
15.7 ± 0.5 | 14.8 | 20.1 | 1.00 |
mise ls |
16.2 ± 0.5 | 15.3 | 18.8 | 1.03 ± 0.04 |
xtasks/test/perf
| Command | mise-2025.11.10 | mise | Variance |
|---|---|---|---|
| install (cached) | 105ms | 104ms | +0% |
| ls (cached) | 64ms | 64ms | +0% |
| bin-paths (cached) | 69ms | 71ms | -2% |
| task-ls (cached) | 416ms | 426ms | -2% |
The size field was only populated during installation (not during `mise lock`), leading to inconsistent lockfile entries. Comments out size serialization until we have a way to generate it during `mise lock`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Remove `name` field from PlatformInfo (derivable from URL)
- Remove `size` field from serialization (keep for reading, skip writing)
- Use inline tables for platform entries: `"platforms.linux-x64" = { checksum = "...", url = "..." }`
- Reduces mise.lock from 728 lines to 243 lines (67% reduction)
- Update e2e tests for new format
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
The update_lockfiles() function was aggressively removing tools from the lockfile if they weren't in the current toolset. This caused: - Tools added via `mise lock` but not in mise.toml to get removed - Previously locked versions (e.g., node 24.6.0 when node="24" now resolves to 24.11.1) to get removed Remove the pruning logic entirely. The lockfile will now only add/update entries, never remove them. Users can manually edit the lockfile if needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The sorting comparator was not antisymmetric. When comparing
("version", "backend"), it returned Less, but when comparing
("backend", "version"), it fell through to alphabetical comparison
returning Less again (since 'b' < 'v'). This violates the total order
requirement for comparison functions.
Add check for b == "version" to return Greater, maintaining antisymmetry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
The sorting comparator was not antisymmetric. When comparing
("version", "backend"), it returned Less, but when comparing
("backend", "version"), it fell through to alphabetical comparison
returning Less again (since 'b' < 'v'). This violates the total order
requirement for comparison functions.
Add check for b == "version" to return Greater, maintaining antisymmetry.
Also remove size assertion from test_http since size is no longer written
to lockfile.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
c1c3bc3 to
be98143
Compare
### 🚀 Features - **(backend)** add filter_bins option to github/gitlab backends by @risu729 in [#7105](#7105) - **(ci)** auto-close PRs from non-maintainers by @jdx in [#7108](#7108) - **(conda)** add conda backend for installing packages from conda-forge by @jdx in [#7139](#7139) - **(github)** add rename_exe option and switch elm, opam, yt-dlp from ubi by @jdx in [#7140](#7140) - **(install)** add --locked flag for strict lockfile mode by @jdx in [#7098](#7098) - **(lock)** implement cross-platform lockfile generation by @jdx in [#7091](#7091) - **(lockfile)** add options field for tool artifact identity by @jdx in [#7092](#7092) - **(lockfile)** add env field and local lockfile support by @jdx in [#7099](#7099) - **(lockfile)** add URL support for deno, go, and zig backends by @jdx in [#7112](#7112) - **(lockfile)** add URL support for vfox backend by @jdx in [#7114](#7114) - **(lockfile)** add multi-platform checksums without downloading tarballs by @jdx in [#7113](#7113) ### 🐛 Bug Fixes - **(backend)** allow platform-specific strip_components by @risu729 in [#7106](#7106) - **(backend)** prefer path root for bin path if it contains an executable by @risu729 in [#7151](#7151) - **(bash)** avoid deactivate error on (no)unset PROMPT_COMMAND by @scop in [#7096](#7096) - **(ci)** use updatedAt instead of createdAt for stale PR detection by @jdx in [#7109](#7109) - **(github)** search subdirectories for executables in discover_bin_paths by @jdx in [#7138](#7138) - **(lockfile)** combine api_url with asset_pattern for GitHub release URLs by @jdx in [#7111](#7111) ### 🚜 Refactor - **(lock)** simplify lockfile to always use array format by @jdx in [#7093](#7093) - **(lockfile)** use compact inline table format by @jdx in [#7141](#7141) ### 📚 Documentation - **(gitlab)** document rename_exe option also for gitlab backend by @risu729 in [#7149](#7149) - **(lockfile)** update documentation for recent lockfile changes by @jdx in [#7107](#7107) - **(node)** use config_root in _.path for pnpm example by @risu729 in [#7146](#7146) - **(registry)** add github/gitlab backends to the preferred backends list by @risu729 in [#7148](#7148) - **(registry)** add url mappings for all backends by @risu729 in [#7147](#7147) ### 📦️ Dependency Updates - update docker/metadata-action digest to c299e40 by @renovate[bot] in [#7101](#7101) - update ghcr.io/jdx/mise:alpine docker digest to 693c5f6 by @renovate[bot] in [#7102](#7102) - update ghcr.io/jdx/mise:deb docker digest to 9985cab by @renovate[bot] in [#7104](#7104) - update ghcr.io/jdx/mise:copr docker digest to 564d8e1 by @renovate[bot] in [#7103](#7103) - update rust crate ubi to 0.8.4 by @risu729 in [#7154](#7154) ### 📦 Registry - add aqua backend as primary for e1s by @jdx in [#7115](#7115) - add gem backend for bashly by @jdx in [6af6607](6af6607) - switch 1password from asdf to vfox backend by @jdx in [#7116](#7116) - add vfox backend for bfs by @jdx in [#7126](#7126) - add github backend for btrace by @jdx in [#7129](#7129) - add github backend for cf by @jdx in [#7131](#7131) - add vfox backend for bpkg by @jdx in [#7130](#7130) - switch apollo-ios from asdf to github backend by @jdx in [#7118](#7118) - add vfox backend for chromedriver by @jdx in [#7134](#7134) - switch superhtml, vespa-cli, xcsift from ubi to github backend by @jdx in [#7137](#7137) - add vfox backend for clickhouse by @jdx in [#7136](#7136) - switch chicken to vfox plugin by @jdx in [#7135](#7135) - switch chezscheme from asdf to vfox backend by @jdx in [#7132](#7132) - add vfox backend for carthage by @jdx in [#7133](#7133) - switch azure-functions-core-tools from asdf to vfox backend by @jdx in [#7128](#7128) - switch aapt2 to vfox backend by @jdx in [#7117](#7117) - switch ant to vfox backend by @jdx in [#7119](#7119) - switch asciidoctorj from asdf to vfox backend by @jdx in [#7121](#7121) - switch awscli-local to pipx backend by @jdx in [#7120](#7120) - add omnictl by @risu729 in [#7145](#7145) - remove pnpm asdf plugin from fallback by @risu729 in [#7143](#7143) - switch tanzu to github backend by @jdx in [#7124](#7124) - switch android-sdk to vfox plugin by @jdx in [#7127](#7127) - add vfox backend for ag (The Silver Searcher) by @jdx in [#7122](#7122) ### Chore - **(registry)** ignore deleted tools in test-tool workflow by @risu729 in [#7081](#7081) - **(release)** show registry section last in changelog by @jdx in [#7156](#7156) - update mise.lock with checksums by @jdx in [71e9123](71e9123) - disable cancel-in-progress for test workflow on main branch by @risu729 in [#7152](#7152) ## 📦 Aqua Registry Updates #### Updated Packages (1) - [`orf/gping`](https://github.com/orf/gping)
Summary
namefield fromPlatformInfo(derivable from URL)sizefield from serialization (keep for reading, skip writing)mise.lockfrom 728 lines to 243 lines (67% reduction)Before
After
Pruning Fix
The
update_lockfiles()function was aggressively removing tools from the lockfile if they weren't in the current toolset. This caused:mise lockbut not in mise.toml to get removednode = "24"now resolves to 24.11.1) to get removedThe pruning logic has been removed entirely. The lockfile will now only add/update entries, never remove them.
Test plan
🤖 Generated with Claude Code
Note
Switches lockfile to compact dotted inline platform entries, removes name and size serialization, updates backends accordingly, and stops pruning tools from lockfiles.
"platforms.linux-x64" = { ... }); formatter rewrites nestedplatformstables to inline.PlatformInfo: removename; stop serializingsize(kept in-memory only); update (de)serialization to support inline format and ignore unknown size on write.platformstables and dotted inline keys; keep multi-version[[tools.X]]format.name; populateurl,url_api, andchecksumonly; adjust asset resolution and lock info methods.platforms.$PLATFORMkeys and absence ofsize/name.mise.lockusing new inline platform format with URLs/checksums.Written by Cursor Bugbot for commit be98143. This will update automatically on new commits. Configure here.