fix(tool-stubs): platform-specific bin fields by jdx · Pull Request #5812 · jdx/mise (original) (raw)
added 2 commits
- Fix filename preservation for proper archive format detection
- Eliminate duplicate downloads by combining checksum and binary path detection
- Add unified progress reporting for download and extraction
- Fix binary path detection to account for strip_components
- Replace direct reqwest usage with HTTP client infrastructure
- Add e2e test for archive URL functionality
Fixes issue where tool-stub generation failed with .tar.gz URLs due to:
- Missing file extension causing format detection failure
- Downloading same file twice (once for checksum, once for binary path)
- Incorrect binary paths that included stripped directory components
The previous logic was too simplistic and could select the wrong binary. For example, with Node.js it was selecting yarnpkg.js instead of the main node binary.
The new algorithm prioritizes binaries based on:
- Exact filename match with tool name (highest priority)
- Filename starts with tool name
- Shorter path depth (prefer bin/tool over lib/deeply/nested/tool)
- Prefer bin/ directory
- Avoid test/spec/example binaries
- Prefer executables without extensions or standard extensions
This ensures tool stubs generate with the correct primary binary path.
jdx marked this pull request as ready for review
Copilot AI review requested due to automatic review settings
- Rename --platform to --platform-url for clarity about URL specification
- Add new --platform-bin flag for explicit platform-specific binary paths
- Support both auto-detection and explicit platform-specific bin configuration
- Update CLI help and examples to demonstrate new functionality
- Update all e2e tests to use new flag names
- Add validation to ensure either --url or --platform-url is provided
This enables explicit control over platform-specific binary paths when tools have different binary structures across platforms (e.g., .exe on Windows).
Usage examples:
- --platform-url linux-x64:https://example.com/tool-linux.tar.gz
- --platform-bin windows-x64:tool.exe --platform-bin linux-x64:bin/tool
[](/apps/cursor)
[](/apps/cursor)
jdxenabled auto-merge (squash)
jdx deleted the platform-bin-paths branch
jdx pushed a commit that referenced this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})