From d93bd4b127c39e2f0e8d2ec3bbec3f7c118890f4 Mon Sep 17 00:00:00 2001 From: robbym Date: Wed, 18 Jul 2018 17:00:53 -0700 Subject: Use Cargo to install rust deps into //third_party/rust_crates (#383) --- tools/build_third_party.py | 2 ++ tools/util.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/build_third_party.py b/tools/build_third_party.py index d1ae16ccf..e46c8ddd1 100755 --- a/tools/build_third_party.py +++ b/tools/build_third_party.py @@ -29,3 +29,5 @@ remove_and_symlink(join("v8", "third_party", "llvm-build"), "llvm-build") remove_and_symlink(join("v8", "third_party", "markupsafe"), "markupsafe") run(["gclient", "sync", "--shallow", "--no-history"]) run(["yarn"]) +run(["cargo", "fetch", "--manifest-path=../Cargo.toml"], + envs={'CARGO_HOME': third_party_path + '/rust_crates'}) diff --git a/tools/util.py b/tools/util.py index 6874f8000..8b8628aba 100644 --- a/tools/util.py +++ b/tools/util.py @@ -4,10 +4,12 @@ import os import subprocess -def run(args, quiet=False): +def run(args, quiet=False, envs={}): if not quiet: print " ".join(args) env = os.environ.copy() + for key in envs.keys(): + env[key] = envs[key] if os.name == "nt": # Run through shell to make .bat/.cmd files work. args = ["cmd", "/c"] + args -- cgit v1.2.3