Skip to content

Commit abe92bc

Browse files
committed
Add some comments about Layout naming and .sysroot.
1 parent 3afb5d7 commit abe92bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cargo/core/compiler/layout.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
//! .rustc-info.json
1313
//!
1414
//! # All final artifacts are linked into this directory from `deps`.
15+
//! # Note that named profiles will soon be included as separate directories
16+
//! # here. They have a restricted format, similar to Rust identifiers, so
17+
//! # Cargo-specific directories added in the future should use some prefix
18+
//! # like `.` to avoid name collisions.
1519
//! debug/ # or release/
1620
//!
1721
//! # File used to lock the directory to prevent multiple cargo processes
@@ -46,6 +50,11 @@
4650
//! # incremental is enabled.
4751
//! incremental/
4852
//!
53+
//! # The sysroot for -Zbuild-std builds. This only appears in
54+
//! # target-triple directories (not host), and only if -Zbuild-std is
55+
//! # enabled.
56+
//! .sysroot/
57+
//!
4958
//! # This is the location at which the output of all custom build
5059
//! # commands are rooted.
5160
//! build/
@@ -177,6 +186,7 @@ impl Layout {
177186
// Compute the sysroot path for the build-std feature.
178187
let build_std = ws.config().cli_unstable().build_std.as_ref();
179188
let (sysroot, sysroot_libdir) = if let Some(tp) = build_std.and(triple_path) {
189+
// This uses a leading dot to avoid collision with named profiles.
180190
let sysroot = dest.join(".sysroot");
181191
let sysroot_libdir = sysroot.join("lib").join("rustlib").join(tp).join("lib");
182192
(Some(sysroot), Some(sysroot_libdir))

0 commit comments

Comments
 (0)