Skip to content

Commit 33cb1c2

Browse files
authored
feat(unstable): Added -Zbuild-dir-new-layout unstable feature (#15848)
### What does this PR try to resolve? Added `-Zbuild-dir-new-layout` unstable feature as part of #15010 I will open a follow up PR with an initial implementation as mentioned [here](#15010 (comment)) r? @weihanglo
2 parents 206e3fe + c519405 commit 33cb1c2

File tree

3 files changed

+54
-41
lines changed

3 files changed

+54
-41
lines changed

src/cargo/core/features.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,7 @@ unstable_cli_options!(
845845
binary_dep_depinfo: bool = ("Track changes to dependency artifacts"),
846846
bindeps: bool = ("Allow Cargo packages to depend on bin, cdylib, and staticlib crates, and use the artifacts built by those crates"),
847847
build_analysis: bool = ("Record and persist build metrics across runs, with commands to query past builds."),
848+
build_dir_new_layout: bool = ("Use the new build-dir filesystem layout"),
848849
#[serde(deserialize_with = "deserialize_comma_separated_list")]
849850
build_std: Option<Vec<String>> = ("Enable Cargo to compile the standard library itself as part of a crate graph compilation"),
850851
#[serde(deserialize_with = "deserialize_comma_separated_list")]
@@ -1365,6 +1366,7 @@ impl CliUnstable {
13651366
"binary-dep-depinfo" => self.binary_dep_depinfo = parse_empty(k, v)?,
13661367
"bindeps" => self.bindeps = parse_empty(k, v)?,
13671368
"build-analysis" => self.build_analysis = parse_empty(k, v)?,
1369+
"build-dir-new-layout" => self.build_dir_new_layout = parse_empty(k, v)?,
13681370
"build-std" => self.build_std = Some(parse_list(v)),
13691371
"build-std-features" => self.build_std_features = Some(parse_list(v)),
13701372
"cargo-lints" => self.cargo_lints = parse_empty(k, v)?,

src/doc/src/reference/unstable.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Each new feature described below should explain how to use it.
8080
* [feature-unification](#feature-unification) --- Enable new feature unification modes in workspaces
8181
* Output behavior
8282
* [artifact-dir](#artifact-dir) --- Adds a directory where artifacts are copied to.
83+
* [build-dir-new-layout](#build-dir-new-layout) --- Enables the new build-dir filesystem layout
8384
* [Different binary name](#different-binary-name) --- Assign a name to the built binary that is separate from the crate name.
8485
* [root-dir](#root-dir) --- Controls the root directory relative to which paths are printed
8586
* Compile behavior
@@ -1939,6 +1940,14 @@ The `-Zbuild-analysis` feature records and persists detailed build metrics
19391940
enabled = true
19401941
```
19411942

1943+
## build-dir-new-layout
1944+
1945+
* Tracking Issue: [#15010](https://github.com/rust-lang/cargo/issues/15010)
1946+
1947+
Enables the new build-dir filesystem layout.
1948+
This layout change unblocks work towards caching and locking improvements.
1949+
1950+
19421951
# Stabilized and removed features
19431952

19441953
## Compile progress

tests/testsuite/cargo/z_help/stdout.term.svg

Lines changed: 43 additions & 41 deletions
Loading

0 commit comments

Comments
 (0)