Skip to content

Commit 62c0924

Browse files
authored
Unrolled build for rust-lang#137382
Rollup merge of rust-lang#137382 - Shourya742:2025-02-21-add-vendor-step-doc, r=Kobzol bootstrap: add doc for vendor build step This PR adds docs for vendor build step.
2 parents bb2cc59 + 12a0e2b commit 62c0924

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/bootstrap/src/core/build_steps/vendor.rs

+18
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
//! Handles the vendoring process for the bootstrap system.
2+
//!
3+
//! This module ensures that all required Cargo dependencies are gathered
4+
//! and stored in the `<src>/<VENDOR_DIR>` directory.
15
use std::path::PathBuf;
26

37
use crate::core::build_steps::tool::SUBMODULES_FOR_RUSTBOOK;
48
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
59
use crate::utils::exec::command;
610

11+
/// The name of the directory where vendored dependencies are stored.
712
pub const VENDOR_DIR: &str = "vendor";
813

914
/// Returns the cargo workspaces to vendor for `x vendor` and dist tarballs.
@@ -29,11 +34,19 @@ pub fn default_paths_to_vendor(builder: &Builder<'_>) -> Vec<(PathBuf, Vec<&'sta
2934
.collect()
3035
}
3136

37+
/// Defines the vendoring step in the bootstrap process.
38+
///
39+
/// This step executes `cargo vendor` to collect all dependencies
40+
/// and store them in the `<src>/<VENDOR_DIR>` directory.
3241
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
3342
pub(crate) struct Vendor {
43+
/// Additional paths to synchronize during vendoring.
3444
pub(crate) sync_args: Vec<PathBuf>,
45+
/// Determines whether vendored dependencies use versioned directories.
3546
pub(crate) versioned_dirs: bool,
47+
/// The root directory of the source code.
3648
pub(crate) root_dir: PathBuf,
49+
/// The target directory for storing vendored dependencies.
3750
pub(crate) output_dir: PathBuf,
3851
}
3952

@@ -55,6 +68,10 @@ impl Step for Vendor {
5568
});
5669
}
5770

71+
/// Executes the vendoring process.
72+
///
73+
/// This function runs `cargo vendor` and ensures all required submodules
74+
/// are initialized before vendoring begins.
5875
fn run(self, builder: &Builder<'_>) -> Self::Output {
5976
builder.info(&format!("Vendoring sources to {:?}", self.root_dir));
6077

@@ -94,6 +111,7 @@ impl Step for Vendor {
94111
}
95112
}
96113

114+
/// Stores the result of the vendoring step.
97115
#[derive(Debug, Clone)]
98116
pub(crate) struct VendorOutput {
99117
pub(crate) config: String,

0 commit comments

Comments
 (0)