Skip to content

Commit

Permalink
Revert "Add a check for and add a new change entry in change_tracker.rs"
Browse files Browse the repository at this point in the history
This reverts commit 7ed5321.
  • Loading branch information
default committed Jul 23, 2024
1 parent 7ed5321 commit 86adf9e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
14 changes: 7 additions & 7 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,18 +1107,18 @@ def bootstrap(args):
"git clone nor distributed tarball.\nThis build may fail due to missing submodules "
"unless you put them in place manually.")

# Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`,
# then `bootstrap.toml` or `config.toml` in the root directory.
# Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml`
# then `bootstrap.toml`, then `config.toml` in the root directory.
toml_path = args.config or os.getenv('RUST_BOOTSTRAP_CONFIG')
using_default_path = toml_path is None
if using_default_path:
toml_path = 'bootstrap.toml'
if not os.path.exists(toml_path):
toml_path = 'config.toml'
if not os.path.exists(toml_path):
toml_path = os.path.join(rust_root, 'bootstrap.toml')
if not os.path.exists(toml_path):
toml_path = os.path.join(rust_root, 'config.toml')
bootstrap_toml_path = os.path.join(rust_root, 'bootstrap.toml')
if not os.path.exists(bootstrap_toml_path):
toml_path = os.path.join(rust_root, 'config.toml')
else:
toml_path = bootstrap_toml_path

# Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path,
# but not if `bootstrap.toml` hasn't been created.
Expand Down
14 changes: 6 additions & 8 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1305,21 +1305,19 @@ impl Config {

config.stage0_metadata = build_helper::stage0_parser::parse_stage0_file();

// Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`,
// then `bootstrap.toml` or `config.toml` in the root directory.
// Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml`, then `bootstrap.toml`, then `config.toml` in the root directory.
let toml_path = flags
.config
.clone()
.or_else(|| env::var_os("RUST_BOOTSTRAP_CONFIG").map(PathBuf::from));
let using_default_path = toml_path.is_none();
let mut toml_path = toml_path.unwrap_or_else(|| PathBuf::from("bootstrap.toml"));
if using_default_path && !toml_path.exists() {
toml_path = PathBuf::from("config.toml");
if using_default_path && !toml_path.exists() {
toml_path = config.src.join(PathBuf::from("bootstrap.toml"));
if !toml_path.exists() {
toml_path = config.src.join(PathBuf::from("config.toml"));
}
let bootstrap_toml_path = config.src.join(toml_path);
if !bootstrap_toml_path.exists() {
toml_path = config.src.join(PathBuf::from("config.toml"));
} else {
toml_path = bootstrap_toml_path;
}
}

Expand Down
11 changes: 3 additions & 8 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
ChangeInfo {
change_id: 117435,
severity: ChangeSeverity::Info,
summary: "New option `rust.parallel-compiler` added to config.toml.",
summary: "New option `rust.parallel-compiler` added to bootstrap.toml.",
},
ChangeInfo {
change_id: 116881,
Expand Down Expand Up @@ -133,7 +133,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
ChangeInfo {
change_id: 120348,
severity: ChangeSeverity::Info,
summary: "New option `target.<triple>.codegen-backends` added to config.toml.",
summary: "New option `target.<triple>.codegen-backends` added to bootstrap.toml.",
},
ChangeInfo {
change_id: 121203,
Expand Down Expand Up @@ -173,7 +173,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
ChangeInfo {
change_id: 123711,
severity: ChangeSeverity::Warning,
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.",
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `bootstrap.toml` from now on will result in breakage.",
},
ChangeInfo {
change_id: 124501,
Expand All @@ -200,9 +200,4 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "`llvm.lld` is enabled by default for the dist profile. If set to false, `lld` will not be included in the dist build.",
},
ChangeInfo {
change_id: 126875,
severity: ChangeSeverity::Warning,
summary: "Renamed the bootstrap configuration file from `config.toml` to `bootstrap.toml`.",
},
];

0 comments on commit 86adf9e

Please sign in to comment.