fix(install): use backend bin paths for per-tool postinstall hooks#8234
fix(install): use backend bin paths for per-tool postinstall hooks#8234
Conversation
The Settings component accepted a `prefix` prop in the task-configuration docs but never implemented it, causing all settings to be shown instead of only task-related ones. Closes #8216 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The per-tool postinstall hook was hardcoding `$install_path/bin` on PATH via `path_env_with_tv_path()`. For backends like aqua where the binary lives in a non-standard subdirectory (e.g. `linux-amd64/`), the tool's own command was not found during postinstall execution. Now uses `self.list_bin_paths()` which each backend overrides to return the correct binary directories. Fixes #6323 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @jdx, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where per-tool postinstall hooks failed to locate binaries for certain tools due to hardcoded path assumptions. By leveraging backend-specific binary path listings, the system now correctly identifies and includes tool binaries in the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly modifies the post-install hook mechanism to use backend-specific binary paths, which is a good improvement for supporting tools with non-standard directory layouts. The core logic change in src/backend/mod.rs is sound.
However, I've noticed an issue in the new e2e test (test_install_postinstall_bin_path) where it seems to be checking for an incorrect version string. This could cause the test to fail or pass for the wrong reasons, and should be corrected to ensure the test is reliable.
| # Install the tool — the postinstall hook should be able to run the dummy command | ||
| output=$(mise install dummy 2>&1) | ||
|
|
||
| if [[ $output == *"2.0.0"* ]]; then |
There was a problem hiding this comment.
The test appears to be checking for the wrong version string. The dummy vfox plugin's post_install.lua script creates a dummy executable that outputs dummy version 1.0.0. However, this test checks for 2.0.0.
Unless there's another dummy command in the test environment that outputs 2.0.0, this check will fail or pass for the wrong reasons. To correctly verify that the dummy tool's binary is being executed by the post-install hook, this check should likely be updated to look for 1.0.0.
if [[ $output == *"1.0.0"* ]]; then
There was a problem hiding this comment.
Pull request overview
Updates per-tool postinstall hook execution so the tool’s binaries are discoverable on PATH across different backend install layouts (e.g. aqua placing binaries under platform subdirectories), and adds documentation/UI support for filtering settings by prefix.
Changes:
- Use
Backend::list_bin_paths()to constructPATHfor per-tool postinstall hooks instead of hardcoding$install_path/bin. - Add an e2e test intended to ensure the tool binary is available during postinstall hook execution.
- Extend docs settings component to support filtering settings by a
prefixprop.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/backend/mod.rs |
Builds the postinstall hook PATH using backend-provided bin paths for correct tool discovery. |
e2e/cli/test_install_postinstall_bin_path |
Adds an e2e regression test for postinstall PATH behavior. |
docs/components/settings.vue |
Adds prefix-based filtering to narrow displayed settings in docs pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install the tool — the postinstall hook should be able to run the dummy command | ||
| output=$(mise install dummy 2>&1) | ||
|
|
||
| if [[ $output == *"2.0.0"* ]]; then | ||
| echo "✓ postinstall hook found tool binary on PATH" | ||
| else | ||
| echo "✗ postinstall hook could not find tool binary" | ||
| echo "Output: $output" | ||
| exit 1 |
There was a problem hiding this comment.
This test is likely to produce false positives: the assertion only checks for "2.0.0" in mise install output, but that version string can appear in normal install logs even if the postinstall command never successfully runs the tool binary. Consider making the postinstall hook print a unique marker after invoking the tool (or assert on the tool’s distinctive output), and assert on that marker instead.
| cat <<EOF >mise.toml | ||
| [tools] | ||
| dummy = { version = "latest", postinstall = "dummy" } | ||
| EOF |
There was a problem hiding this comment.
This doesn’t currently exercise the nonstandard-bin-path behavior described in the PR (e.g. aqua/helm under linux-amd64/): the dummy fixture installs its executable into $install_path/bin, so the old hardcoded PATH logic would also pass. To validate the fix, use a fixture/backend where list_bin_paths() returns a non-bin/ directory (e.g. add a list-bin-paths hook to the dummy plugin and install the binary into a nested directory), then assert that the postinstall hook can resolve the binary.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.16 x -- echo |
24.6 ± 0.6 | 23.6 | 26.7 | 1.00 |
mise x -- echo |
25.1 ± 0.8 | 23.7 | 27.9 | 1.02 ± 0.04 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.16 env |
25.0 ± 1.3 | 23.1 | 36.5 | 1.00 |
mise env |
25.4 ± 1.0 | 23.6 | 31.1 | 1.02 ± 0.07 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.16 hook-env |
26.5 ± 0.6 | 25.3 | 31.5 | 1.00 |
mise hook-env |
26.7 ± 0.4 | 25.4 | 27.7 | 1.01 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.2.16 ls |
23.6 ± 0.5 | 21.6 | 25.1 | 1.00 |
mise ls |
24.1 ± 0.5 | 22.2 | 25.7 | 1.02 ± 0.03 |
xtasks/test/perf
| Command | mise-2026.2.16 | mise | Variance |
|---|---|---|---|
| install (cached) | 136ms | 136ms | +0% |
| ls (cached) | 85ms | 84ms | +1% |
| bin-paths (cached) | 90ms | 90ms | +0% |
| task-ls (cached) | 864ms | 846ms | +2% |
### 🐛 Bug Fixes - **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [#8234](#8234) - **(use)** write to config.toml instead of config.local.toml by @jdx in [#8240](#8240) - default legacy .mise.backend installs to non-explicit by @jean-humann in [#8245](#8245) ### 🚜 Refactor - **(config)** consolidate flat task_* settings into nested task.* by @jdx in [#8239](#8239)
## [2026.2.18](https://github.com/jdx/mise/compare/v2026.2.17..v2026.2.18) - 2026-02-21 ### 🚀 Features - **(install)** auto-lock all platforms after tool installation by @jdx in [#8277](jdx/mise#8277) ### 🐛 Bug Fixes - **(config)** respect --yes flag for config trust prompts by @jdx in [#8288](jdx/mise#8288) - **(exec)** strip shims from PATH on Unix to prevent infinite recursion by @jdx in [#8276](jdx/mise#8276) - **(install)** validate --locked before --dry-run short-circuit by @altendky in [#8290](jdx/mise#8290) - **(release)** refresh PATH after mise up in release-plz by @jdx in [#8292](jdx/mise#8292) - **(schema)** replace unevaluatedProperties with additionalProperties by @jdx in [#8285](jdx/mise#8285) - **(task)** avoid duplicated stderr on task failure in replacing mode by @jdx in [#8275](jdx/mise#8275) - **(task)** use process groups to kill child process trees on Unix by @jdx in [#8279](jdx/mise#8279) - **(task)** run depends_post tasks even when parent task fails by @jdx in [#8274](jdx/mise#8274) - **(task)** suggest similar commands when mistyping a CLI subcommand by @jdx in [#8286](jdx/mise#8286) - **(task)** execute monorepo subdirectory prepare steps from root by @jdx in [#8291](jdx/mise#8291) - **(upgrade)** don't force-reinstall already installed versions by @jdx in [#8282](jdx/mise#8282) - **(watch)** restore terminal state after watchexec exits by @jdx in [#8273](jdx/mise#8273) ### 📚 Documentation - clarify that MISE_CEILING_PATHS excludes the ceiling directory itself by @jdx in [#8283](jdx/mise#8283) ### Chore - replace gen-release-notes script with communique by @jdx in [#8289](jdx/mise#8289) ### New Contributors - @altendky made their first contribution in [#8290](jdx/mise#8290) ### 📦 Aqua Registry Updates #### New Packages (4) - [`Skarlso/crd-to-sample-yaml`](https://github.com/Skarlso/crd-to-sample-yaml) - [`kunobi-ninja/kunobi-releases`](https://github.com/kunobi-ninja/kunobi-releases) - [`swanysimon/markdownlint-rs`](https://github.com/swanysimon/markdownlint-rs) - [`tmux/tmux-builds`](https://github.com/tmux/tmux-builds) #### Updated Packages (2) - [`firecow/gitlab-ci-local`](https://github.com/firecow/gitlab-ci-local) - [`k1LoW/runn`](https://github.com/k1LoW/runn) ## [2026.2.17](https://github.com/jdx/mise/compare/v2026.2.16..v2026.2.17) - 2026-02-19 ### 🚀 Features - **(prepare)** update mtime of outputs after command is run by @halms in [#8243](jdx/mise#8243) ### 🐛 Bug Fixes - **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [#8234](jdx/mise#8234) - **(use)** write to config.toml instead of config.local.toml by @jdx in [#8240](jdx/mise#8240) - default legacy .mise.backend installs to non-explicit by @jean-humann in [#8245](jdx/mise#8245) ### 🚜 Refactor - **(config)** consolidate flat task_* settings into nested task.* by @jdx in [#8239](jdx/mise#8239) ### Chore - **(prepare)** refactor common code into ProviderBase by @halms in [#8246](jdx/mise#8246) ### 📦 Aqua Registry Updates #### Updated Packages (1) - [`namespacelabs/foundation/nsc`](https://github.com/namespacelabs/foundation/nsc)
…dx#8234) ## Summary - Per-tool postinstall hooks were hardcoding `$install_path/bin` on PATH, which doesn't work for backends like aqua where binaries live in non-standard subdirectories (e.g. `linux-amd64/`) - Now uses `self.list_bin_paths()` which each backend overrides to return the correct binary directories - Fixes the case where `helm completion bash > ...` fails during postinstall because the `helm` binary is at `~/.local/share/mise/installs/helm/4.1.1/linux-amd64/helm` Fixes jdx#6323 (reply in thread) ## Test plan - [x] Added e2e test `test_install_postinstall_bin_path` that verifies the tool binary is accessible during postinstall hook execution - [x] Existing `test_install_postinstall_cli_version` still passes - [x] `mise run lint` passes clean 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes install-time hook environment setup, which can affect whether postinstall scripts run successfully across backends and platforms; the added e2e test reduces regression risk. > > **Overview** > Per-tool `postinstall` hook execution now prepends PATH using each backend’s `list_bin_paths()` output (via `PathEnv`) rather than hardcoding `install_path/bin`, fixing hooks for backends where binaries live in non-standard subdirectories. > > Adds an e2e regression test (`test_install_postinstall_bin_path`) that installs a dummy tool with a `postinstall` command and asserts the tool binary is available on PATH during hook execution. Separately, the docs settings component adds an optional `prefix` prop to filter displayed settings by key prefix. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ed64134. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
### 🐛 Bug Fixes - **(install)** use backend bin paths for per-tool postinstall hooks by @jdx in [jdx#8234](jdx#8234) - **(use)** write to config.toml instead of config.local.toml by @jdx in [jdx#8240](jdx#8240) - default legacy .mise.backend installs to non-explicit by @jean-humann in [jdx#8245](jdx#8245) ### 🚜 Refactor - **(config)** consolidate flat task_* settings into nested task.* by @jdx in [jdx#8239](jdx#8239)
Summary
$install_path/binon PATH, which doesn't work for backends like aqua where binaries live in non-standard subdirectories (e.g.linux-amd64/)self.list_bin_paths()which each backend overrides to return the correct binary directorieshelm completion bash > ...fails during postinstall because thehelmbinary is at~/.local/share/mise/installs/helm/4.1.1/linux-amd64/helmFixes #6323 (reply in thread)
Test plan
test_install_postinstall_bin_paththat verifies the tool binary is accessible during postinstall hook executiontest_install_postinstall_cli_versionstill passesmise run lintpasses clean🤖 Generated with Claude Code
Note
Medium Risk
Changes install-time hook environment setup, which can affect whether postinstall scripts run successfully across backends and platforms; the added e2e test reduces regression risk.
Overview
Per-tool
postinstallhook execution now prepends PATH using each backend’slist_bin_paths()output (viaPathEnv) rather than hardcodinginstall_path/bin, fixing hooks for backends where binaries live in non-standard subdirectories.Adds an e2e regression test (
test_install_postinstall_bin_path) that installs a dummy tool with apostinstallcommand and asserts the tool binary is available on PATH during hook execution. Separately, the docs settings component adds an optionalprefixprop to filter displayed settings by key prefix.Written by Cursor Bugbot for commit ed64134. This will update automatically on new commits. Configure here.