Skip to content

Commit 1f9537f

Browse files
committed
WIP
1 parent dd82f34 commit 1f9537f

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

src/bootstrap/src/bin/main.rs

+28-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1+
#![allow(unused)]
12
//! bootstrap, the Rust build system
23
//!
34
//! This is the entry point for the build system used to compile the `rustc`
45
//! compiler. Lots of documentation can be found in the `README.md` file in the
56
//! parent directory, and otherwise documentation can be found throughout the `build`
67
//! directory in each respective module.
78
8-
use std::fs::{self, OpenOptions};
9-
use std::io::{self, BufRead, BufReader, IsTerminal, Write};
10-
use std::str::FromStr;
11-
use std::{env, process};
12-
139
use bootstrap::{
1410
Build, CONFIG_CHANGE_HISTORY, Config, Flags, Subcommand, debug, find_recent_config_change_ids,
1511
human_readable_changes, t,
1612
};
1713
use build_helper::ci::CiEnv;
14+
use build_helper::git::get_closest_merge_commit;
15+
use std::fs::{self, OpenOptions};
16+
use std::io::{self, BufRead, BufReader, IsTerminal, Write};
17+
use std::process::Command;
18+
use std::str::FromStr;
19+
use std::{env, process};
1820
#[cfg(feature = "tracing")]
1921
use tracing::instrument;
2022

@@ -34,7 +36,26 @@ fn main() {
3436
debug!("parsing config based on flags");
3537
let config = Config::parse(flags);
3638

37-
let mut build_lock;
39+
let merge_commit =
40+
get_closest_merge_commit(Some(&config.src), &config.git_config(), &[]).unwrap();
41+
let current_commit = String::from_utf8(
42+
Command::new("git").arg("rev-parse").arg("HEAD").output().unwrap().stdout,
43+
)
44+
.unwrap();
45+
let git_history = String::from_utf8(
46+
Command::new("git")
47+
.arg("log")
48+
.arg("--oneline")
49+
.arg("-n")
50+
.arg("20")
51+
.output()
52+
.unwrap()
53+
.stdout,
54+
)
55+
.unwrap();
56+
panic!("Merge commit: {merge_commit}, HEAD: {current_commit}\n{git_history}");
57+
58+
/*let mut build_lock;
3859
let _build_lock_guard;
3960
4061
if !config.bypass_bootstrap_lock {
@@ -145,7 +166,7 @@ fn main() {
145166
let mut file = t!(OpenOptions::new().write(true).truncate(true).open(entry.path()));
146167
t!(file.write_all(lines.join("\n").as_bytes()));
147168
}
148-
}
169+
}*/
149170
}
150171

151172
fn check_version(config: &Config) -> Option<String> {

0 commit comments

Comments
 (0)