From 0c3e7cbc75554956b61240d671b8400f99cb55d8 Mon Sep 17 00:00:00 2001 From: Yuri Neves Silveira Date: Thu, 21 May 2026 10:30:56 -0300 Subject: [PATCH] fix: install Rust x86_64 target for darwin/amd64 cross-compilation The build-v8-deps workflow runs on macos-latest (arm64) for all darwin builds. When cross-compiling for darwin/amd64 (x86_64), V8's bundled Rust toolchain lacks the x86_64-apple-darwin target, so the temporal_rs Rust crate is silently skipped. This leaves 307 undefined _temporal_rs_* symbols in libv8-1.a, causing link failures in downstream consumers (e.g. er's release workflow). Fix: install system Rust with the x86_64-apple-darwin target and point V8's GN build at it via rust_sysroot_absolute. This ensures temporal_rs compiles for x86_64 during cross-compilation. --- .github/workflows/build-v8-deps.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/build-v8-deps.yml b/.github/workflows/build-v8-deps.yml index dcf3e92..65f46af 100644 --- a/.github/workflows/build-v8-deps.yml +++ b/.github/workflows/build-v8-deps.yml @@ -92,6 +92,12 @@ jobs: EOF gclient sync --delete_unversioned_trees --no-history + - name: install Rust cross-compilation target (darwin/amd64) + if: matrix.target_os == 'darwin' && matrix.target_arch == 'amd64' + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --target x86_64-apple-darwin + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: generate build args run: | mkdir -p deps/.build/${{ matrix.target_os }}_${{ matrix.target_arch }} @@ -113,6 +119,12 @@ jobs: USE_CUSTOM_LIBCXX="true" fi + EXTRA_GN_ARGS="" + if [[ "${{ matrix.target_os }}" == "darwin" && "${{ matrix.target_arch }}" == "amd64" ]]; then + RUST_SYSROOT="$($HOME/.cargo/bin/rustc --print sysroot)" + EXTRA_GN_ARGS="rust_sysroot_absolute=\"${RUST_SYSROOT}\"" + fi + cat > /tmp/gn_args.txt << EOF is_debug=false is_clang=${IS_CLANG} @@ -138,6 +150,7 @@ jobs: v8_enable_sandbox=false exclude_unwind_tables=true v8_android_log_stdout=true + ${EXTRA_GN_ARGS} EOF - name: install sysroot (linux/arm64 cross-compile)