@@ -9,6 +9,7 @@ template("build_crate") {
9
9
defined (invoker [" ${ crate } _exe" ]),
10
10
" Please add ${ crate } _exe to //brave/tools/crates/config.gni (or to $crate itself)!" )
11
11
crate_exe = invoker [" ${ crate } _exe" ]
12
+ crate_target_dir = get_path_info (get_path_info (crate_exe , " dir" ), " dir" )
12
13
13
14
action (" build_$crate " ) {
14
15
assert (current_toolchain == host_toolchain )
@@ -24,10 +25,15 @@ template("build_crate") {
24
25
25
26
inputs = [
26
27
cargo_exe ,
28
+ " .cargo/config.toml" ,
27
29
" Cargo.lock" ,
30
+ " Cargo.toml" ,
28
31
]
29
32
30
- outputs = [ crate_exe ]
33
+ outputs = [
34
+ crate_exe ,
35
+ " $crate_target_dir /.stamp" ,
36
+ ]
31
37
32
38
# To avoid irreproducible builds,
33
39
# `build_crate`s MUST always build with `cargo vendor`ed deps,
@@ -37,7 +43,7 @@ template("build_crate") {
37
43
# when running `cargo build`.
38
44
args = [
39
45
" --temp_dir_path" ,
40
- rebase_path (root_out_dir ),
46
+ rebase_path (crate_target_dir ),
41
47
rebase_path (cargo_exe ),
42
48
" build" ,
43
49
" --quiet" ,
@@ -47,7 +53,7 @@ template("build_crate") {
47
53
" --config" ,
48
54
rebase_path (" .cargo/config.toml" ),
49
55
" --target-dir" ,
50
- rebase_path (get_path_info ( crate_exe , " dir " ) + " /.. " ),
56
+ rebase_path (crate_target_dir ),
51
57
" --frozen" ,
52
58
" --package" ,
53
59
string_replace (crate , " _" , " -" ),
0 commit comments