New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git dependency with parent file dependency #473
Comments
It looks like |
Ok so it seems like my issue is because the wit files are in a parent dir in the workspace - Do I have any way to construct that manually? (or an escape hatch to preserve a whole repo a la cargo defaults?) |
Hi @endocrimes thanks for the report! I'm assuming you've probably come across #271 (comment) since your analysis about the WIT files being in the parent directory being the problem is spot on. IMO this should be considered (and reported) as an upstream bug since this sort of pattern would fail to build with both
Three options come to mind, listed in order of ease to implement:
|
@ipetkov |
@musjj We don't have a first class way of doing that atm, though you may be able to apply an override for downloadCargoPackageFromGit |
With #615 we will have a general purpose mechanism for overriding (patching) any arbitrary crate sources! Hopefully it should make it easier to work around little quirks like moving files around before they are vendored into their own separate directories |
Here's a quick start snippet for how to patch dependencies: https://crane.dev/patching_dependency_sources.html |
馃憢
I'm trying to build a project that depends on generated bindings for a WIT world (https://github.com/fermyon/spin/blob/main/crates/world/src/lib.rs).
When building with
cargo build
, things work as expected and everything compiles correctlyWhen building with
crane
in a nix-flake however, the build fails with:Although you can apply a custom source filter to your own packages, i.e:
I haven't been able to find an (obvious) way to apply custom source filtering to the git dependency (and I'm not really a rustacean, so I'm unsure if there's something I'm missing that could be passed to cargo to ensure this works consistently).
I'd appreciate any pointers 馃槄
Reproduction example: https://github.com/endocrimes/crane-build-error-example
The text was updated successfully, but these errors were encountered: