path dependencies that are other-workspace workspace-members should mount their workspace
Checklist
- [x] I've looked through the issues and pull requests for similar reports
Describe your issue
Cross doesn't consider the workspace path when mounting path dependencies, only looking at the crate path. Cross should instead look for the workspace root of the crate.
What target(s) are you cross-compiling for?
No response
Which operating system is the host (e.g computer cross is on) running?
- [ ] macOS
- [ ] Windows
- [ ] Linux / BSD
- [ ] other OS (specify in description)
What architecture is the host?
- [ ] x86_64 / AMD64
- [ ] arm32
- [ ] arm64 (including Mac M1)
What container engine is cross using?
- [ ] docker
- [ ] podman
- [ ] other container engine (specify in description)
cross version
cross 0.2.5 (4090bec 2024-10-15)
Example
cargo add --path <path_to_other_worksace_member> cross build
Additional information / notes
context: https://matrix.to/#/!ZFqvHUjUqgONNObpSJ:matrix.org/$CxCTfTP9p1jSYn63720JpkCqiKVr3wnK04pFfOnlt1o?via=matrix.org&via=beeper.com&via=gnome.org
To solve this, we need to resolve if the crate is in a workspace, and then get the workspace root here https://github.com/cross-rs/cross/blob/main/src/cargo.rs#L89-L92
I'm not sure this is actually possible :/ I can't see anyway to relate a path dependency to it's workspace root (if it has one).
Is there any work around for this?
Yes, manually specify the path and use it as a env.volumes. see https://github.com/cross-rs/cross/blob/main/docs/config_file.md#buildenv