-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo varies between absolute/relative path passing vendor dir to rustc #5923
Comments
Similar (but distinct) to #5895, which is about relative paths in error messages. |
For anyone else running into this: |
alexcrichton
added a commit
to alexcrichton/cargo
that referenced
this issue
Aug 24, 2018
Previously Cargo would use a non-absolute path for any dependency contained within the workspace root but this switches Cargo to only using relative paths for `path` dependencies. In practice this shouldn't make much difference, but for vendored crates and moving around `CARGO_HOME` it can produce more consistent results when target directories are shared. Closes rust-lang#5923
bors
added a commit
that referenced
this issue
Aug 24, 2018
Only use non-absolute paths for `path` dependencies Previously Cargo would use a non-absolute path for any dependency contained within the workspace root but this switches Cargo to only using relative paths for `path` dependencies. In practice this shouldn't make much difference, but for vendored crates and moving around `CARGO_HOME` it can produce more consistent results when target directories are shared. Closes #5923
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's the setup with two workspaces
The .cargo/config points to
When compiling something in w1, the command line might look like this:
When compiling something in w2 the command line might look like this
Given that I share a CARGO_HOME across these two, and AFAICT, the cargo dep caching is based on rustc command line, if I alternate between compiling these two, it kicks off full recompiles.
If I move the
vendor
directory up to root, they both use absolute paths, and deps are cached across the two projects.Proposed solution: cargo should always pass an absolute path to the vendor directory to rustc to work around this issue.
The text was updated successfully, but these errors were encountered: