Skip to content

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Nov 28, 2025

Summary

Some GitHub releases extract binaries into subdirectories without a bin folder. For example, tusd extracts to:

tusd_darwin_arm64/
  tusd  (executable)
LICENSE.txt
README.md

The previous discover_bin_paths() implementation only looked for:

  1. Explicit bin_path option
  2. {install_path}/bin
  3. {subdir}/bin directories

It didn't find binaries that are directly in a subdirectory (like tusd_darwin_arm64/tusd).

Changes

  • Enhanced discover_bin_paths() in src/backend/github.rs to also check subdirectories for executable files directly
  • Switched tusd from ubi to github backend (now works with this fix)

Test plan

  • Built mise and tested mise install tusd@latest
  • Verified mise x tusd -- tusd --version outputs Version: v2.8.0
  • Confirmed binary is found in tusd_darwin_arm64/tusd subdirectory

🤖 Generated with Claude Code


Note

Enhances GitHub backend bin discovery to find executables directly in subdirectories and updates tools.tusd to use the GitHub backend.

  • Backend (GitHub)
    • Updates discover_bin_paths in src/backend/github.rs to also detect executables directly inside subdirectories when no bin dir is present.
  • Registry
    • Changes tools.tusd backend from ubi:tus/tusd to github:tus/tusd.

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

Some GitHub releases extract binaries into subdirectories without a `bin`
folder (e.g., tusd extracts to `tusd_darwin_arm64/tusd`). The previous
implementation only looked for `{subdir}/bin` directories.

Now also checks subdirectories for executable files directly, enabling
tools like tusd to work with the github backend.

Also switches tusd from ubi to github backend.

🤖 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:17
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 the GitHub backend's binary discovery mechanism to handle releases that place executables directly in subdirectories without a bin folder. The fix enables tools like tusd to work correctly when installed via the GitHub backend.

  • Enhanced discover_bin_paths() to recursively search subdirectories for executable files
  • Migrated tusd from ubi to github backend to utilize this improvement

Reviewed changes

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

File Description
src/backend/github.rs Added logic to check for executables directly in subdirectories when no bin folder exists
registry.toml Changed tusd backend from ubi to github to leverage the new discovery mechanism

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

for sub_entry in sub_entries.flatten() {
let sub_path = sub_entry.path();
if sub_path.is_file() && file::is_executable(&sub_path) {
paths.push(path.clone());
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 path.clone() is called inside a loop but only used once before breaking. Consider moving the clone outside the conditional check or use paths.push(path); break; directly since path is moved after the loop anyway.

Suggested change
paths.push(path.clone());
paths.push(path);

Copilot uses AI. Check for mistakes.
Comment on lines +348 to +353
if let Ok(sub_entries) = std::fs::read_dir(&path) {
for sub_entry in sub_entries.flatten() {
let sub_path = sub_entry.path();
if sub_path.is_file() && file::is_executable(&sub_path) {
paths.push(path.clone());
break;
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.

[nitpick] The nested subdirectory search adds two levels of depth. Consider extracting the executable search logic into a separate helper function like has_executable_files(dir_path: &Path) -> bool to improve readability and maintainability.

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

Hyperfine Performance

xtasks/test/perf

Command mise-2025.11.10 mise Variance
install (cached) 108ms 106ms +1%
ls (cached) 65ms 65ms +0%
bin-paths (cached) 71ms 71ms +0%
task-ls (cached) 423ms 427ms +0%

@jdx jdx enabled auto-merge (squash) November 28, 2025 23:20
@jdx jdx disabled auto-merge November 28, 2025 23:24
@jdx jdx merged commit 465d52e into main Nov 28, 2025
47 of 54 checks passed
@jdx jdx deleted the fix/github-backend-subdir-binaries branch November 28, 2025 23:24
jdx added a commit that referenced this pull request Nov 30, 2025
…ble (#7151)

#7138 broke `e2e-win/7z.Tests.ps1`.


[7z2500-extra.7z](https://github.com/ip7z/7zip/releases/download/25.00/7z2500-extra.7z)
has a directory structure like:
```
7z2500-extra$ ls -R
.:
7za.dll  7za.exe  7zxa.dll  Far  License.txt  arm64  history.txt  readme.txt  x64

./Far:
7-ZipEng.hlf  7-ZipEng.lng  7-ZipFar.dll  7-ZipFar64.dll  7-ZipRus.hlf  7-ZipRus.lng  7zToFar.ini  far7z.reg  far7z.txt

./arm64:
7-ZipFar.dll  7za.dll  7za.exe  7zxa.dll

./x64:
7za.dll  7za.exe  7zxa.dll
```
So if both `/arm64` and `/x64` are on `PATH`, `/arm64/7za.exe` is used
even on x64 arch.

This PR fixes this by prioritising the root path if the root path
contains an executable file.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Prefer the install root as the bin path when it contains executables,
and update docs and e2e to reflect the new lookup order.
> 
> - **Backend**
> - **Bin path resolution (`src/backend/github.rs`)**: Before scanning
subdirectories, if the install root contains an executable, use the
install root as the bin path.
> - **Docs**
> - Update binary path lookup order in
`docs/dev-tools/backends/github.md` and
`docs/dev-tools/backends/gitlab.md` to prioritize the install root when
it has an executable and clarify subdirectory executable handling.
> - **Tests**
> - `e2e/backend/test_github`: add `mise uninstall` steps before
installs for raw file and lockfile scenarios to ensure clean state.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
bafd825. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: jdx <[email protected]>
Co-authored-by: Claude <[email protected]>
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