-
-
Notifications
You must be signed in to change notification settings - Fork 769
feat(lockfile): add URL support for vfox backend #7114
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 adds lockfile URL support for vfox backend plugins by implementing cross-platform URL generation capabilities. The implementation enables mise to query download URLs for tools across different platforms (OS/architecture combinations) by temporarily overriding vfox's platform globals during plugin execution.
Key Changes:
- Implements
get_tarball_url()in VfoxBackend to generate lockfile URLs with platform name mapping (macos→darwin, x64→amd64) - Adds
pre_install_for_platform()method that temporarily overrides OS_TYPE/ARCH_TYPE Lua globals to query URLs for specific platforms - Introduces new async method in vfox crate to support cross-platform pre-install queries
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/backend/vfox.rs | Implements get_tarball_url() with platform name mapping and calls new pre_install_for_platform() method |
| crates/vfox/src/vfox.rs | Adds public async wrapper pre_install_for_platform() to invoke plugin-specific platform queries |
| crates/vfox/src/hooks/pre_install.rs | Implements core logic to temporarily override Lua globals (OS_TYPE/ARCH_TYPE) for cross-platform URL generation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| -- Override globals with target platform for cross-platform URL generation | ||
| local saved_os = OS_TYPE | ||
| local saved_arch = ARCH_TYPE | ||
| OS_TYPE = $target_os | ||
| ARCH_TYPE = $target_arch | ||
| local result = PLUGIN:PreInstall($ctx) | ||
| -- Restore original values | ||
| OS_TYPE = saved_os | ||
| ARCH_TYPE = saved_arch | ||
| return result |
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.
The global variable override pattern may cause issues in concurrent scenarios. If multiple calls to pre_install_for_platform() execute simultaneously, they could interfere with each other's OS_TYPE/ARCH_TYPE values. Consider using a more isolated approach, such as passing platform parameters directly to the plugin function if the vfox plugin API supports it, or ensuring this method is called under a lock.
| -- Override globals with target platform for cross-platform URL generation | |
| local saved_os = OS_TYPE | |
| local saved_arch = ARCH_TYPE | |
| OS_TYPE = $target_os | |
| ARCH_TYPE = $target_arch | |
| local result = PLUGIN:PreInstall($ctx) | |
| -- Restore original values | |
| OS_TYPE = saved_os | |
| ARCH_TYPE = saved_arch | |
| return result | |
| -- Pass target_os and target_arch as arguments to PreInstall | |
| return PLUGIN:PreInstall($ctx, $target_os, $target_arch) |
| arch => arch, | ||
| }; | ||
|
|
||
| let (vfox, _log_rx) = self.plugin.vfox(); |
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 variable _log_rx is prefixed with underscore indicating it's intentionally unused, but this pattern suggests the log receiver is being ignored. Consider either removing the underscore if logs should be handled, or add a comment explaining why logs are intentionally discarded in this context.
e4c7c3a to
b0070ea
Compare
Add `get_tarball_url()` implementation for vfox plugins to enable lockfile URL generation for all platforms. - Add `pre_install_for_platform()` method that temporarily overrides OS_TYPE/ARCH_TYPE Lua globals to query URLs for different platforms - Map mise platform names to vfox conventions (macos→darwin, x64→amd64) - Return URL from plugin's PreInstall hook response - Refactor VfoxBackend: extract `is_backend_plugin()` and `get_tool_name()` helpers, unify env_keys folding logic 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
b0070ea to
ef54195
Compare
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 x -- echo |
20.1 ± 0.7 | 18.7 | 23.0 | 1.00 |
mise x -- echo |
20.8 ± 0.8 | 18.9 | 23.2 | 1.03 ± 0.05 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 env |
19.6 ± 0.6 | 18.5 | 22.5 | 1.00 |
mise env |
20.2 ± 1.0 | 18.2 | 27.3 | 1.03 ± 0.06 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 hook-env |
20.0 ± 0.6 | 18.4 | 22.4 | 1.01 ± 0.05 |
mise hook-env |
19.9 ± 0.9 | 18.4 | 21.9 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2025.11.10 ls |
17.0 ± 0.6 | 15.8 | 18.7 | 1.00 |
mise ls |
17.6 ± 0.8 | 15.6 | 19.2 | 1.03 ± 0.06 |
xtasks/test/perf
| Command | mise-2025.11.10 | mise | Variance |
|---|---|---|---|
| install (cached) | 109ms | 111ms | -1% |
| ls (cached) | 65ms | 68ms | -4% |
| bin-paths (cached) | 72ms | 72ms | +0% |
| task-ls (cached) | 432ms | 450ms | -4% |
### 🚀 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
get_tarball_url()implementation for vfox plugins to enable lockfile URL generation for all platformspre_install_for_platform()method that temporarily overrides OS_TYPE/ARCH_TYPE Lua globals to query URLs for different platformsRefactoring
is_backend_plugin()andget_tool_name()helpers to reduce duplication?and.wrap_err()instead of verbose match blocksTest plan
🤖 Generated with Claude Code
Note
Implements cross-platform URL generation via
pre_install_for_platform(with platform name mapping) and refactors vfox backend helpers and env handling.get_tarball_urlusingvfox.pre_install_for_platform(...), mapping platforms (macos→darwin,x64→amd64).is_backend_plugin()andget_tool_name(); simplify backend calls with?/wrap_err; unify env var folding for PATH and others; minor cloning/path handling fixes.Plugin::pre_install_for_platform(version, os, arch)that temporarily overrides LuaOS_TYPE/ARCH_TYPEand restores them.Vfox::pre_install_for_platform(...)proxy to plugin method.Written by Cursor Bugbot for commit ef54195. This will update automatically on new commits. Configure here.