-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When doing local development, users may wish to specify many `path` dependencies that all live in the same local directory. If that local directory is not a short distance from the `Cargo.toml`, this can get unwieldy. This patch introduces the notion of path "prefixes", which are defined in `.cargo/config.toml`: ```toml [path] devdir = "/home/jon/dev/rust/" ``` Which can then be used as the root for path dependencies. For example: ```toml foo = { path = "devdir::foo" } bar = { path = "devdir::bar" } baz = { path = "devdir::ws/baz" } ``` would fetch `foo` from `/home/jon/dev/rust/foo`, `bar` from `/home/jon/dev/rust/bar`, and `baz` from `/home/jon/dev/rust/ws/baz`. This feature also serves as a convenient way for external build systems to mask build-dependent paths from the user. Consider a build system that vendors first-party dependencies into ``` /home/user/workplace/feature-1/build/first-party-package/first-party-package-1.0/x86_64/dev/build/private/rust-vendored/ ``` Instead of requiring users to hard-code that path, or the relative equivalent, into their `Cargo.toml`, the build-system can instead produce a project-local `.cargo/config.toml` that defines that path as `path.vendored`, and the user can then use vendored dependencies using ```toml foo = { path = "vendored::foo" } ```
- Loading branch information
Jon Gjengset
committed
Feb 6, 2021
1 parent
56e0df6
commit e1ac615
Showing
4 changed files
with
157 additions
and
2 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
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