Skip to content
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

Omit commented-out options in configure.py #108612

Closed
jyn514 opened this issue Mar 1, 2023 · 1 comment · Fixed by #108632
Closed

Omit commented-out options in configure.py #108612

jyn514 opened this issue Mar 1, 2023 · 1 comment · Fixed by #108632
Assignees
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Mar 1, 2023

Right now, ./configure --set rust.incremental generates an 809 line file, making it very hard to tell what's actually modified. configure-args kind of helps with this, but doesn't show up until line 331, so it's not obvious to people who aren't experienced with bootstrap. We should change configure.py to only include options that are actually set, so it's easier to tell how it differs from the defaults. This also avoids issues where the comments in config.toml drift away from the comments in config.toml.example over time.

Unfortunately config.toml.example is just a bunch of comments so it's annoying to actually do this and keep the relevant comments in config.toml ... maybe we can search back upwards to the nearest blank line?

Relevant code:

for line in open(rust_dir + '/config.toml.example').read().split("\n"):
if line.startswith('['):
cur_section = line[1:-1]
if cur_section.startswith('target'):
cur_section = 'target'
elif '.' in cur_section:
raise RuntimeError("don't know how to deal with section: {}".format(cur_section))
sections[cur_section] = [line]
section_order.append(cur_section)
else:
sections[cur_section].append(line)

@jyn514 jyn514 added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. labels Mar 1, 2023
@Teapot4195
Copy link
Contributor

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 4, 2023
…anonur

Omit unchanged options from config.toml in `configure.py`

Leaves section tags, but removes options that are unchanged.
Change in `config.toml.example` is to prevent comments from sneaking in by being directly after a section tag

closes rust-lang#108612
@bors bors closed this as completed in 538f19d Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants