Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Nov 28, 2025

Summary

  • Add rename_exe option to github backend that renames binaries after archive extraction
  • Switch elm from ubi to github backend (uses existing bin option)
  • Switch opam from ubi to github backend (uses asset_pattern to select platform binary)
  • Switch yt-dlp from ubi to github backend (uses new rename_exe option)

This completes the migration of the last 3 tools that were using ubi as their primary backend, consolidating on the github backend.

Changes

New Feature

  • rename_exe option in install_artifact() renames the first executable found in an extracted archive

Registry Updates

  • elm: ubi:elm/compiler[exe=elm]github:elm/compiler[bin=elm]
  • opam: ubi:ocaml/opamgithub:ocaml/opam[asset_pattern=opam-*-*-{os}]
  • yt-dlp: ubi:yt-dlp/yt-dlp[rename_exe=yt-dlp]github:yt-dlp/yt-dlp[rename_exe=yt-dlp]

Test plan

  • Tested elm installation: mise install [email protected]elm --version returns 0.19.1
  • Tested opam installation: mise install [email protected]opam --version returns 2.5.0
  • Tested yt-dlp installation: mise install [email protected] → binary correctly renamed from yt-dlp_macos to yt-dlp

🤖 Generated with Claude Code


Note

Adds archive binary renaming and GNU arch templating to the GitHub backend, and switches elm, opam, and yt-dlp from ubi to github.

  • Backend (GitHub):
    • Add rename_exe option to rename the first executable after archive extraction (install_artifact), with helper rename_executable_in_dir.
    • Add {gnu_arch} template alias for asset patterns (e.g., x64 -> x86_64) in pattern templating.
  • Registry:
    • tools.elm: ubi:elm/compiler[exe=elm]github:elm/compiler[bin=elm].
    • tools.opam: ubi:ocaml/opamgithub:ocaml/opam[asset_pattern=opam-*-{gnu_arch}-{os}].
    • tools.yt-dlp: ubi:yt-dlp/yt-dlpgithub:yt-dlp/yt-dlp[rename_exe=yt-dlp].
  • Docs:
    • Document new rename_exe option with example and guidance in docs/dev-tools/backends/github.md.

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

… ubi

- Add `rename_exe` option to rename binaries after archive extraction
- Switch elm from ubi to github backend (uses existing `bin` option)
- Switch opam from ubi to github backend (uses `asset_pattern` to select platform binary)
- Switch yt-dlp from ubi to github backend (uses new `rename_exe` option)

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

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings November 28, 2025 22:33
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 migrates the last three tools (elm, opam, yt-dlp) from the ubi backend to the github backend and adds a new rename_exe option to support platform-specific binary renaming after archive extraction.

  • Implements rename_exe option in the github backend's install_artifact() function
  • Switches elm, opam, and yt-dlp from ubi to github backend with appropriate configuration options
  • Consolidates all tools on the github backend, eliminating ubi dependencies

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/backend/static_helpers.rs Adds rename_executable_in_dir() function and integrates rename_exe option into install_artifact()
registry.toml Updates backend configurations for elm, opam, and yt-dlp tools

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

for entry in std::fs::read_dir(dir)?.flatten() {
let path = entry.path();
if path.is_file() && crate::file::is_executable(&path) {
let file_name = path.file_name().unwrap().to_string_lossy();
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using unwrap() on file_name() will panic if the path terminates in ... Consider using ok_or_else() with a descriptive error instead to handle this edge case gracefully.

Suggested change
let file_name = path.file_name().unwrap().to_string_lossy();
let file_name = path
.file_name()
.ok_or_else(|| eyre::eyre!("Path '{}' has no file name", path.display()))?
.to_string_lossy();

Copilot uses AI. Check for mistakes.
/// Used by the `rename_exe` option to rename binaries after archive extraction.
fn rename_executable_in_dir(dir: &Path, new_name: &str) -> eyre::Result<()> {
// Find executables in the directory (non-recursive for top level)
for entry in std::fs::read_dir(dir)?.flatten() {
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

Using flatten() silently ignores read errors for individual directory entries. Consider handling these errors explicitly or logging them to avoid silently skipping files that fail to read.

Copilot uses AI. Check for mistakes.
return Ok(());
}
}
Ok(())
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The function returns Ok(()) when no executable is found, which silently ignores the case where rename_exe was specified but no suitable executable exists. This should return an error to alert users that the rename operation failed.

Suggested change
Ok(())
bail!(
"No executable file found in directory '{}' to rename to '{}'",
dir.display(),
new_name
);

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.10 x -- echo 20.1 ± 0.9 19.2 29.7 1.02 ± 0.06
mise x -- echo 19.8 ± 0.7 18.7 26.9 1.00

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.10 env 19.4 ± 0.4 18.6 21.6 1.00
mise env 19.5 ± 2.6 18.4 76.0 1.00 ± 0.14

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.10 hook-env 19.3 ± 0.3 18.8 20.5 1.00 ± 0.03
mise hook-env 19.3 ± 0.6 18.3 21.0 1.00

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.11.10 ls 17.3 ± 0.7 16.5 28.1 1.05 ± 0.05
mise ls 16.5 ± 0.3 15.9 19.4 1.00

xtasks/test/perf

Command mise-2025.11.10 mise Variance
install (cached) 109ms 109ms +0%
ls (cached) 67ms 67ms +0%
bin-paths (cached) 74ms 75ms -1%
task-ls (cached) 425ms 439ms -3%

- Add {gnu_arch} placeholder: x64 -> x86_64, arm64 stays arm64
- Fix opam to use {gnu_arch} (was downloading arm64 on x86_64 systems)
- Fix rename_executable_in_dir: check target exists before iterating
  (read_dir order is non-deterministic, could overwrite existing file)
- Document rename_exe option in GitHub backend docs

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

Co-Authored-By: Claude <[email protected]>
@jdx jdx merged commit 243c7ee into main Nov 28, 2025
33 of 36 checks passed
@jdx jdx deleted the feat/github-backend-exe-rename branch November 28, 2025 23:24
jdx pushed a commit that referenced this pull request Nov 30, 2025
jdx pushed a commit that referenced this pull request Nov 30, 2025
### 🚀 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)
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