Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ def get_toml(self, key, section=None):
'value2'
>>> rb.get_toml('key', 'c') is None
True

>>> rb.config_toml = 'key1 = true'
>>> rb.get_toml("key1")
'true'
"""

cur_section = None
Expand Down Expand Up @@ -571,6 +575,12 @@ def get_string(line):

>>> RustBuild.get_string(' "devel" ')
'devel'
>>> RustBuild.get_string(" 'devel' ")
'devel'
>>> RustBuild.get_string('devel') is None
True
>>> RustBuild.get_string(' "devel ')
''
"""
start = line.find('"')
if start != -1:
Expand Down Expand Up @@ -822,13 +832,13 @@ def bootstrap(help_triggered):
except (OSError, IOError):
pass

match = re.search(r'\nverbose = (\d+)', build.config_toml)
if match is not None:
build.verbose = max(build.verbose, int(match.group(1)))
config_verbose = build.get_toml('verbose', 'build')
if config_verbose is not None:
build.verbose = max(build.verbose, int(config_verbose))

build.use_vendored_sources = '\nvendor = true' in build.config_toml
build.use_vendored_sources = build.get_toml('vendor', 'build') == 'true'

build.use_locked_deps = '\nlocked-deps = true' in build.config_toml
build.use_locked_deps = build.get_toml('locked-deps', 'build') == 'true'

build.check_vendored_status()

Expand Down