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

RFC: First class support for external crates #530

Closed
UebelAndre opened this issue Dec 9, 2020 · 4 comments
Closed

RFC: First class support for external crates #530

UebelAndre opened this issue Dec 9, 2020 · 4 comments

Comments

@UebelAndre
Copy link
Collaborator

In working on #392 I found https://github.com/dtolnay/cxx which is a crate that could potentially satisfy the need for both bindgen and cbindgen. The interesting bit is that cxx provides Bazel rules for use with rules_cc and rules_rust. This stands out to me as the ideal location for such rules. However, the primary Rust rules for Bazel include proto/grpc, bindgen, and wasm-bindgen rules which are all based on external crates. There's even talk of adding additional rules for external crates (#479 #392).

My questions are, is this the ideal future? Should rules_rust have first class rules for these crates? Or should we be striving add these rules to the relevant crates? Where should the line be drawn on what gets added to the rules and what doesn't?

@damienmg @illicitonion @mfarrugi @smklein @dfreese

@mfarrugi
Copy link
Collaborator

mfarrugi commented Dec 10, 2020 via email

@UebelAndre
Copy link
Collaborator Author

What is bzlmod?

And I don't feel like it makes "perfect" sense. The thing I'd like to take a crack at is a rule (likely backed by cargo-raze) which lives in rules_rust could be used to build a crate given it's Cargo.toml and Cargo.lock files and be used in a small .bzl file committed to that repo. I would imagine if the footprint is small enough and it didn't conflict with design choices of that crate, that it could be added once and go untouched for quite some time.

I think even if rules_rust continues to have first class rules for these external crates, that this is functionality that would be extremely beneficial.

@mfarrugi
Copy link
Collaborator

mfarrugi commented Dec 10, 2020 via email

@UebelAndre
Copy link
Collaborator Author

Closing this since there doesn't appear to be much interest and the focus has sorta shifted. Maybe my original hopes for this RFC can be solved in the future with better ways to interact with external crates

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

No branches or pull requests

2 participants