-
Notifications
You must be signed in to change notification settings - Fork 104
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
Build with bazel? #61
Comments
Similar issue from a while ago: Historical blocker has been that this crate transitively depends on SSL crates (via Cargo itself), which require manual tweaks. Some thought also would need to go into what the bootstrapping behavior should look like. I've punted on this because I'd like a more general/durable approach for patching generated BUILD files. I'm interested and historically have been interested in a feature like this because it enables using cargo-raze within a genrule or repository rule, which might be interesting. EDIT:That said, if anyone would immediately derive value from having this be buildable as a remote repository without a generation step, then that could be done as a one-off thing by committing a WORKSPACE file and some BUILD files. It might require some hacks in order to be multi-platform, but I think its doable. |
@pcj is vendoring (a release of) the binary sufficient? Is your goal for a user to be able to build a repository with just an installation of bazel, or something else? |
Well, I think what I'd like to do is use cargo-raze in a similar manner to bazel-gazelle. In that scenario, a user declares a dependency on Analogously, if I had an existing dependency on Granted, I suppose the ergonomics aren't that different from the existing workflow, but anyway that's what I'm thinking. And it spares me from having to have rust and cargo already on my system. |
Agree with @pcj on making cargo-raze be similar to bazel-gazelle in terms of bootstrapping. That is more general. Looks like this issue has been stale for a while. Is there any initiative from within Google that does this? |
There isn't any existing effort to make this happen. This project is a 20% effort (largely less than that recently), and community input and contributions are very welcome. The notes from a meeting of large companies using rust (direct link to notes here) are probably the clearest picture I can give as to what is happening in-organization. |
@qzmfranklin The big blocker here (I tried and gave up somewhat) is what to do about cargo itself. Currently cargo-raze defaults to cargos api for getting details about packages, as such to get this working means getting cargo to compile in bazel by itself thats not too hard, but it also means curl-sys (and curl) openssl-sys (and thus openssl) and some other deps. Naturally I, you and others probably have these in our respective trees, but with subtly different configurations and names. I personally am not a fan of bazel aliases for deps and for rules and tools to bring deps into our tree that we cant easily control. The other option would thus to be use cargo as a tool inside bazel, maybe having Right now I come away from this and figure that presently its better as a bridge program between the two worlds that places its feet more in the rust / cargo kingdom than the bazel one. |
@GregBowyer perhaps things are a little easier now that #156 has been merged? |
This seems possible but I don't think would be a good idea to tackle right now. I feel like there's some "chicken and egg" issues building with Bazel would introduce. However, that said, |
Cargo raze is totally buildable with Bazel as of #340 If anyone finds something not working about the Bazel builds, they should open a new ticket but I think this ticket could be closed. |
Closing as this has been implemented. CI, due to forcibly migrating from Travis, doesn't test this functionality currently. Github actions look promising (example PR), but I hit some roadblocks with examples that I didn't understand and haven't had to investigate further. |
FWIW I have this nearly completely building in bazelbuild/rules_rust#578 The two notable parts:
To get this working, I've made a few changes that I've opened in PRs (and some I'm waiting on other PRs to go through). It'd help a lot to get those through |
Given that this project is a bazel build file generator, seems like it should build with bazel. Specifically, I'd like to pull down and reference a
rust_binary
without having to use crates.io / cargo itself!.The text was updated successfully, but these errors were encountered: