Skip to content

Commit b18416d

Browse files
dpaolielloehuss
andauthored
Apply suggestions from code review
Co-authored-by: Eric Huss <eric@huss.org>
1 parent 247ff65 commit b18416d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

text/3529-cargo-path-bases.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ 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 `base` directories in `Config.toml` or
33+
This RFC proposes a mechanism to specify `base` directories in `config.toml` or
34+
3435
`Cargo.toml` files which can be used to prepend `path` dependencies. This allows
3536
mono-repos to specify dependencies relative to their root directory, which
3637
allows the consuming project to be moved freely (no relative paths to update)
@@ -69,7 +70,8 @@ drive for performance reasons).
6970
path (e.g., `../../../other_layer/foo` and `../foo`) and may be error prone if
7071
there is some other sub-project in directory with the same name.
7172

72-
Instead, if we could specify these `base` directories in a `Config.toml` (which
73+
Instead, if we could specify these `base` directories in a `config.toml` (which
74+
7375
may be generated by an external build system which in turn invokes Cargo):
7476

7577
```toml
@@ -90,7 +92,8 @@ baz = { path = "this_layer/baz", base = "sources" }
9092
Which resolves the issues we previously had:
9193

9294
* 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
95+
* `bar_with_generated` works for all targets (assuming the `config.toml` is
96+
9497
generated).
9598
* The `intermediates` directory can be placed anywhere.
9699
* Moving `foo` or `baz` only requires searching for the canonical form relative
@@ -101,7 +104,8 @@ to the `base` directory.
101104
The ability to use `base` directories for `path` dependencies is convenient for
102105
developers who are using a large number of `path` dependencies within the same
103106
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 `base`
107+
`Cargo.toml`, they can instead specify it once in a `config.toml` as a `base`
108+
105109
directory, then use that `base` directory in each of their `path` dependencies.
106110

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

0 commit comments

Comments
 (0)