Skip to content

Commit 65d9ec3

Browse files
committed
dco: Added new build-dir layout to layout module doc
1 parent d4eeb5b commit 65d9ec3

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

src/cargo/core/compiler/layout.rs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,87 @@
125125
//! .metabuild/
126126
//! ```
127127
//!
128+
//! ### New `build-dir` layout
129+
//!
130+
//! As of early 2026, Cargo is restructuring the `build-dir` layout and supports 2 layouts.
131+
//! * the original layout organizing files by type
132+
//! * the new "build unit" based layout
133+
//!
134+
//! For more info about the layout transition see: [#15010](https://github.com/rust-lang/cargo/issues/15010)
135+
//!
136+
//! ```text
137+
//! <build-dir>/
138+
//!
139+
//! # Cache of `rustc -Vv` output for performance.
140+
//! .rustc-info.json
141+
//!
142+
//! # Compilation files are grouped by build target and profile.
143+
//! # The target is omitted if not explictly specified.
144+
//! [<target>]/<profile>/ # e.g. `debug` / `release`
145+
//!
146+
//! # File used to lock the directory to prevent multiple cargo processes
147+
//! # from using it at the same time.
148+
//! .cargo-lock
149+
//!
150+
//! # Directory used to store incremental data for the compiler (when
151+
//! # incremental is enabled.
152+
//! incremental/
153+
//!
154+
//! # Main directory for storing build unit related files.
155+
//! # Files are organized by Cargo build unit (`$pkgname/$META`) so that
156+
//! # related files are stored in a single directory.
157+
//! build/
158+
//!
159+
//! # This is the location at which the output of all files related to
160+
//! # a given build unit. These files are organized together so that we can
161+
//! # treat this directly like a single unit for locking and caching.
162+
//! $pkgname/
163+
//! $META/
164+
//! # The general purpose output directory for build units.
165+
//! # For compilation units, the rustc artifact will be located here.
166+
//! # For build script run units, this is the $OUT_DIR
167+
//! out/
168+
//!
169+
//! # For artifact dependency units, the output is nested by the kind
170+
//! artifact/$kind
171+
//!
172+
//! # Directory that holds all of the fingerprint files for the build unit.
173+
//! fingerprint/
174+
//! # Set of source filenames for this package.
175+
//! dep-lib-$targetname
176+
//! # Timestamp when this package was last built.
177+
//! invoked.timestamp
178+
//! # The fingerprint hash.
179+
//! lib-$targetname
180+
//! # Detailed information used for logging the reason why
181+
//! # something is being recompiled.
182+
//! lib-$targetname.json
183+
//! # The console output from the compiler. This is cached
184+
//! # so that warnings can be redisplayed for "fresh" units.
185+
//! output-lib-$targetname
186+
//!
187+
//! # Directory for "execution" units that spawn a process (excluding compilation with
188+
//! # rustc). Contains the process execution details.
189+
//! # Currently the only execution unit Cargo supports is running build script
190+
//! # binaries.
191+
//! run/
192+
//! # Timestamp of last execution.
193+
//! invoked.timestamp
194+
//! # Stdout output from the process.
195+
//! stdout
196+
//! # Stderr output from the process.
197+
//! stderr
198+
//! # Path to `out`, used to help when the target directory is
199+
//! # moved. (build scripts)
200+
//! root-output
201+
//!
202+
//! # Used by `cargo package` and `cargo publish` to build a `.crate` file.
203+
//! package/
204+
//!
205+
//! # Experimental feature for generated build scripts.
206+
//! .metabuild/
207+
//! ```
208+
//!
128209
//! When cross-compiling, the layout is the same, except it appears in
129210
//! `target/$TRIPLE`.
130211

0 commit comments

Comments
 (0)