Skip to content

fix(toolset): filter tools by OS in list_current_versions#7356

Merged
jdx merged 1 commit intomainfrom
fix/os-field-filtering
Dec 17, 2025
Merged

fix(toolset): filter tools by OS in list_current_versions#7356
jdx merged 1 commit intomainfrom
fix/os-field-filtering

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Dec 17, 2025

Summary

  • Moves OS filtering into list_current_versions() so that tools configured for other operating systems (via the os field) are consistently filtered out across all commands
  • Removes redundant is_os_supported() checks from list_missing_versions(), list_outdated_versions_filtered(), and doctor::analyze_toolset()

Problem

Tools configured with an os field (e.g., os = ["linux", "macos"]) were still being processed on non-matching operating systems, causing:

  • mise install to attempt installing tools for other OSes
  • mise ls to show tools configured for other OSes
  • mise upgrade to warn about tools for other OSes

Fixes #7352

Test plan

  • Unit tests pass
  • Linting passes
  • Manual verification on Windows with cross-OS tool configurations

🤖 Generated with Claude Code


Note

Moves OS filtering into list_current_versions() and drops redundant is_os_supported() filters across missing/outdated listings and doctor output.

  • Toolset:
    • list_current_versions: now filters versions by request.is_os_supported().
    • list_missing_versions: removes OS filter; relies on centralized filtering.
    • list_outdated_versions_filtered: removes OS filter; relies on centralized filtering.
  • CLI Doctor:
    • doctor::analyze_toolset: removes OS filter when listing tools.

Written by Cursor Bugbot for commit 5d154b5. This will update automatically on new commits. Configure here.

Move OS filtering into list_current_versions() so that tools
configured for other operating systems (via the `os` field) are
consistently filtered out across all commands that list tools.

This fixes issues where:
- `mise install` would try to install tools for other OSes
- `mise ls` would show tools configured for other OSes
- `mise upgrade` would warn about tools for other OSes

Fixes #7352

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 17, 2025 16:22
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 consolidates OS filtering logic for tools by moving the is_os_supported() check into list_current_versions(), ensuring tools configured for specific operating systems are consistently filtered out across all commands. This prevents attempts to install, list, or upgrade tools that aren't meant for the current OS.

  • Centralized OS filtering in list_current_versions() to eliminate duplicate checks
  • Removed redundant is_os_supported() calls from downstream functions
  • Added OS filtering to list_versions_by_plugin() to maintain functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/toolset/mod.rs Consolidated OS filtering in list_current_versions() and removed redundant checks from list_missing_versions() and list_outdated_versions_filtered()
src/cli/doctor/mod.rs Removed redundant OS filtering from analyze_toolset()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.iter()
.flat_map(|(p, v)| {
v.iter().map(|v| {
v.iter().filter(|v| v.request.is_os_supported()).map(|v| {
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Adding OS filtering here in list_versions_by_plugin() appears to be a compensation for the OS filtering that was removed from list_outdated_versions_filtered(). This suggests that list_versions_by_plugin() might be called from contexts other than list_current_versions(). Consider whether list_versions_by_plugin() should consistently return OS-filtered results, or if this filtering belongs at the call site. This could lead to confusion about which method is responsible for OS filtering.

Copilot uses AI. Check for mistakes.
@jdx jdx enabled auto-merge (squash) December 17, 2025 16:29
@github-actions
Copy link

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 x -- echo 19.8 ± 0.3 19.2 23.1 1.00
mise x -- echo 20.2 ± 0.4 19.4 21.7 1.02 ± 0.02

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 env 19.2 ± 0.5 18.5 24.6 1.00
mise env 19.4 ± 0.4 18.8 22.7 1.01 ± 0.04

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 hook-env 19.4 ± 0.5 18.8 25.5 1.00
mise hook-env 19.6 ± 0.3 19.1 20.6 1.01 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 ls 16.8 ± 0.3 16.3 18.2 1.00
mise ls 17.2 ± 0.4 16.6 19.0 1.03 ± 0.03

xtasks/test/perf

Command mise-2025.12.10 mise Variance
install (cached) 108ms 109ms +0%
ls (cached) 65ms 65ms +0%
bin-paths (cached) 72ms 72ms +0%
task-ls (cached) 279ms ⚠️ 4240ms -93%

⚠️ Warning: task-ls cached performance variance is -93%

@jdx jdx merged commit d03c07c into main Dec 17, 2025
30 checks passed
@jdx jdx deleted the fix/os-field-filtering branch December 17, 2025 16:38
jdx pushed a commit that referenced this pull request Dec 18, 2025
### 🚀 Features

- **(alias)** rename alias to tool-alias, add shell-alias command by
@jdx in [#7357](#7357)
- **(upgrade)** display summary of upgraded tools by @jdx in
[#7372](#7372)
- **(vfox)** embed vfox plugin Lua code in binary by @jdx in
[#7369](#7369)

### 🐛 Bug Fixes

- **(aqua)** add start_operations for progress reporting by @jdx in
[#7354](#7354)
- **(github)** improve asset detection for distro-specific and Swift
artifacts by @jdx in [#7347](#7347)
- **(github)** clean up static_helpers.rs and fix archive bin= option by
@jdx in [#7366](#7366)
- **(http)** add start_operations for progress reporting by @jdx in
[#7355](#7355)
- **(lockfile)** place lockfile alongside config file by @jdx in
[#7360](#7360)
- **(progress)** add start_operations to core plugins by @jdx in
[#7351](#7351)
- **(ruby-install)** Use ruby_install_bin to update by @calebhearth in
[#7350](#7350)
- **(rust)** add release_url for rust versions by @jdx in
[#7373](#7373)
- **(schema)** add `tool_alias`, mark `alias` as deprecated by @SKalt in
[#7358](#7358)
- **(toolset)** filter tools by OS in list_current_versions by @jdx in
[#7356](#7356)
- **(ubi)** only show deprecation warning during installation by @jdx in
[#7380](#7380)
- **(ui)** remove noisy "record size" message during install by @jdx in
[#7381](#7381)
- update mise-versions URL to use /tools/ prefix by @jdx in
[#7378](#7378)

### 🚜 Refactor

- **(backend)** unified AssetMatcher with checksum fetching by @jdx in
[#7370](#7370)
- **(backend)** deprecate ubi backend in favor of github by @jdx in
[#7374](#7374)
- **(toolset)** decompose mod.rs into smaller modules by @jdx in
[#7371](#7371)

### 🧪 Testing

- **(e2e)** fix and rename ubi and vfox_embedded_override tests by @jdx
in
[052ea40](052ea40)

### 📦 Registry

- add vfox-gcloud backend for gcloud by @jdx in
[#7349](#7349)
- convert amplify to use github backend by @jdx in
[#7365](#7365)
- add github backend for djinni tool by @jdx in
[#7363](#7363)
- switch glab to native gitlab backend by @jdx in
[#7364](#7364)
- add s5cmd by @jdx in [#7376](#7376)

### Chore

- **(registry)** disable flaky tests for gitu and ktlint by @jdx in
[64151cb](64151cb)
- resolve clippy warnings and add stricter CI check by @jdx in
[#7367](#7367)
- suppress dead_code warnings in asset_matcher module by @jdx in
[#7377](#7377)

### New Contributors

- @calebhearth made their first contribution in
[#7350](#7350)
jekis913 added a commit to jekis913/mise that referenced this pull request Dec 18, 2025
* upstream/main:
  fix(lockfile): place lockfile alongside config file (jdx#7360)
  feat(alias): rename alias to tool-alias, add shell-alias command (jdx#7357)
  fix(aqua): add start_operations for progress reporting (jdx#7354)
  fix(schema): add `tool_alias`, mark `alias` as deprecated (jdx#7358)
  fix(progress): add start_operations to core plugins (jdx#7351)
  fix(toolset): filter tools by OS in list_current_versions (jdx#7356)
  registry: add vfox-gcloud backend for gcloud (jdx#7349)
  fix(github): improve asset detection for distro-specific and Swift artifacts (jdx#7347)
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