Description
Summary
configure.py
parses the bootstrap.example.toml
file and writes out a bootstrap.toml
based on the example template with values set using command line options like --set dist.vendor=false
The loop that writes the sections of the bootstrap.toml file accumulates the lines to be written for a given key (the comment lines prior to the key=value
line, and the key=value
line itself) and emits them when it reaches lines that belong to the next key. However when the loop finishes the section, it doesn't not emit any lines that have been accumulated that have not yet been emitted. Practically this means the last key=value
pair in each section is never emitted.
Command used
python3 ./src/bootstrap/configure.py --set dist.vendor=false
Expected behaviour
bootstrap.toml
contains
[dist]
# ...
vendor = false
Actual behaviour
The [dist]
section is empty
Bootstrap configuration (bootstrap.toml)
# Use different pre-set defaults than the global defaults.
#
# See `src/bootstrap/defaults` for more information.
# Note that this has no default value (x.py uses the defaults in `bootstrap.example.toml`).
profile = 'dist'
[llvm]
[gcc]
[build]
# Arguments passed to the `./configure` script, used during distcheck. You
# probably won't fill this in but rather it's filled in by the `./configure`
# script. Useful for debugging.
configure-args = ['--set', 'dist.vendor=false']
[install]
[rust]
[dist]
[target.aarch64-apple-darwin]
Operating system
macOS, Linux
HEAD
Additional context
rust/src/bootstrap/configure.py
Lines 741 to 755 in 1b0bc59