Skip to content

Commit d00435f

Browse files
committed
Auto merge of #141272 - Shourya742:2025-05-18-modularize-config-module, r=Kobzol
modularize the config module bootstrap Currently, our `config` module is quite large over 3,000 lines, and handles a wide range of responsibilities. This PR aims to break it down into smaller, more focused submodules to improve readability and maintainability: * **`toml`**: Introduces a dedicated `toml` submodule within the `config` module. Its sole purpose is to define configuration-related structs along with their corresponding deserialization logic. It also contains the `parse_inner` method, which serves as the central function for extracting relevant information from the TOML structs and constructing the final configuration. * **`rust`, `dist`, `install`, `llvm`, `build`, `gcc`, and others**: Each of these modules contains TOML subsections specific to their domain, along with the logic necessary to convert them into parts of the final configuration struct. * **`config/mod.rs`**: Contains shared types and enums used across multiple TOML subsections. * **`config/config.rs`**: Houses the logic that integrates all the TOML subsections into the complete configuration struct. r? `@kobzol`
2 parents cf42371 + 3667dbd commit d00435f

File tree

15 files changed

+2238
-1996
lines changed

15 files changed

+2238
-1996
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 132 additions & 1992 deletions
Large diffs are not rendered by default.

src/bootstrap/src/core/config/flags.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use tracing::instrument;
1212
use crate::core::build_steps::perf::PerfArgs;
1313
use crate::core::build_steps::setup::Profile;
1414
use crate::core::builder::{Builder, Kind};
15-
use crate::core::config::{Config, TargetSelectionList, target_selection_list};
15+
use crate::core::config::Config;
16+
use crate::core::config::target_selection::{TargetSelectionList, target_selection_list};
1617
use crate::{Build, DocTests};
1718

1819
#[derive(Copy, Clone, Default, Debug, ValueEnum)]

0 commit comments

Comments
 (0)