Skip to content

fix: wire post_extract hooks, fix bundled runtime detection, and correct provider URLs#795

Merged
loonghao merged 3 commits intoloonghao:mainfrom
piorpua:fix/bundled-runtime-detection-and-provider-urls
Apr 13, 2026
Merged

fix: wire post_extract hooks, fix bundled runtime detection, and correct provider URLs#795
loonghao merged 3 commits intoloonghao:mainfrom
piorpua:fix/bundled-runtime-detection-and-provider-urls

Conversation

@piorpua
Copy link
Copy Markdown

@piorpua piorpua commented Apr 13, 2026

Summary

  • Wire Starlark post_extract hooks into ManifestDrivenRuntime: Add PostInstallFn type, bridge function, and full post_install() implementation that executes set_permissions and run_command actions from provider.star scripts. This ensures tools like Rust's rustup-init are actually executed after download.
  • Fix bundled runtime executable detection: Change path.exists() to path.is_file() in ManifestDrivenRuntime to prevent directories (e.g. cargo/ CARGO_HOME) from being incorrectly matched as executables.
  • Fix cmake macOS download URL: Update platform mapping from Darwin-{arch} to macos-universal to match actual GitHub release asset naming (cmake-4.3.1-macos-universal.tar.gz). The old URLs returned 404, causing cmake to attempt re-installation on every invocation.
  • Fix jq environment key: Change "name" to "key" in environment() dict. The Rust env parser only recognizes "key", so the PATH prepend was silently ignored.

Root Cause

When running vx cargo --version on macOS, two bugs caused repeated ⬇ Installing rust@1.29.0... messages:

  1. post_extract hooks were never executedManifestDrivenRuntime had no wiring from Starlark post_extract() to Rust post_install(). So rustup-init was downloaded but never run, leaving cargo/bin/ empty.
  2. path.exists() matched directories — The bundled runtime search at mod.rs:955 used path.exists() which returns true for directories. The cargo/ CARGO_HOME directory was treated as the cargo executable, causing "Permission denied" errors.

After fixing rust, ⬇ Installing cmake@4.3.1... appeared on every run because cmake's macOS download URLs were 404 (asset naming changed from Darwin-arm64 to macos-universal).

Test plan

  • vx cargo --version — should install rust once, then detect as installed on subsequent runs
  • vx cmake --version — should download cmake-*-macos-universal.tar.gz successfully on macOS
  • vx rustc --version — bundled runtime should resolve correctly
  • Verify on macOS ARM64 and x64
  • Verify cmake install_layout strip_prefix matches the new asset naming

zynx added 3 commits April 13, 2026 19:19
…fix bundled runtime detection

- Add PostInstallFn type and post_install() implementation to ManifestDrivenRuntime
  that executes Starlark post_extract actions (set_permissions, run_command)
- Add make_post_install_fn_owned bridge function to convert Starlark PostExtractAction
  to JSON descriptors consumed by the Rust runtime
- Wire post_install into builder.rs for both single-runtime and multi-runtime providers
- Fix bundled runtime executable detection: change path.exists() to path.is_file()
  to prevent directories (e.g. cargo/ CARGO_HOME) from being treated as executables

This fixes the issue where `vx cargo --version` would re-install rust on every
invocation because rustup-init was never executed after download, and the cargo/
directory was incorrectly matched as the cargo executable.
- cmake: update macOS platform mapping from Darwin-{arch} to macos-universal,
  matching the actual GitHub release asset naming (cmake-4.3.1-macos-universal.tar.gz).
  This fixes 404 errors on macOS that caused cmake to re-install on every invocation.
- jq: fix environment() dict key from "name" to "key". The Rust env parser only
  recognizes "key", so the PATH prepend was silently ignored.
- grpcurl: use custom platform map (osx/x86_64) instead of github_go_provider
  which generated wrong names (darwin/amd64)
- k3d: assets are plain binaries (no .tar.gz), switch to binary_layout
- kind: fix get_execute_path to match binary_layout's bin/ subdirectory
- duckdb: use arch-specific .zip (osx-arm64) instead of universal .gz on macOS
@loonghao loonghao merged commit 108e290 into loonghao:main Apr 13, 2026
73 of 85 checks passed
@piorpua piorpua deleted the fix/bundled-runtime-detection-and-provider-urls branch April 14, 2026 13:11
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