diff options
| author | David Wood <david@davidtw.co> | 2020-06-21 20:21:17 +0100 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2020-06-22 10:02:00 +0100 |
| commit | b60ec47a0694b6eb10bdafc2aa28f877473f61d5 (patch) | |
| tree | 516db4bd61759463bcb22e80136b61ff187898c0 /src | |
| parent | 033013cab3a861224fd55f494c8be1cb0349eb49 (diff) | |
| download | rust-b60ec47a0694b6eb10bdafc2aa28f877473f61d5.tar.gz rust-b60ec47a0694b6eb10bdafc2aa28f877473f61d5.zip | |
bootstrap: no `config.toml` exists regression
This commit fixes a regression introduced in #73317 where an oversight meant that `config.toml` was assumed to exist. Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/bootstrap.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 969d16d11e8..82a755c7892 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -893,15 +893,18 @@ def bootstrap(help_triggered): build.verbose = args.verbose build.clean = args.clean - try: - toml_path = os.getenv('RUST_BOOTSTRAP_CONFIG') or args.config or 'config.toml' + # Read from `RUST_BOOTSTRAP_CONFIG`, then `--config`, then fallback to `config.toml` (if it + # exists). + toml_path = os.getenv('RUST_BOOTSTRAP_CONFIG') or args.config + if not toml_path and os.path.exists('config.toml'): + toml_path = 'config.toml' + + if toml_path: if not os.path.exists(toml_path): toml_path = os.path.join(build.rust_root, toml_path) with open(toml_path) as config: build.config_toml = config.read() - except (OSError, IOError): - pass config_verbose = build.get_toml('verbose', 'build') if config_verbose is not None: @@ -947,11 +950,12 @@ def bootstrap(help_triggered): env["SRC"] = build.rust_root env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) env["BOOTSTRAP_PYTHON"] = sys.executable - env["BOOTSTRAP_CONFIG"] = toml_path env["BUILD_DIR"] = build.build_dir env["RUSTC_BOOTSTRAP"] = '1' env["CARGO"] = build.cargo() env["RUSTC"] = build.rustc() + if toml_path: + env["BOOTSTRAP_CONFIG"] = toml_path if build.rustfmt(): env["RUSTFMT"] = build.rustfmt() run(args, env=env, verbose=build.verbose) |
