-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #10281 - Gnurfos:depinfo_relative, r=ehuss
Fix use of .. in dep-info-basedir ### Summary This allows setting, in .cargo/config's dep-info-basedir, some relative path that goes above the crate's directory. ### Motivation In a setup like this: ``` repo_root ├── Makefile ├── some_c_things │ └── foo.c └── rust_things ├── Cargo.toml └─── src └── lib.rs ``` If you want the generated .d files to be includable directly in the Makefile (without post-processing), you need them to mention paths relative to the root, like: rust_things/target/....: rust_things/src/lib.rs ### Implementation For this you need to have relative paths with parent directories (in this case ..) in dep-info-basedir, which does not work without the change in this PR (due to render_filename doing only strip_prefix, while the basedir still contains literal ..s). Let me know if this change is acceptable. Another implementation could be to canonicalize in ConfigRelativePath::resolve_path instead, especially since that struct outputs absolute paths. But that would have it access the filesystem, while it currently doesn't.
- Loading branch information
Showing
2 changed files
with
80 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters