Skip to content

Omit commented-out options in configure.py #108612

Closed
@jyn514

Description

@jyn514

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)

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions