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,79 @@ 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_commit1 =
40
+ get_closest_merge_commit ( Some ( & config. src ) , & config. git_config ( ) , & [ ] ) . unwrap ( ) ;
41
+ let merge_commit2 = String :: from_utf8 (
42
+ Command :: new ( "git" )
43
+ . args ( [
44
+ "rev-list" ,
45
+
46
+ "-n1" ,
47
+ "--first-parent" ,
48
+ "HEAD" ,
49
+ ] )
50
+ . output ( )
51
+ . unwrap ( )
52
+ . stdout ,
53
+ )
54
+ . unwrap ( ) ;
55
+ let merge_commit3 = String :: from_utf8 (
56
+ Command :: new ( "git" )
57
+ . args ( [
58
+ "rev-list" ,
59
+
60
+ "-n1" ,
61
+ "--first-parent" ,
62
+ "HEAD^1" ,
63
+ ] )
64
+ . output ( )
65
+ . unwrap ( )
66
+ . stdout ,
67
+ )
68
+ . unwrap ( ) ;
69
+ let merge_commit4 = String :: from_utf8 (
70
+ Command :: new ( "git" )
71
+ . args ( [
72
+ "rev-list" ,
73
+
74
+ "-n1" ,
75
+ "--first-parent" ,
76
+ "HEAD^1" ,
77
+ "--" ,
78
+ "src/llvm-project" ,
79
+ ] )
80
+ . output ( )
81
+ . unwrap ( )
82
+ . stdout ,
83
+ )
84
+ . unwrap ( ) ;
85
+ let current_commit = String :: from_utf8 (
86
+ Command :: new ( "git" ) . arg ( "rev-parse" ) . arg ( "HEAD" ) . output ( ) . unwrap ( ) . stdout ,
87
+ )
88
+ . unwrap ( ) ;
89
+ let git_history = String :: from_utf8 (
90
+ Command :: new ( "git" )
91
+ . arg ( "log" )
92
+ . arg ( "--oneline" )
93
+ . arg ( "-n" )
94
+ . arg ( "20" )
95
+ . arg ( "--pretty=format:%h %an %ae %s" )
96
+ . output ( )
97
+ . unwrap ( )
98
+ . stdout ,
99
+ )
100
+ . unwrap ( ) ;
101
+ panic ! (
102
+ r#"
103
+ Merge commit1: {merge_commit1}
104
+ Merge commit2: {merge_commit2}
105
+ Merge commit3: {merge_commit3}
106
+ Merge commit4: {merge_commit4}
107
+ HEAD: {current_commit}
108
+ {git_history}"#
109
+ ) ;
110
+
111
+ /*let mut build_lock;
38
112
let _build_lock_guard;
39
113
40
114
if !config.bypass_bootstrap_lock {
@@ -145,7 +219,7 @@ fn main() {
145
219
let mut file = t!(OpenOptions::new().write(true).truncate(true).open(entry.path()));
146
220
t!(file.write_all(lines.join("\n").as_bytes()));
147
221
}
148
- }
222
+ }*/
149
223
}
150
224
151
225
fn check_version ( config : & Config ) -> Option < String > {
0 commit comments