Repository navigation
fix: derive executable name from plugin ID for raw binary installs - #5
Merged
Merged
Conversation
Claude Code releases are raw binaries, not archives. When proto installs a non-archive download, it renames the file on disk to the plugin's configured ID (tool.get_file_name() in proto's flow/install.rs), e.g. `claude-code.exe` for `proto plugin add claude-code ...`. v0.2.0/v0.3.0 hardcoded the executable as `claude`/`claude.exe` in locate_executables, which never exists on disk under the default plugin ID. On Windows this surfaced as: - "Unable to symlink binary, source file does not exist" warnings during `proto install claude-code` - `proto::commands::run::missing_alternate_binary` when running `claude` Fix by deriving the exe name from get_plugin_id() at runtime and marking it as the primary executable — the same pattern moonrepo's own `moon` plugin uses for its raw-binary releases. Verified end-to-end in an isolated PROTO_HOME on Windows with an arbitrary plugin ID: install produces no symlink warnings, and both the `claude` shim and bin link run successfully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
proto install claude-codeon Windows (plugin v0.2.0/v0.3.0) emits symlink warnings and runningclaudefails:Root cause
Claude Code releases are raw binaries, not archives. When proto installs a non-archive download, it renames the file on disk to the plugin ID (
tool.get_file_name()in proto'sflow/install.rs) — so the installed file isclaude-code.exe, notclaude.exe.#1 renamed the executable in
locate_executablesfromclaude-codetoclaudeon the premise that "the downloaded binary is named claude" — but the download name is irrelevant; proto renames it to the plugin ID. That change is what broke v0.2.0+. (Installs made with v0.1.0, where the name happened to match the default ID, still work.)Fix
Derive the executable name from
get_plugin_id()at runtime and mark it as the primary executable — the same pattern moonrepo's ownmoonplugin uses for its raw-binary releases, with a code comment documenting this exact proto behavior.This is robust to any plugin ID the user chooses (
proto plugin add my-claude ...would installmy-claude.exeand still resolve correctly).Also bumps
Cargo.tomlversion to 0.3.1 (was still 0.1.0, soregister_toolreported a staleplugin_version).Verification
cargo fmt --check,cargo clippy --target wasm32-wasip1,cargo build --target wasm32-wasip1all passPROTO_HOME, registering the locally built WASM under the IDclaude-test(deliberately different from the default to prove ID derivation):claude-test.exe;bin/claude.exe,bin/claude-2.exe,bin/claude-2.1.exeand theclaudeshim are all created2.1.207 (Claude Code)After merge, tag
v0.3.1to publish the fixed WASM.