install icon indicating copy to clipboard operation
install copied to clipboard

Allow specifying features for the installed crates

Open Razican opened this issue 4 years ago • 2 comments

Motivation

I currently use this line in my workflows:

cargo install --features postgres --no-default-features diesel_cli

This action currently doesn't allow specifying features (or removing default features) of a crate, and that would be nice.

Workflow example

on: [push]

name: build

jobs:
  check:
    name: Rust project
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/[email protected]
        with:
          crate: diesel_cli
          version: latest
          features: postgres
          default-features: false
      - run: diesel migration run

Additional context

If we want to also support cache for this, we would need to add cache for different feature matrices, which might prove difficult.

Razican avatar Apr 02 '20 15:04 Razican

Hey, @Razican!

It was intentional not to support any additional arguments for cargo install command for the first public version; most of the cargo plugins and other tools do not use cargo features, so we can speed up installation for them at least.

diesel-cli and other binary crates, which are requiring features to be set, are definitely a great thing to add into the tools cache, but you are correct about the cache bloating, though, so this thing needs to be thinked about first.

svartalf avatar Apr 03 '20 10:04 svartalf

wasmer-cli is another example of a crate that requires features to enable the binary target.

My team's crate, icu_datagen, is another.

sffc avatar Oct 25 '22 19:10 sffc