-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
We currently have a situation we don't know how to solve using cargo and we could use some advice. I'm posting here because I suspect there isn't a good answer and we'd like to patch cargo to make things work once we have an agreed upon solution.
We have two binaries: foo and bar. They are built for specific hardware and are not portable. The foo binary is built for the platform default (i.e. x86_64-unknown-linux-gnu) but the bar binary is built for x86_64-unknown-linux-musl and is no_std. Then the bar binary is embedded into the foo binary via include_bytes!().
The interface between these two binaries is private. So we don't want to package them as separate published crates. They should always live in the same repo and be published together.
Currently, bar is a subdirectory in the foo crate and we build it by manually shelling out to cargo during build.rs. With a little hackery, this seems to work fine. Our major problem is that we can't seem to publish this configuration. If we attempt to include = ["bar"] in the foo crate, it is ignored because it contains a Cargo.toml.
So we're basically looking for a solution:
foodepends on thebarbinary, which is compiled for a different target.fooandbarhave their own, separate dependency trees.fooandbarshould always be distributed in the same package.- How can we publish this to
crates.io?
cc @haraldh