Resolve Rust git cli: dependency installs by package name lookup#1688
Resolve Rust git cli: dependency installs by package name lookup#1688
cli: dependency installs by package name lookup#1688Conversation
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
cli: hook installs for multi-binary git repositories
|
@copilot I think we already use --bins in cargo install, isn't that collision with --bin? |
Good question. I verified this: Cargo accepts |
|
@copilot use find_package_dir to find the package for the binary in the entry, and pass the package name to the |
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
Co-authored-by: j178 <10510431+j178@users.noreply.github.com>
cli: hook installs for multi-binary git repositoriescli: dependency installs by package name lookup
Implemented in |
Rust hooks with
additional_dependencieslikecli:https://...[:rev]can fail on repositories containing multiple binary packages becausecargo install --gitneeds an explicit package selection. This change resolves the package from the hookentrybinary and installs that package directly.Dependency parsing + package resolution
cli:dependency strings (git URL+ optionalrev, or crate + optional version).find_package_dirto mapentrybinary → owning package name.Cargo install invocation
cargo install --git(instead of passing--bin).cli:dependency behavior is unchanged.Focused test updates
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/fish-shell/fish-shell/commits/4.5.0/home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/cargo /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/cargo install --bins --root /home/REDACTED/.cache/prek/hooks/rust-AAocD40ReYOKrbqAn9pU --git REDACTED --tag 4.5.0 fish --locked relro jrqe�� ut86njw4vrlq8d4nhg.1iypvdb.rcgu.o v63463rj7jg9399o56.1iypvdb.rcgu.o /opt/pipx_bin/ginow -c core.autocrlf=fa-c -c git(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
additional_dependencieswith Rust hooks in repos that have multiple binaries #1682💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.