Closed alexeagle closed 1 month ago
@illicitonion first thing I'm missing is: how do you run the cargo
command that rules_rust has installed, so you can add a dependency? See npm, python, and Go where the README says how to do that: https://github.com/aspect-build/aspect-workflows-template/blob/main/%7B%7B%20.ProjectSnake%20%7D%7D/README.bazel.md#working-with-npm-packages
@alexeagle Ok, I've fixed up a few things, and got this working some - cargo add
and friends are now supported and documented :) Shall we put together a list of things you'd be wanting to support out of the box?
I'm thinking (and please add/comment/edit):
This should Just Work, but we can do some testing and make sure the UX is as desired
We should make sure the correct editions are being used per-target
cc @mrmeku and https://github.com/aspect-build/rules_lint/issues/385
If we're defaulting to "just lay stuff out like Cargo would expect", rust-analyzer should just work out of the box with nothing special.
But in general, rules_rust offers a target: bazel run @rules_rust//tools/rust_analyzer:gen_rust_project
which will generate a rust-project.json
in the workspace root (which we should probably .gitignore
), which rust-analyzer will detect and configure itself with.
We have a choice to make here between using build.rs
for cargo compatibility, or using rules_proto
for re-use between other Bazel languages.
We could probably put together a "use rules_proto, and copy_file
the generated code somewhere Cargo will see it" approach, and even if we wanted to be fancy generate a build.rs
which runs Bazel to update this generated code...
We should probably make the sample app be a clap
application, and show how to hook version stamping into Clap's versioning, as well as maybe how to expose it from a custom metrics page or something.
We should probably make the sample app be a clap application
We don't have any sample apps in this setup right now. It would be neat to scaffold those out but it should be a separate effort and include the existing languages
I forgot to say, yay, very cool :)
Goals: