I'm building a library and trying it out in various local projects. For that, I'd like to specify my library in those projects via a path dependency.
However, my library's repository uses a workspace, with the primary library crate just as one workspace member. Broken down, it looks like this:
my_library_repo/
├── Cargo.lock
├── Cargo.toml
├── my_library/
│ ├── Cargo.toml
│ └── src/
└── my_library_core/
├── Cargo.toml
└── src/
With another project placed in a folder right next to it, I have to specify the path dependency in that like so:
my_library = { path = "../my_library_repo/my_library/" }
However, when I do so, then building the other project with cross build
leads to this error:
$ cross build
error: failed to load manifest for workspace member `/home/main/projects/other_project`
referenced by workspace at `/home/main/projects/other_project/Cargo.toml`
Caused by:
failed to load manifest for dependency `my_library`
Caused by:
failed to parse manifest at `/home/main/projects/my_library_repo/my_library/Cargo.toml`
Caused by:
error inheriting `edition` from workspace root manifest's `workspace.package.edition`
Caused by:
failed to find a workspace root
...and workspace.package.edition
is just the first thing it parses that references the workspace. If I replace that with a literal string, it will run into more errors.
cargo build
does not throw similar errors.
Does Cross maybe mount referenced path dependencies into the build container, and it doesn't mount the whole workspace/repository when used like this?
cross build
does work, when the dependency is specified as a Git dependency (i.e. when it downloads the repo in full).
I'm not sure, if this is turning into a bug report. Am I doing something obviously wrong?
In case, it's relevant, my library's repository lives here: trem/cicero: Automate Rust CI builds. - Codeberg.org