aboutsummaryrefslogtreecommitdiffstats
path: root/devel/electron37/files/patch-build_config_rust.gni
blob: 9d4c1b2ff8ed40c25b2405f9346ef4072e483d5b (plain) (blame)
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
--- build/config/rust.gni.orig	2025-08-25 14:15:51 UTC
+++ build/config/rust.gni
@@ -62,7 +62,8 @@ declare_args() {
   # set this to the output of `rustc -V`. Changing this string will cause all
   # Rust targets to be rebuilt, which allows you to update your toolchain and
   # not break incremental builds.
-  rustc_version = ""
+  rustc_version = exec_script("//build/gn_run_binary.py",
+    [ "${LOCALBASE}/bin/rustc", "-V" ], "trim string")
 
   # If you're using a Rust toolchain as specified by rust_sysroot_absolute,
   # you can specify whether it supports nacl here.
@@ -373,7 +374,11 @@ if (is_linux || is_chromeos) {
   }
 }
 
-if (toolchain_has_rust) {
+if (is_bsd) {
+  rust_abi_target = string_replace(rust_abi_target, "linux-gnu", current_os)
+}
+
+if (toolchain_has_rust && !is_bsd) {
   assert(rust_abi_target != "")
 
   _known_rust_target_triples_filepath = "//build/rust/known-target-triples.txt"