Skip to content

Commit ed792d4

Browse files
committed
WIP
1 parent 0401bc8 commit ed792d4

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

src/bootstrap/bootstrap.py

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def unpack(tarball, tarball_suffix, dst, verbose=False, match=None):
204204
name = member.replace(fname + "/", "", 1)
205205
if match is not None and not name.startswith(match):
206206
continue
207-
name = name[len(match) + 1 :]
207+
name = name[len(match) + 1:]
208208

209209
dst_path = os.path.join(dst, name)
210210
if verbose:
@@ -486,15 +486,15 @@ class DownloadInfo:
486486
"""A helper class that can be pickled into a parallel subprocess"""
487487

488488
def __init__(
489-
self,
490-
base_download_url,
491-
download_path,
492-
bin_root,
493-
tarball_path,
494-
tarball_suffix,
495-
stage0_data,
496-
pattern,
497-
verbose,
489+
self,
490+
base_download_url,
491+
download_path,
492+
bin_root,
493+
tarball_path,
494+
tarball_suffix,
495+
stage0_data,
496+
pattern,
497+
verbose,
498498
):
499499
self.base_download_url = base_download_url
500500
self.download_path = download_path
@@ -576,7 +576,7 @@ def __init__(self, config_toml="", args=None):
576576
self.stage0_data["compiler_date"], self.stage0_data["compiler_version"]
577577
)
578578
self.download_url = (
579-
os.getenv("RUSTUP_DIST_SERVER") or self.stage0_data["dist_server"]
579+
os.getenv("RUSTUP_DIST_SERVER") or self.stage0_data["dist_server"]
580580
)
581581

582582
self.build = args.build or self.build_triple()
@@ -597,10 +597,10 @@ def download_toolchain(self):
597597
key = self.stage0_compiler.date
598598
is_outdated = self.program_out_of_date(self.rustc_stamp(), key)
599599
need_rustc = self.rustc().startswith(bin_root) and (
600-
not os.path.exists(self.rustc()) or is_outdated
600+
not os.path.exists(self.rustc()) or is_outdated
601601
)
602602
need_cargo = self.cargo().startswith(bin_root) and (
603-
not os.path.exists(self.cargo()) or is_outdated
603+
not os.path.exists(self.cargo()) or is_outdated
604604
)
605605

606606
if need_rustc or need_cargo:
@@ -617,10 +617,10 @@ def download_toolchain(self):
617617
script = (
618618
# NOTE: can't use `taskkill` or `Get-Process -Name` because they error if
619619
# the server isn't running.
620-
"Get-Process | "
621-
+ 'Where-Object {$_.Name -eq "rust-analyzer-proc-macro-srv"} |'
622-
+ 'Where-Object {{$_.Path -match "{}"}} |'.format(regex)
623-
+ "Stop-Process"
620+
"Get-Process | "
621+
+ 'Where-Object {$_.Name -eq "rust-analyzer-proc-macro-srv"} |'
622+
+ 'Where-Object {{$_.Path -match "{}"}} |'.format(regex)
623+
+ "Stop-Process"
624624
)
625625
run_powershell([script])
626626
shutil.rmtree(bin_root)
@@ -844,7 +844,7 @@ def fix_bin_or_dylib(self, fname):
844844
if ".so" not in fname:
845845
# Finally, set the correct .interp for binaries
846846
with open(
847-
"{}/nix-support/dynamic-linker".format(nix_deps_dir)
847+
"{}/nix-support/dynamic-linker".format(nix_deps_dir)
848848
) as dynamic_linker:
849849
patchelf_args += ["--set-interpreter", dynamic_linker.read().rstrip()]
850850

@@ -968,12 +968,12 @@ def get_string(line):
968968
"""
969969
start = line.find('"')
970970
if start != -1:
971-
end = start + 1 + line[start + 1 :].find('"')
972-
return line[start + 1 : end]
971+
end = start + 1 + line[start + 1:].find('"')
972+
return line[start + 1: end]
973973
start = line.find("'")
974974
if start != -1:
975-
end = start + 1 + line[start + 1 :].find("'")
976-
return line[start + 1 : end]
975+
end = start + 1 + line[start + 1:].find("'")
976+
return line[start + 1: end]
977977
return None
978978

979979
def bootstrap_out(self):
@@ -1109,6 +1109,7 @@ def build_bootstrap_cmd(self, env):
11091109
else:
11101110
deny_warnings = self.warnings == "deny"
11111111
if deny_warnings:
1112+
print("DENYING WARNINGS IN PYTHON")
11121113
env["RUSTFLAGS"] += " -Dwarnings"
11131114

11141115
# Add RUSTFLAGS_BOOTSTRAP to RUSTFLAGS for bootstrap compilation.
@@ -1267,7 +1268,7 @@ def bootstrap(args):
12671268
rust_root = os.path.abspath(os.path.join(__file__, "../../.."))
12681269

12691270
if not os.path.exists(os.path.join(rust_root, ".git")) and os.path.exists(
1270-
os.path.join(rust_root, ".github")
1271+
os.path.join(rust_root, ".github")
12711272
):
12721273
eprint(
12731274
"warn: Looks like you are trying to bootstrap Rust from a source that is neither a "

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ impl Builder<'_> {
10621062
lint_flags.push("-Wunused_lifetimes");
10631063

10641064
if self.config.deny_warnings {
1065+
eprintln!("DENYING WARNINGS IN BOOTSTRAP");
10651066
lint_flags.push("-Dwarnings");
10661067
rustdocflags.arg("-Dwarnings");
10671068
}

src/bootstrap/src/core/builder/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ impl<'a> Builder<'a> {
14781478
cmd.arg("-Wrustdoc::invalid_codeblock_attributes");
14791479

14801480
if self.config.deny_warnings {
1481+
eprintln!("DENYING WARNINGS FOR RUSTDOC IN BOOTSTRAP");
14811482
cmd.arg("-Dwarnings");
14821483
}
14831484
cmd.arg("-Znormalize-docs");

src/bootstrap/src/core/config/config.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,6 +1693,7 @@ impl Config {
16931693
}
16941694

16951695
let mut override_toml = TomlConfig::default();
1696+
eprintln!("BOOTSTRAP SET FLAGS: {:?}", flags.set);
16961697
for option in flags.set.iter() {
16971698
fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
16981699
toml::from_str(option).and_then(|table: toml::Value| TomlConfig::deserialize(table))
@@ -1731,7 +1732,13 @@ impl Config {
17311732
eprintln!("failed to parse override `{option}`: `{err}");
17321733
exit!(2)
17331734
}
1735+
if let Some(r) = override_toml.rust.as_ref() {
1736+
eprintln!("BOOTSTRAP OVERRIDE TOML: {:?}", r.deny_warnings);
1737+
}
17341738
toml.merge(None, &mut Default::default(), override_toml, ReplaceOpt::Override);
1739+
if let Some(r) = toml.rust.as_ref() {
1740+
eprintln!("BOOTSTRAP TOML AFTER OVERRIDE: {:?}", r.deny_warnings);
1741+
}
17351742

17361743
config.change_id = toml.change_id.inner;
17371744

@@ -2142,6 +2149,10 @@ impl Config {
21422149
Warnings::Default => deny_warnings,
21432150
},
21442151
);
2152+
eprintln!(
2153+
"SETTING DENY WARNINGS TO {}, flags: {:?}",
2154+
config.deny_warnings, flags.warnings
2155+
);
21452156
set(&mut config.backtrace_on_ice, backtrace_on_ice);
21462157
set(&mut config.rust_verify_llvm_ir, verify_llvm_ir);
21472158
config.rust_thin_lto_import_instr_limit = thin_lto_import_instr_limit;

0 commit comments

Comments
 (0)