Skip to content

Commit 568a52a

Browse files
Fix-up.
1 parent ef93802 commit 568a52a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

script/build_crate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import argparse
77
import os
8+
from pathlib import Path
89
import platform
910
import subprocess
1011

@@ -18,3 +19,4 @@
1819
else:
1920
env["TMPDIR"] = args.temp_dir_path
2021
subprocess.check_call(cargo_args, env=env)
22+
Path(f'{args.temp_dir_path}/.stamp').touch()

tools/crates/build_crate.gni

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ template("build_crate") {
99
defined(invoker["${crate}_exe"]),
1010
"Please add ${crate}_exe to //brave/tools/crates/config.gni (or to $crate itself)!")
1111
crate_exe = invoker["${crate}_exe"]
12+
crate_target_dir = get_path_info(get_path_info(crate_exe, "dir"), "dir")
1213

1314
action("build_$crate") {
1415
assert(current_toolchain == host_toolchain)
@@ -24,10 +25,15 @@ template("build_crate") {
2425

2526
inputs = [
2627
cargo_exe,
28+
".cargo/config.toml",
2729
"Cargo.lock",
30+
"Cargo.toml",
2831
]
2932

30-
outputs = [ crate_exe ]
33+
outputs = [
34+
crate_exe,
35+
"$crate_target_dir/.stamp",
36+
]
3137

3238
# To avoid irreproducible builds,
3339
# `build_crate`s MUST always build with `cargo vendor`ed deps,
@@ -37,7 +43,7 @@ template("build_crate") {
3743
# when running `cargo build`.
3844
args = [
3945
"--temp_dir_path",
40-
rebase_path(root_out_dir),
46+
rebase_path(crate_target_dir),
4147
rebase_path(cargo_exe),
4248
"build",
4349
"--quiet",
@@ -47,7 +53,7 @@ template("build_crate") {
4753
"--config",
4854
rebase_path(".cargo/config.toml"),
4955
"--target-dir",
50-
rebase_path(get_path_info(crate_exe, "dir") + "/.."),
56+
rebase_path(crate_target_dir),
5157
"--frozen",
5258
"--package",
5359
string_replace(crate, "_", "-"),

0 commit comments

Comments
 (0)