Skip to content

bootstrap parsing of bootstrap.toml doesn't handle dotted table names in some cases #156948

@ehuss

Description

@ehuss

Summary

In #142636, bootstrap.example.toml was changed so that each key uses dotted TOML syntax. However, bootstrap.py doesn't seem to handle that in all cases. The situations I encountered were the parsing of the build.cargo and build.rustc keys for the purpose of building bootstrap itself. Using the dotted syntax does not work, but using the [build] table section syntax does.

Additionally, the parsing ignores the table name. So when it looks for cargo, anything like this will work:

[foo]
cargo = "false"

Command used

Set up bootstrap.toml:

build.cargo = "false"

Run ./x build

Expected behaviour

Building bootstrap itself should fail since it should be using false for the cargo executable.

That is, I expect bootstrap.py to parse the TOML in a way compatible with the Rust bootstrap code, and support dotted keys, and check that the programs are in the build table.

Actual behaviour

Building bootstrap succeeds, and then once bootstrap starts running it fails.

Operating system

Any

HEAD

31a9463

Additional context

I believe the issue the use of program_config() without a TOML section.

Build Log

ownloading https://static.rust-lang.org/dist/2026-04-14/rust-std-beta-aarch64-apple-darwin.tar.xz
################################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2026-04-14/rustc-beta-aarch64-apple-darwin.tar.xz
################################################################################################################################################################### 100.0%
downloading https://static.rust-lang.org/dist/2026-04-14/cargo-beta-aarch64-apple-darwin.tar.xz
################################################################################################################################################################### 100.0%
extracting /Users/eric/Proj/rust/rust2/build/cache/2026-04-14/rust-std-beta-aarch64-apple-darwin.tar.xz
extracting /Users/eric/Proj/rust/rust2/build/cache/2026-04-14/rustc-beta-aarch64-apple-darwin.tar.xz
extracting /Users/eric/Proj/rust/rust2/build/cache/2026-04-14/cargo-beta-aarch64-apple-darwin.tar.xz
Building bootstrap
   Compiling libc v0.2.186
   Compiling proc-macro2 v1.0.89
   Compiling version_check v0.9.5
   Compiling unicode-ident v1.0.13
   Compiling typenum v1.17.0
   Compiling memchr v2.7.6
   Compiling shlex v1.3.0
   Compiling crossbeam-utils v0.8.20
   Compiling serde v1.0.215
   Compiling pkg-config v0.3.31
   Compiling heck v0.5.0
   Compiling anstyle v1.0.10
   Compiling clap_lex v0.7.2
   Compiling cc v1.2.28
   Compiling regex-syntax v0.8.5
   Compiling cfg-if v1.0.0
   Compiling log v0.4.22
   Compiling generic-array v0.14.7
   Compiling clap_builder v4.5.20
   Compiling semver v1.0.23
   Compiling aho-corasick v1.1.3
   Compiling bstr v1.10.0
   Compiling object v0.37.3
   Compiling serde_json v1.0.132
   Compiling same-file v1.0.6
   Compiling walkdir v2.5.0
   Compiling crossbeam-epoch v0.9.18
   Compiling itoa v1.0.11
   Compiling quote v1.0.37
   Compiling filetime v0.2.27
   Compiling cpufeatures v0.2.15
   Compiling bootstrap v0.0.0 (/Users/eric/Proj/rust/rust2/src/bootstrap)
   Compiling crossbeam-deque v0.8.5
   Compiling syn v2.0.87
   Compiling regex-automata v0.4.9
   Compiling ryu v1.0.18
   Compiling tar v0.4.45
   Compiling lzma-sys v0.1.20
   Compiling cmake v0.1.54
   Compiling build_helper v0.1.0 (/Users/eric/Proj/rust/rust2/src/build_helper)
   Compiling termcolor v1.4.1
   Compiling block-buffer v0.10.4
   Compiling crypto-common v0.1.6
   Compiling home v0.5.12
   Compiling digest v0.10.7
   Compiling xz2 v0.1.7
   Compiling opener v0.8.4
   Compiling sha2 v0.10.8
   Compiling toml v0.5.11
   Compiling globset v0.4.15
   Compiling ignore v0.4.23
   Compiling clap_derive v4.5.18
   Compiling serde_derive v1.0.215
   Compiling clap v4.5.20
   Compiling clap_complete v4.5.37
    Finished `dev` profile [unoptimized] target(s) in 9.45s
Command `false --version` failed with exit code 1
Created at: src/bootstrap/src/core/config/config.rs:2176:9
Executed at: src/bootstrap/src/core/config/config.rs:2176:48

--- STDOUT vvv


Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:00:23
~/Proj/rust/rust2> ./x build
Building bootstrap
Traceback (most recent call last):
  File "/Users/eric/Proj/rust/rust2/x.py", line 53, in <module>
    bootstrap.main()
    ~~~~~~~~~~~~~~^^
  File "/Users/eric/Proj/rust/rust2/src/bootstrap/bootstrap.py", line 1425, in main
    bootstrap(args)
    ~~~~~~~~~^^^^^^
  File "/Users/eric/Proj/rust/rust2/src/bootstrap/bootstrap.py", line 1375, in bootstrap
    build.build_bootstrap()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "/Users/eric/Proj/rust/rust2/src/bootstrap/bootstrap.py", line 1028, in build_bootstrap
    args = self.build_bootstrap_cmd(env)
  File "/Users/eric/Proj/rust/rust2/src/bootstrap/bootstrap.py", line 1118, in build_bootstrap_cmd
    raise Exception("no cargo executable found at `{}`".format(self.cargo()))
Exception: no cargo executable found at `false`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-PythonArea: Python, like bootstrap/CI scripts or linters/formatters, etc.A-bootstrap-configArea: bootstrap `config.toml` and the config systemC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions