From a34fe77fe76df141ff2fa97fd04930d5cf938a9d Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Tue, 27 Jan 2026 13:42:41 +0000 Subject: [PATCH] tools: add Rust args to `tools/make-v8.sh` Add args to `tools/make-v8.sh` for compiling Rust-based components, such as Temporal, for the Linux on ppc64le and s390x V8 CI builds. PR-URL: https://github.com/nodejs/node/pull/61898 Reviewed-By: Antoine du Hamel Reviewed-By: Filip Skokan Reviewed-By: Rafael Gonzaga Reviewed-By: Chengzhong Wu (cherry picked from commit bbae66f8f526b9356c315c29672d38b9ce8976bb) --- tools/make-v8.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/make-v8.sh b/tools/make-v8.sh index ca3b5729043..bf74606e190 100755 --- a/tools/make-v8.sh +++ b/tools/make-v8.sh @@ -29,10 +29,16 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then # shellcheck disable=SC2154 case "$CXX" in - *clang*) GN_COMPILER_OPTS="is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false treat_warnings_as_errors=false use_custom_libcxx=false" ;; + *clang*) + CLANG_VERSION=$(clang -dumpversion | cut -d. -f1) + RUST_VERSION=$(rustc --version --verbose | awk '/release:/ {print $2}') + GN_COMPILER_OPTS="is_clang=true clang_base_path=\"/usr\" clang_use_chrome_plugins=false treat_warnings_as_errors=false use_custom_libcxx=false clang_version=\"${CLANG_VERSION}\"" + GN_RUST_ARGS="rustc_version=\"${RUST_VERSION}\" rust_sysroot_absolute=\"/usr\" rust_bindgen_root=\"/usr\"" + export RUSTC_BOOTSTRAP=1 + ;; *) GN_COMPILER_OPTS="treat_warnings_as_errors=false use_custom_libcxx=false" ;; esac - gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="$GN_COMPILER_OPTS is_component_build=false is_debug=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER" + gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="$GN_COMPILER_OPTS is_component_build=false is_debug=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true ${GN_RUST_ARGS} $CC_WRAPPER" ninja -v -C "out.gn/$BUILD_ARCH_TYPE" "${JOBS_ARG}" d8 cctest inspector-test else DEPOT_TOOLS_DIR="$(cd depot_tools && pwd)"