Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b8ae4c5

Browse files
committed
Handle included config in bootstrap.py
1 parent ab614b0 commit b8ae4c5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/bootstrap.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,16 @@ def bootstrap(help_triggered):
10041004
with open(toml_path) as config:
10051005
build.config_toml = config.read()
10061006

1007+
profile = build.get_toml('profile')
1008+
if profile is not None:
1009+
include_file = 'config.{}.toml'.format(profile)
1010+
include_dir = os.path.join(build.rust_root, 'src', 'bootstrap', 'defaults')
1011+
include_path = os.path.join(include_dir, include_file)
1012+
# HACK: This works because `build.get_toml()` returns the first match it finds for a
1013+
# specific key, so appending our defaults at the end allows the user to override them
1014+
with open(include_path) as included_toml:
1015+
build.config_toml += os.linesep + included_toml.read()
1016+
10071017
config_verbose = build.get_toml('verbose', 'build')
10081018
if config_verbose is not None:
10091019
build.verbose = max(build.verbose, int(config_verbose))

0 commit comments

Comments
 (0)