summarylogtreecommitdiffstats
path: root/system-rust-utils.patch
blob: 79f2680d11c931ea83a7667f9095e7e6d516f296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/script/cargo.py b/script/cargo.py
index 0766c5f118..40b88e9a5c 100755
--- a/script/cargo.py
+++ b/script/cargo.py
@@ -21,7 +21,7 @@ def run_cargo(command, args):
     # Enable experimental features in non-nightly builds
     env['RUSTC_BOOTSTRAP'] = '1'
 
-    rustup_bin_dir = os.path.abspath(os.path.join(rustup_home, 'bin'))
+    rustup_bin_dir = os.path.abspath(os.path.join('/usr', 'bin'))
     cargo_exe = args.exe
 
     env['PATH'] = rustup_bin_dir + os.pathsep + env['PATH']
diff --git a/script/cargo_cbindgen.py b/script/cargo_cbindgen.py
index db28fd013e..e2082e36fe 100755
--- a/script/cargo_cbindgen.py
+++ b/script/cargo_cbindgen.py
@@ -20,7 +20,8 @@ def run(args):
     cargo_home = args.cargo_home
     env["CARGO_HOME"] = cargo_home
 
-    rustup_bin = os.path.abspath(os.path.join(rustup_home, "bin"))
+    # rustup_bin = os.path.abspath(os.path.join(rustup_home, "bin"))
+    rustup_bin = os.path.abspath(os.path.join("/usr", "bin"))
     cbindgen_bin = os.path.join(
         rustup_bin, "cbindgen" if sys.platform != "win32" else "cbindgen.exe"
     )
diff --git a/script/download_rust_deps.py b/script/download_rust_deps.py
index d1d4b70eb2..ce9e6e816c 100755
--- a/script/download_rust_deps.py
+++ b/script/download_rust_deps.py
@@ -191,7 +191,8 @@ def main():
         "features": "vendored-openssl",
     }]
     for tool in tools:
-        cargo_install(tool, rustup_home)
+        if shutil.which(tool["name"]) is None:
+            cargo_install(tool, rustup_home)
 
     return 0