Cargo publish with a vendored crate

Hi all,

I'd like to publish a crate that has a vendored crate as a git submodule (GitHub - Polochon-street/bliss-rs: A song analysis library for making playlists seeing the layout probably helps)

It's basically a fork of a crate I don't control with some very specific modifications for my use case (it's Rust bindings for a C library that's unmaintained, so I basically forked the C code to apply my patches, and forked the rust crate to use said fork - long story short not much luck into getting my changes merged upstream, so I have to vendor it instead).

It works perfectly when using cargo build, but when I try to cargo publish it, it tells me to put a version number for the crate. When I put aubio-rs = {path = "./aubio-rs/aubio-rs", version = "0.2.0"} instead of aubio-rs = {path = "./aubio-rs/aubio-rs"}, it publishes the crate successfully, but of course doesn't use my vendored version, and instead uses the one.

I'm probably missing something; how would you guys make that work?
I.e., how could I publish a crate with a vendored crate as a git submodule?


You'll have to publish your own version of the vendored crate. Perhaps with a name indicating that it's meant to be internal to your crate.

1 Like

Alright, I thought maybe there was another way, but doesn't seem like it.

Thanks, resolving :)