Skip to content

Commit 50a3735

Browse files
committed
Merge branch 'basepath' of https://github.com/dpaoliello/rfcs into basepath
2 parents 707870d + b18416d commit 50a3735

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

text/3529-cargo-path-bases.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ relative paths (which makes refactoring and moving sub-projects very difficult)
3030
and don't work at all if the mono-repo requires publishing and consuming from an
3131
intermediate directory (as this may very per host, or per target being built).
3232

33-
This RFC proposes a mechanism to specify path bases in `Config.toml` or
33+
This RFC proposes a mechanism to specify path bases in `config.toml` or
3434
`Cargo.toml` files which can be used to prepend `path` dependencies. This allows
3535
mono-repos to specify dependencies relative to their root directory, which
3636
allows the consuming project to be moved freely (no relative paths to update)
@@ -69,7 +69,7 @@ drive for performance reasons).
6969
path (e.g., `../../../other_layer/foo` and `../foo`) and may be error prone if
7070
there is some other sub-project in directory with the same name.
7171

72-
Instead, if we could specify these common paths as path bases in a `Config.toml`
72+
Instead, if we could specify these common paths as path bases in a `config.toml`
7373
(which may be generated by an external build system which in turn invokes Cargo):
7474

7575
```toml
@@ -90,7 +90,8 @@ baz = { path = "this_layer/baz", base = "sources" }
9090
Which resolves the issues we previously had:
9191

9292
* The current project can be moved without modifying the `Cargo.toml` at all.
93-
* `bar_with_generated` works for all targets (assuming the `Config.toml` is
93+
* `bar_with_generated` works for all targets (assuming the `config.toml` is
94+
9495
generated).
9596
* The `intermediates` directory can be placed anywhere.
9697
* Moving `foo` or `baz` only requires searching for the canonical form relative
@@ -101,7 +102,7 @@ to the path base.
101102
The ability to use path bases for `path` dependencies is convenient for
102103
developers who are using a large number of `path` dependencies within the same
103104
root directory. Instead of repeating the same path fragment many times in their
104-
`Cargo.toml`, they can instead specify it once in a `Config.toml` as a path
105+
`Cargo.toml`, they can instead specify it once in a `config.toml` as a path
105106
base, then use that path base in each of their `path` dependencies.
106107

107108
Cargo can also provide built-in base paths, for example `workspace` to point to

0 commit comments

Comments
 (0)