You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
or one of the [built-in path bases](#built-in-path-bases). The value of that
154
+
path base is prepended to the `path` value to produce the actual location where
156
155
Cargo will look for the dependency.
157
156
158
157
For example, if the Cargo.toml contains:
@@ -162,67 +161,51 @@ For example, if the Cargo.toml contains:
162
161
foo = { path = "foo", base = "dev" }
163
162
```
164
163
165
-
Given a `[base-paths]` table in the configuration that contains:
164
+
Given a `[path-bases]` table in the configuration that contains:
166
165
167
166
```toml
168
-
[base-paths]
167
+
[path-bases]
169
168
dev = "/home/user/dev/rust/libraries/"
170
169
```
171
170
172
171
This will produce a `path` dependency `foo` located at
173
172
`/home/user/dev/rust/libraries/foo`.
174
173
175
-
Base paths can be either absolute or relative. Relative base paths are relative
176
-
to the parent directory of the configuration or manifest file that declared that
177
-
base path.
174
+
Path bases can be either absolute or relative. Relative path bases are relative
175
+
to the parent directory of the configuration file that declared that path base.
178
176
179
-
The name of a base path must use only [alphanumeric](https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric)
177
+
The name of a path base must use only [alphanumeric](https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric)
180
178
characters or `-` or `_`, must start with an [alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_alphabetic)
181
179
character, and must not be empty.
182
180
183
-
#### Built-in base paths
181
+
If the name of path base used in a dependency is neither in the configuration
182
+
nor one of the built-in path base, then Cargo will raise an error.
184
183
185
-
Cargo provides implicit base paths that can be used without the need to specify
186
-
them in a `[base-paths]` table.
184
+
#### Built-in path base
185
+
186
+
Cargo provides implicit path bases that can be used without the need to specify
187
+
them in a `[path-bases]` table.
187
188
188
189
*`workspace` - If a project is [a workspace or workspace member](https://doc.rust-lang.org/cargo/reference/workspaces.html)
189
-
then this base path is defined as the parent directory of the root Cargo.toml of
190
+
then this path base is defined as the parent directory of the root Cargo.toml of
190
191
the workspace.
191
192
192
-
#### Base paths resolution order
193
-
194
-
Cargo will search for base paths in the following order:
195
-
196
-
1. In the [configuration](https://doc.rust-lang.org/cargo/reference/config.html).
197
-
1. In the [manifest](https://doc.rust-lang.org/cargo/reference/manifest.html)
198
-
that is using the base path.
199
-
1. In the workspace's [manifest](https://doc.rust-lang.org/cargo/reference/manifest.html).
200
-
1. In the list of built-in base paths.
201
-
202
-
If the base path is not found in during this search then Cargo will generate an
203
-
error.
204
-
205
-
Once a base path is found Cargo will stop searching, thus it is possible to
206
-
shadow a base path by declaring it earlier in the search order. This allows the
207
-
user's configuration to override the base path in a package, or for Cargo to add
208
-
new built-in base paths without compatibility issues (as existing uses will
209
-
shadow the built-in name).
210
-
211
-
## The Manifest Format
212
-
213
-
* Dependency tables:
214
-
*[`[base-paths]`](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#base-paths) - Base paths for path dependencies.
193
+
If a built-in path base name is also declared in the configuration, then Cargo
194
+
will prefer the value in the configuration. The allows Cargo to add new built-in
195
+
path bases without compatibility issues (as existing uses will shadow the
196
+
built-in name).
215
197
216
198
## Configuration
217
199
218
-
`[base-paths]`
200
+
`[path-bases]`
219
201
220
202
* Type: string
221
203
* Default: see below
222
-
* Environment: `CARGO_BASE_PATHS_<name>`
204
+
* Environment: `CARGO_PATH_BASES_<name>`
223
205
224
-
The `[base-paths]` table defines a set of path prefixes that can be used to
225
-
prepend the locations of `path` dependencies. See the [specifying dependencies](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#base-paths)
206
+
The `[path-bases]` table defines a set of path prefixes that can be used to
207
+
prepend the locations of `path` dependencies. See the
0 commit comments