Publish a bazel-built crate on crates.io?

109 views
Skip to first unread message

Filip Filmar

unread,
Aug 1, 2023, 5:40:22 PM8/1/23
to bazel-discuss
Hi folks!

Are there rules that allow publishing bazel-built crates to crates.io, by any chance?


F

Daniel Wagner-Hall

unread,
Aug 1, 2023, 6:51:45 PM8/1/23
to Filip Filmar, bazel-discuss
Hi! rules_rust maintainer here - I'm not aware of any rules to do so, but https://github.com/bazelbuild/rules_rust/issues/458 tracks rules_rust support.

Happy to discuss approaches and review PRs, if you're interested in contributing :)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/CAKaOXih7H1x8g5GUX%2Bru2x48%2B4%2BwizShe2cPVkOb2phZfdD4bg%40mail.gmail.com.

Brian Silverman

unread,
Aug 2, 2023, 1:15:52 AM8/2/23
to Daniel Wagner-Hall, Filip Filmar, bazel-discuss
The whole Cargo ecosystem (including crates.io) does not support distributing binary crates. Rust doesn't have a stable ABI either, so there really aren't any paths towards it. I think you're going to have to support building your crate with Cargo to publish it to crates.io.

Filip Filmar

unread,
Aug 2, 2023, 2:30:12 PM8/2/23
to Brian Silverman, Daniel Wagner-Hall, bazel-discuss
On approaches, I suppose the baseline of presenting the crate source to `cargo` as if it were a rust project could be a baseline. Don't know what else is required.

Daniel Wagner-Hall

unread,
Aug 3, 2023, 5:34:34 AM8/3/23
to Filip Filmar, Brian Silverman, bazel-discuss
I wrote up some thoughts on https://github.com/bazelbuild/rules_rust/issues/458#issuecomment-1663627425 - hopefully this is helpful!
Reply all
Reply to author
Forward
0 new messages