Skip to content

fix(asdf): expose dependencies to install scripts - #11531

Merged
jdx merged 1 commit into
jdx:mainfrom
Marukome0743:pr11530
Jul 31, 2026
Merged

jdx merged 1 commit into
jdx:mainfrom
Marukome0743:pr11530

Conversation

@Marukome0743

@Marukome0743 Marukome0743 commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • expose installed mise tool dependencies to asdf bin/download and bin/install scripts during the same mise install
  • resolve backend and per-tool depends entries offline, place their bin paths ahead of ambient active-tool paths, and remove exact duplicates
  • document the asdf install-script behavior and add an offline parallel-install regression test

Problem

The install graph already waited for tools declared through [tools].depends, but the asdf script environment was built from the raw, unresolved install toolset. A dependency could therefore finish installing successfully while its executable was still absent from the PATH used by the dependent plugin. This produced the first-install failure reported with Python and Poetry in #4384; a later invocation worked only because the shell environment had been refreshed.

The registry now routes the Poetry shorthand through non-asdf backends, but the same generic defect remains for explicit, existing, and private asdf plugins.

Implementation

The dependency toolset helper now represents both backend-declared and per-instance dependencies and is shared by tools-enabled environment rendering and asdf installation. For asdf scripts, dependency paths are resolved offline after the install graph has completed those tools, prepended ahead of ambient configured paths, and deduplicated while preserving toolset order. Both bin/download and bin/install receive the resulting PATH. vfox hook PATH behavior is unchanged.

Testing

  • mise run test:e2e e2e/backend/test_asdf_install_dependency_path e2e/cli/test_tool_depends e2e/backend/test_vfox_install_tools_env_dep
  • mise exec -- cargo test --all-features backend::asdf::tests
  • mise exec -- cargo check --all-features
  • mise exec -- cargo fmt --all -- --check
  • ShellCheck and shfmt on the new E2E
  • Markdownlint and Prettier on the asdf documentation

The full mise run lint wrapper cannot run in this Sapling working copy because hk requires Git repository discovery; all checks relevant to the changed files were run individually. Docker Desktop was unavailable locally, so the hermetic Unix E2E will receive its Linux coverage in CI.

Addresses #4384

AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.

Summary by CodeRabbit

  • New Features

    • asdf installation scripts can now access executables from declared dependency tools.
    • Dependency tool paths are prioritized, deduplicated, and combined with active tool paths for reliable installations.
  • Documentation

    • Added guidance for configuring the asdf backend’s dependency option.
  • Tests

    • Added end-to-end coverage for dependency PATH handling, precedence, deduplication, and parallel installation.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d5f40bd-737c-48aa-b6bc-19bae02a3b4d

📥 Commits

Reviewing files that changed from the base of the PR and between d2ae2f7 and b3fa558.

📒 Files selected for processing (5)
  • docs/dev-tools/backends/asdf.md
  • e2e/backend/test_asdf_install_dependency_path
  • src/backend/asdf.rs
  • src/backend/mod.rs
  • src/backend/vfox.rs
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/dev-tools/backends/asdf.md
  • src/backend/asdf.rs
  • e2e/backend/test_asdf_install_dependency_path
  • src/backend/vfox.rs
  • src/backend/mod.rs

📝 Walkthrough

Walkthrough

asdf installation now resolves dependency tool paths, places them before active tool paths, and removes duplicates before running plugin scripts. Backend helper naming and documentation were updated, with end-to-end coverage for PATH precedence and parallel installation.

Changes

asdf dependency PATH support

Layer / File(s) Summary
Dependency toolset resolution
src/backend/mod.rs, src/backend/vfox.rs
The dependency toolset helper is renamed, dependency names are expanded, and the helper is used for postinstall and vfox tool-value environment resolution.
asdf install PATH assembly and validation
src/backend/asdf.rs, e2e/backend/test_asdf_install_dependency_path, docs/dev-tools/backends/asdf.md
asdf plugin scripts receive deduplicated dependency-first PATH entries. Documentation and end-to-end tests cover precedence, unique insertion, parallel installation, and executable success.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Backend
  participant install_version_
  participant asdf_plugin_scripts
  Backend->>install_version_: resolve dependency toolset
  install_version_->>install_version_: combine and deduplicate dependency and active paths
  install_version_->>asdf_plugin_scripts: run download and install scripts with ordered PATH
  asdf_plugin_scripts-->>Backend: install dependent executable
Loading

Poem

A rabbit checks the toolset trail,
Dependency paths lead without fail.
Scripts find the intended tool,
Duplicate entries leave the spool.
Parallel installs complete!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes exposing asdf dependencies to install scripts, which is the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
e2e/backend/test_asdf_install_dependency_path (1)

8-14: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Make the ambient PATH fixture self-contained.

Create $HOME/bin and prepend it to PATH here; otherwise a harness without that setup can skip the shadowing scenario or fail before the assertion.

Proposed fix
 # A same-named executable already on the ambient PATH must not outrank the
 # dependency declared by the tool.
+mkdir -p "$HOME/bin"
+export PATH="$HOME/bin:$PATH"
 cat >"$HOME/bin/dummy" <<'EOF'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/backend/test_asdf_install_dependency_path` around lines 8 - 14, Update
the ambient PATH fixture around the dummy executable setup to create $HOME/bin
before writing the file, then prepend $HOME/bin to PATH in the test environment.
Keep the existing dummy executable contents and permissions unchanged so it
reliably shadows any same-named executable during the dependency-path assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@e2e/backend/test_asdf_install_dependency_path`:
- Around line 8-14: Update the ambient PATH fixture around the dummy executable
setup to create $HOME/bin before writing the file, then prepend $HOME/bin to
PATH in the test environment. Keep the existing dummy executable contents and
permissions unchanged so it reliably shadows any same-named executable during
the dependency-path assertion.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 76f4968d-a6cb-4f98-88bc-5eb7dd57047f

📥 Commits

Reviewing files that changed from the base of the PR and between 2e5d0e6 and 7fa7c52.

📒 Files selected for processing (5)
  • docs/dev-tools/backends/asdf.md
  • e2e/backend/test_asdf_install_dependency_path
  • src/backend/asdf.rs
  • src/backend/mod.rs
  • src/backend/vfox.rs

Comment thread src/backend/asdf.rs
@greptile-apps

greptile-apps Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR exposes installed dependencies to asdf installation scripts.

  • Normalizes aliases and backend names while resolving per-tool dependencies offline.
  • Prepends dependency paths ahead of ambient active-tool paths and removes exact duplicates.
  • Documents the behavior and adds an end-to-end regression test covering alias resolution, parallel installation, precedence, and deduplication.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported alias-resolution defect is fixed: dependency names are normalized to short and full backend forms before toolset filtering, and the regression test exercises the nodejs-to-node alias path.

Important Files Changed

Filename Overview
src/backend/asdf.rs Builds the asdf installation-script PATH from resolved dependency paths followed by deduplicated active-tool paths.
src/backend/mod.rs Generalizes install-time dependency resolution and normalizes aliases and backend names before filtering the configured toolset.
src/backend/vfox.rs Renames the shared dependency-resolution helper without changing vfox hook PATH behavior.
e2e/backend/test_asdf_install_dependency_path Covers first-install dependency visibility, alias normalization, PATH precedence, deduplication, and parallel graph ordering.
docs/dev-tools/backends/asdf.md Documents that declared dependencies are available to asdf download and install scripts.

Reviews (3): Last reviewed commit: "fix(asdf): expose dependencies to instal..." | Re-trigger Greptile

@jdx
jdx merged commit d0d2f6f into jdx:main Jul 31, 2026
30 checks passed
@Marukome0743
Marukome0743 deleted the pr11530 branch July 31, 2026 18:27
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