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-
139use bootstrap:: {
1410 Build , CONFIG_CHANGE_HISTORY , Config , Flags , Subcommand , debug, find_recent_config_change_ids,
1511 human_readable_changes, t,
1612} ;
1713use 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" ) ]
1921use tracing:: instrument;
2022
@@ -34,7 +36,27 @@ 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+ . arg ( "--pretty=format:%h %an %ae %s" )
52+ . output ( )
53+ . unwrap ( )
54+ . stdout ,
55+ )
56+ . unwrap ( ) ;
57+ panic ! ( "Merge commit: {merge_commit}, HEAD: {current_commit}\n {git_history}" ) ;
58+
59+ /*let mut build_lock;
3860 let _build_lock_guard;
3961
4062 if !config.bypass_bootstrap_lock {
@@ -145,7 +167,7 @@ fn main() {
145167 let mut file = t!(OpenOptions::new().write(true).truncate(true).open(entry.path()));
146168 t!(file.write_all(lines.join("\n").as_bytes()));
147169 }
148- }
170+ }*/
149171}
150172
151173fn check_version ( config : & Config ) -> Option < String > {
0 commit comments