-
-
Notifications
You must be signed in to change notification settings - Fork 769
fix(lock): validate platform qualifiers when reading from lockfile #7181
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
Skip invalid platforms (like tool-specific qualifiers e.g., "wait-for-gh-rate-limit") when collecting target platforms from existing lockfiles. This prevents tool-specific platform keys from being incorrectly propagated to all other tools during `mise lock`. The bug occurred because `Platform::parse()` accepts any qualifier string, but invalid qualifiers should not be used as target platforms. Now we call `platform.validate()` to ensure only known-valid qualifiers (gnu, musl, msvc, baseline, musl-baseline) are included. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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 fixes a bug where invalid platform qualifiers from tool-specific lockfile entries were incorrectly propagated as target platforms for all tools during mise lock operations.
Key changes:
- Added validation check to filter out invalid platform qualifiers when reading from lockfile
- Updated comment to clarify that only valid platforms are included from existing lockfile
💡 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-2025.11.11 x -- echo |
18.7 ± 0.6 | 18.2 | 24.7 | 1.00 |
mise x -- echo |
18.9 ± 0.6 | 18.2 | 27.2 | 1.01 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.11 env |
18.3 ± 0.4 | 17.7 | 20.7 | 1.00 |
mise env |
18.7 ± 0.4 | 18.0 | 21.0 | 1.02 ± 0.03 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.11 hook-env |
18.6 ± 0.5 | 17.8 | 21.1 | 1.00 |
mise hook-env |
18.6 ± 0.3 | 18.0 | 20.1 | 1.00 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.11 ls |
16.5 ± 1.3 | 15.2 | 21.5 | 1.03 ± 0.08 |
mise ls |
16.1 ± 0.3 | 15.4 | 17.7 | 1.00 |
xtasks/test/perf
| Command | mise-2025.11.11 | mise | Variance |
|---|---|---|---|
| install (cached) | 106ms | 108ms | -1% |
| ls (cached) | 64ms | 65ms | -1% |
| bin-paths (cached) | 71ms | 71ms | +0% |
| task-ls (cached) | 431ms | 424ms | +1% |
### 🚀 Features - **(config)** add support for netrc by @RobotSupervisor in [#7164](#7164) - **(lock)** add resolve_lock_info to core backends for checksum fetching by @jdx in [#7180](#7180) - **(ruby)** Install ruby from a zip file over HTTPS by @KaanYT in [#7167](#7167) - **(tasks)** add `usage` args to Tera context in run scripts by @iamkroot in [#7041](#7041) ### 🐛 Bug Fixes - **(lock)** validate platform qualifiers when reading from lockfile by @jdx in [#7181](#7181) - **(task)** retry shebang scripts on ETXTBUSY by @iamkroot in [#7162](#7162) - **(ui)** remove duplicate 'mise' prefix in verbose footer output by @jdx in [#7174](#7174) ### 📦️ Dependency Updates - bump usage-lib to 2.9.0 by @jdx in [#7177](#7177) ### 📦 Registry - remove duplicated ubi and github backends from gping by @risu729 in [#7144](#7144) - disable bashly test (not working in CI) by @jdx in [#7173](#7173) - disable cfn-lint test (failing in CI) by @jdx in [#7176](#7176) ### Chore - add fd to mise.toml by @blampe in [#7178](#7178) ### New Contributors - @RobotSupervisor made their first contribution in [#7164](#7164) ## 📦 Aqua Registry Updates #### New Packages (2) - [`Kitware/CMake`](https://github.com/Kitware/CMake) - [`quarto-dev/quarto-cli`](https://github.com/quarto-dev/quarto-cli) #### Updated Packages (6) - [`apache/jena`](https://github.com/apache/jena) - [`apache/spark`](https://github.com/apache/spark) - [`danielfoehrKn/kubeswitch`](https://github.com/danielfoehrKn/kubeswitch) - [`danielfoehrKn/kubeswitch/switch-sh`](https://github.com/danielfoehrKn/kubeswitch/switch-sh) - [`evilmartians/lefthook`](https://github.com/evilmartians/lefthook) - [`updatecli/updatecli`](https://github.com/updatecli/updatecli)
Summary
Fix a bug where invalid platform keys (like
linux-x64-wait-for-gh-rate-limit) from tool-specific entries in the lockfile were being propagated as target platforms for all tools duringmise lock.The issue was introduced in #7180 when collecting existing platforms from lockfiles.
Platform::parse()accepts any qualifier string (likewait-for-gh-rate-limitfrom thewait-for-gh-rate-limittool's lockfile entry), but these should not be used as target platforms for other tools.Root cause
When
mise lockruns, it collects target platforms from:Step 3 was reading all
platforms.*keys from all tools in the lockfile without validating that they're valid platform qualifiers. So when a tool likewait-for-gh-rate-limithad its own unique platform keylinux-x64-wait-for-gh-rate-limit, that was added to the set of target platforms for ALL tools.The fix
Now we call
platform.validate()after parsing to ensure only known-valid qualifiers (gnu,musl,msvc,baseline,musl-baseline) are included as target platforms.Test plan
🤖 Generated with Claude Code
Note
Validate lockfile platform keys and ignore invalid/tool-specific qualifiers when deriving target platforms for
mise lock.src/cli/lock.rsdetermine_target_platformsto include lockfile platforms only ifPlatform::validate()succeeds, preventing tool-specific/invalid qualifiers from becoming target platforms.Written by Cursor Bugbot for commit d7ef083. This will update automatically on new commits. Configure here.