Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Dec 4, 2025

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 during mise lock.

The issue was introduced in #7180 when collecting existing platforms from lockfiles. Platform::parse() accepts any qualifier string (like wait-for-gh-rate-limit from the wait-for-gh-rate-limit tool's lockfile entry), but these should not be used as target platforms for other tools.

Root cause

When mise lock runs, it collects target platforms from:

  1. Common platforms (linux-x64, linux-arm64, macos-x64, macos-arm64, windows-x64)
  2. Current platform
  3. Existing platforms in the lockfile

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 like wait-for-gh-rate-limit had its own unique platform key linux-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

  • Build succeeds
  • Lint passes

🤖 Generated with Claude Code


Note

Validate lockfile platform keys and ignore invalid/tool-specific qualifiers when deriving target platforms for mise lock.

  • Lock CLI:
    • Update src/cli/lock.rs determine_target_platforms to include lockfile platforms only if Platform::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.

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]>
Copilot AI review requested due to automatic review settings December 4, 2025 03:11
Copy link
Contributor

Copilot AI left a 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.

@jdx jdx enabled auto-merge (squash) December 4, 2025 03:17
@jdx jdx merged commit b427f91 into main Dec 4, 2025
30 checks passed
@jdx jdx deleted the fix/lock-platform-validation branch December 4, 2025 03:26
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Hyperfine Performance

mise x -- echo

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%

jdx pushed a commit that referenced this pull request Dec 4, 2025
### 🚀 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)
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.

2 participants