Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo-run-bin #4204

Open
max-sixty opened this issue Feb 10, 2024 · 6 comments
Open

cargo-run-bin #4204

max-sixty opened this issue Feb 10, 2024 · 6 comments
Labels

Comments

@max-sixty
Copy link
Member

max-sixty commented Feb 10, 2024

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.

@aljazerzen
Copy link
Member

aljazerzen commented Feb 13, 2024

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
Copy link
Member

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?

@max-sixty
Copy link
Member Author

max-sixty commented Feb 13, 2024

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 dustinblackman/cargo-run-bin#7, but I think that just means that cargo bin works on nix, rather than it routes cargo insta through nix; is that right?

@aljazerzen
Copy link
Member

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.

@max-sixty
Copy link
Member Author

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?

@aljazerzen
Copy link
Member

aljazerzen commented Feb 15, 2024

Yes, that is very probable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants