File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (c) 2025 The Brave Authors. All rights reserved.
2
+ # This Source Code Form is subject to the terms of the Mozilla Public
3
+ # License, v. 2.0. If a copy of the MPL was not distributed with this file,
4
+ # You can obtain one at https://mozilla.org/MPL/2.0/.
5
+
6
+ import argparse
7
+ import os
8
+ import platform
9
+ import subprocess
10
+
11
+ parser = argparse .ArgumentParser (
12
+ description = 'Build crates in //brave/tools/crates/config.gni' )
13
+ parser .add_argument ('--temp_dir_path' , required = True )
14
+ args , cargo_args = parser .parse_known_args ()
15
+ env = os .environ .copy ()
16
+ if platform .system () == "Windows" :
17
+ env ['TEMP' ] = env ['TMP' ] = args .temp_dir_path
18
+ else :
19
+ env ["TMPDIR" ] = args .temp_dir_path
20
+ subprocess .check_call (cargo_args , env = env )
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ template("build_crate") {
15
15
16
16
forward_variables_from (invoker , [ " deps" ])
17
17
18
- script = " //build/gn_run_binary .py"
18
+ script = " //brave/script/build_crate .py"
19
19
20
20
cargo_exe = " //third_party/rust-toolchain/bin/cargo"
21
21
if (host_os == " win" ) {
@@ -36,6 +36,8 @@ template("build_crate") {
36
36
# --frozen (--locked + --offline)
37
37
# when running `cargo build`.
38
38
args = [
39
+ " --temp_dir_path" ,
40
+ rebase_path (root_out_dir ),
39
41
rebase_path (cargo_exe ),
40
42
" build" ,
41
43
" --quiet" ,
You can’t perform that action at this time.
0 commit comments