Skip to content

Streamline config parsing method #144301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Shourya742
Copy link
Contributor

@Shourya742 Shourya742 commented Jul 22, 2025

This PR should be merged after: #144126 (as this PR contains few of it commits )

This PR streamlines the parse_inner function of the config:

  1. It moves the TOML build-specific parsing logic to apply_build_config, aligning with how other TOML section-specific modules are structured.
  2. Currently, the config fields in parse_inner must be initialized in a specific order effectively following a DAG. This PR maintains that ordering (which we plan to change later), but the new structure makes the initialization order clearer and easier to follow.
  3. Methods are being moved into their respective modules to better localize their scope and reduce cross-module dependencies.

r? @Kobzol

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2025

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rust-log-analyzer

This comment has been minimized.

@Shourya742 Shourya742 force-pushed the 2025-06-22-move-build-toml-parsing-to-build-config branch from e1a4d2a to db3b43d Compare July 22, 2025 12:28
@Kobzol
Copy link
Member

Kobzol commented Jul 22, 2025

Can be rebased now.

@bors
Copy link
Collaborator

bors commented Jul 22, 2025

☔ The latest upstream changes (presumably #144294) made this pull request unmergeable. Please resolve the merge conflicts.

1. Moves TOML build parsing into a separate module.
2. Corrects the ordering of `apply_*_config` method calls.
3. Moves download logic specific to `toml_config` into its own module.
4. Updates tests to align with the correct behavior.
@Shourya742 Shourya742 force-pushed the 2025-06-22-move-build-toml-parsing-to-build-config branch from db3b43d to 121be5a Compare July 22, 2025 17:06
@Kobzol
Copy link
Member

Kobzol commented Jul 22, 2025

I went through this and seeing how the code is structured now helped me realize some issues with how we currently parse Config. I did some experiments based on your branch and I'd like to propose a slightly different structuring here. We can discuss it during our next call.

@bors
Copy link
Collaborator

bors commented Jul 23, 2025

☔ The latest upstream changes (presumably #144360) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants