1
+ #![ allow( unused) ]
1
2
//! bootstrap, the Rust build system
2
3
//!
3
4
//! This is the entry point for the build system used to compile the `rustc`
4
5
//! compiler. Lots of documentation can be found in the `README.md` file in the
5
6
//! parent directory, and otherwise documentation can be found throughout the `build`
6
7
//! directory in each respective module.
7
8
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
-
13
9
use bootstrap:: {
14
10
Build , CONFIG_CHANGE_HISTORY , Config , Flags , Subcommand , debug, find_recent_config_change_ids,
15
11
human_readable_changes, t,
16
12
} ;
17
13
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} ;
18
20
#[ cfg( feature = "tracing" ) ]
19
21
use tracing:: instrument;
20
22
@@ -34,7 +36,27 @@ fn main() {
34
36
debug ! ( "parsing config based on flags" ) ;
35
37
let config = Config :: parse ( flags) ;
36
38
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;
38
60
let _build_lock_guard;
39
61
40
62
if !config.bypass_bootstrap_lock {
@@ -145,7 +167,7 @@ fn main() {
145
167
let mut file = t!(OpenOptions::new().write(true).truncate(true).open(entry.path()));
146
168
t!(file.write_all(lines.join("\n").as_bytes()));
147
169
}
148
- }
170
+ }*/
149
171
}
150
172
151
173
fn check_version ( config : & Config ) -> Option < String > {
0 commit comments