@@ -67,45 +67,38 @@ impl Step for Llvm {
67
67
}
68
68
}
69
69
70
- let ( submodule, root, out_dir, llvm_config_ret_dir) = if emscripten {
70
+ let ( llvm_commit, root, out_dir, llvm_config_ret_dir) = if emscripten {
71
+ let sha = builder. build . emscripten_llvm_info . sha ( ) ;
71
72
let dir = builder. emscripten_llvm_out ( target) ;
72
73
let config_dir = dir. join ( "bin" ) ;
73
- ( "src/llvm-emscripten" , "src/llvm-emscripten" , dir, config_dir)
74
+ ( sha , "src/llvm-emscripten" , dir, config_dir)
74
75
} else {
76
+ let sha = builder. build . in_tree_llvm_info . sha ( ) ;
75
77
let mut dir = builder. llvm_out ( builder. config . build ) ;
76
78
if !builder. config . build . contains ( "msvc" ) || builder. config . ninja {
77
79
dir. push ( "build" ) ;
78
80
}
79
- ( "src/llvm-project" , "src/llvm-project/llvm" , builder. llvm_out ( target) , dir. join ( "bin" ) )
81
+ ( sha , "src/llvm-project/llvm" , builder. llvm_out ( target) , dir. join ( "bin" ) )
80
82
} ;
81
83
82
- let git_output = t ! ( Command :: new( "git" )
83
- . args( & [ "rev-parse" , "--verify" , & format!( "@:./{}" , submodule) ] )
84
- . current_dir( & builder. src)
85
- . output( ) ) ;
86
-
87
- let llvm_commit = if git_output. status . success ( ) {
88
- Some ( git_output. stdout )
89
- } else {
84
+ if llvm_commit. is_none ( ) {
90
85
println ! (
91
- "git could not determine the LLVM submodule commit hash ({}) . \
86
+ "git could not determine the LLVM submodule commit hash. \
92
87
Assuming that an LLVM build is necessary.",
93
- String :: from_utf8_lossy( & git_output. stderr) ,
94
88
) ;
95
- None
96
- } ;
89
+ }
97
90
98
91
let build_llvm_config = llvm_config_ret_dir
99
92
. join ( exe ( "llvm-config" , & * builder. config . build ) ) ;
100
93
let done_stamp = out_dir. join ( "llvm-finished-building" ) ;
101
94
102
- if let Some ( llvm_commit) = & llvm_commit {
95
+ if let Some ( llvm_commit) = llvm_commit {
103
96
if done_stamp. exists ( ) {
104
97
let done_contents = t ! ( fs:: read( & done_stamp) ) ;
105
98
106
99
// If LLVM was already built previously and the submodule's commit didn't change
107
100
// from the previous build, then no action is required.
108
- if done_contents == llvm_commit. as_slice ( ) {
101
+ if done_contents == llvm_commit. as_bytes ( ) {
109
102
return build_llvm_config
110
103
}
111
104
}
@@ -296,7 +289,7 @@ impl Step for Llvm {
296
289
cfg. build ( ) ;
297
290
298
291
if let Some ( llvm_commit) = llvm_commit {
299
- t ! ( fs:: write( & done_stamp, & llvm_commit) ) ;
292
+ t ! ( fs:: write( & done_stamp, llvm_commit) ) ;
300
293
}
301
294
302
295
build_llvm_config
0 commit comments