I ended up with quite a few Cargo.toml files while trying to cargoize zinc, and I'm looking for some ideas on what are the best options to sort out the individual crates in terms of filesystem hierarchy to keep them in one single repo.
As of now my directory structure looks like:
- src
- ioreg
- Cargo.toml
# internal plugin crate used by platform/* with path=
- platformtree
- Cargo.toml
# external plugin crate, should be accessible to end user
- platform
- $platform_name
- Cargo.toml
# one crate per platform, should be accessible to end user
# sample content: https://gist.github.com/farcaller/bc22a9c32f4b713b8394
- volatile_cell
- Cargo.toml
# internal library crate, extracted for code-reuse
- zinc
- Cargo.toml
# primary library crate, should be accessible to end user
- os
- posix_sched
- Cargo.toml
# single-source C file wrapping getcontext()/setcontext() POSIX api to be used in tests of zinc crate (extracted to crate at it's a dev-dependency)
I'm not exactly sure how this is expected to be useable for crates.io, as most of the crates here interlink with others via path=
relative references and I see no reasonable way on how I would build an end-user app referencing platformtree and zinc crates from git unless I do a checkout. Surely, splitting all this to dedicated repos would sole all the problems, but it would introduce much worse issues with cross-repo code refactoring.
Any suggestions?