taiki-e / install-action

GitHub Action for installing development tools (mainly from GitHub Releases).
Apache License 2.0
249 stars 32 forks source link

[bug] Cargo not found #500

Closed melMass closed 2 months ago

melMass commented 2 months ago

Hi,

In a CI where I don't need Rust but some rust binaries I wanted to use this action but following the fallback approach, i.e:

    - uses: taiki-e/install-action@v2
      with:
        tool: exa,ripgrep,coreutils,fd-find

It fails as it tries to call cargo binstall and not cargo-binstall. I tried the "official" binstall action but it doesn't add the bin path to PATH and I couldn't find a reliable way to do it cross runners.

Is there a better way?

Thanks

NobodyXu commented 2 months ago

I think calling cargo-binstall instead of cargo binstall in this action would work?

taiki-e commented 2 months ago

I thought cargo-binstall requires cargo, so I wrote docs as follows:

https://github.com/taiki-e/install-action#compatibility

at least the following tools are required:

  • bash
  • cargo (if you use cargo-binstall fallback)

But if cargo-binstall works without cargo, it would make sense to call it without cargo as we already do with other cargo-* tools.

If cargo-binstall does not work without cargo and you have strong reservations about installing cargo, I think it would be best to add the tools you want to use to this action as officially supported tools.

taiki-e commented 2 months ago

Filed https://github.com/taiki-e/install-action/pull/501 to fix this.

taiki-e commented 2 months ago

Fixed in 2.34.0. Thanks @melMass for the report!

melMass commented 2 months ago

That was fast. Thanks a lot!

NobodyXu commented 2 months ago

But if cargo-binstall works without cargo, it would make sense to call it without cargo as we already do with other cargo-* tools.

It doesn't need cargo, it's designed to be standalone, and have no runtime dependencies (on musl also no libc/lld)