Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign up`paths` config override does not override `path` of nested dependencies #1863
Comments
This comment has been minimized.
This comment has been minimized.
|
This sounds like you're taking the source directly from crates.io and then using it as a path dependency? That's unfortunately not going to work for this reason (Cargo rewrites path dependencies to be crates.io dependencies). Otherwise this is working as intended because the path override for |
alexcrichton
closed this
Aug 3, 2015
This comment has been minimized.
This comment has been minimized.
Yes I am. I'm taking released artifacts and making them locally available for offline/reproducible/signed builds. Maybe I took the wrong approach also given the lack of answers here, but this should be a fairly normal scenario for a package builder/manager.
If I understand correctly, this means that "entries for dependencies fetched to disk are synthesized to Cargo.lock in the parent project and then they override the original path."
Are you suggesting that all those packages are declaring buggy dependency paths? They don't make much sense when speaking about released artifacts/packages, but only in a git repo context. But it is my understanding that dependencies are declared in term of packages. Can you please clarify, as I fear I have some misunderstanding on the intended design? |
This comment has been minimized.
This comment has been minimized.
I've been corrected by @steveklabnik, this was my root misunderstanding. Dependencies are declared in terms of crates, not packages. Thanks both for the answers. |
This comment has been minimized.
This comment has been minimized.
|
Ah and to also clarify, Cargo doesn't modify If you're downloading crates to have them available locally, you'll probably want to rewrite all |
lucab commentedJul 31, 2015
According to the cargo guide,
pathsparameter in a config file should be used to add local overrides for dependencies. However, I found this not to be working for many crates, due to nested dependencies declaring an explicitpath. Nested dependencies are NOT being picked up from my local paths.The scenario to reproduce is as follow.
I have a test project that needs
env_logger. The Cargo.toml is as follow:I have a local copy of all the crates I need under
/srv/deps/, so:/srv/deps/env_logger-0.3.1/srv/deps/log-0.3.1/(needed by env_logger)I have a local override under
.cargo/configwhich looks like this:However, trying to build with cargo fails with:
This is because
env_loggercurrently has a dependency onlogspecified as follow:I believe this is a bug, as it is my understanding that local config overrides should take precedence over library manifests.