about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-02-23 02:44:18 -0500
committerGitHub <noreply@github.com>2025-02-23 02:44:18 -0500
commit553fde4fc953ceb9a6b2ac2972208b73b566575b (patch)
tree43513f5f34c419fb7fa305972610b77df03529e4
parent7f14d2eba48addfbd398c784e43fd7875e313d74 (diff)
parent12a0e2b4dd1e93d7f68c9bdaf4ada618c9cdfb38 (diff)
downloadrust-553fde4fc953ceb9a6b2ac2972208b73b566575b.tar.gz
rust-553fde4fc953ceb9a6b2ac2972208b73b566575b.zip
Rollup merge of #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.
-rw-r--r--src/bootstrap/src/core/build_steps/vendor.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs
index 410dbc04f03..984c70955d7 100644
--- a/src/bootstrap/src/core/build_steps/vendor.rs
+++ b/src/bootstrap/src/core/build_steps/vendor.rs
@@ -1,9 +1,14 @@
+//! Handles the vendoring process for the bootstrap system.
+//!
+//! This module ensures that all required Cargo dependencies are gathered
+//! and stored in the `<src>/<VENDOR_DIR>` directory.
 use std::path::PathBuf;
 
 use crate::core::build_steps::tool::SUBMODULES_FOR_RUSTBOOK;
 use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
 use crate::utils::exec::command;
 
+/// The name of the directory where vendored dependencies are stored.
 pub const VENDOR_DIR: &str = "vendor";
 
 /// 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
     .collect()
 }
 
+/// Defines the vendoring step in the bootstrap process.
+///
+/// This step executes `cargo vendor` to collect all dependencies
+/// and store them in the `<src>/<VENDOR_DIR>` directory.
 #[derive(Debug, Clone, Hash, PartialEq, Eq)]
 pub(crate) struct Vendor {
+    /// Additional paths to synchronize during vendoring.
     pub(crate) sync_args: Vec<PathBuf>,
+    /// Determines whether vendored dependencies use versioned directories.
     pub(crate) versioned_dirs: bool,
+    /// The root directory of the source code.
     pub(crate) root_dir: PathBuf,
+    /// The target directory for storing vendored dependencies.
     pub(crate) output_dir: PathBuf,
 }
 
@@ -55,6 +68,10 @@ impl Step for Vendor {
         });
     }
 
+    /// Executes the vendoring process.
+    ///
+    /// This function runs `cargo vendor` and ensures all required submodules
+    /// are initialized before vendoring begins.
     fn run(self, builder: &Builder<'_>) -> Self::Output {
         builder.info(&format!("Vendoring sources to {:?}", self.root_dir));
 
@@ -94,6 +111,7 @@ impl Step for Vendor {
     }
 }
 
+/// Stores the result of the vendoring step.
 #[derive(Debug, Clone)]
 pub(crate) struct VendorOutput {
     pub(crate) config: String,