prql icon indicating copy to clipboard operation
prql copied to clipboard

`cargo-run-bin`

Open max-sixty opened this issue 1 year ago • 6 comments

What's up?

https://github.com/dustinblackman/cargo-run-bin, from @dustinblackman

...looks cool — solves the problem of having to install lots of crates in task setup-dev.

Instead, install this one, set some aliases, and it'll install the correct version of the binary whenever it's called if necessary.

max-sixty avatar Feb 10 '24 19:02 max-sixty

I like this. We do have the required tools listed in flake.nix, but this would more user-friendly.

The instructions for getting started would be:

  • install rustup
  • install gotask
  • cargo install cargo-run-bin
  • task test-rust-fast

aljazerzen avatar Feb 13 '24 08:02 aljazerzen

Although, the flake.nix approach does have the benefit of having these binaries cached between projects (if they use the same version), so I wouldn't want to abandon that. The aliases you propose would break that.

Could the aliases be set conditionally?

aljazerzen avatar Feb 13 '24 08:02 aljazerzen

Interesting point on flake.nix, would indeed be good to keep that working (I'm less keen on routing everything through it, because it's a more involved integration, but great for those who want it).

There's https://github.com/dustinblackman/cargo-run-bin/issues/7, but I think that just means that cargo bin works on nix, rather than it routes cargo insta through nix; is that right?

max-sixty avatar Feb 13 '24 19:02 max-sixty

That issue is pointing to a PR that adds cargo-run-bin into nixpkgs, the main nix repository of software.

There is no "works on nix", as nix is just a package manager that pull packages from repos.

Our flake file is essentially just a list of stuff that we want installed, there is nothing more-involved. The main barrier is that one need nix installed, which is enough of a barrier to need other ways of listing dependencies.

aljazerzen avatar Feb 14 '24 14:02 aljazerzen

Totally, totally.

I think the only outstanding question was whether using cargo bin would skip nix for the inner binaries such as cargo-insta. I think the answer is "yes it would skip nix", is that your understanding?

max-sixty avatar Feb 14 '24 19:02 max-sixty

Yes, that is very probable.

aljazerzen avatar Feb 15 '24 08:02 aljazerzen