From 4de05b4719964ade7cff6598524f99bef8e8b31d Mon Sep 17 00:00:00 2001 From: injaneity <44902825+injaneity@users.noreply.github.com> Date: Wed, 9 Sep 2026 08:41:46 -0500 Subject: [PATCH 1/3] test(cua-driver): check real macos linker output for duplicate symbols --- scripts/ci/macos/test-swift-linker-symbols.sh | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 scripts/ci/macos/test-swift-linker-symbols.sh diff --git a/scripts/ci/macos/test-swift-linker-symbols.sh b/scripts/ci/macos/test-swift-linker-symbols.sh new file mode 100755 index 0000000000..6979ced5f6 --- /dev/null +++ b/scripts/ci/macos/test-swift-linker-symbols.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ "$(uname -s)" != Darwin ]]; then + echo "This regression check requires a native macOS linker." >&2 + exit 2 +fi + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +ARTIFACT_DIR="$(mktemp -d "${TMPDIR:-/tmp}/cua-swift-linker.XXXXXX")" +export CARGO_TARGET_DIR="${ARTIFACT_DIR}/target" +export CARGO_TERM_COLOR=never +export RUSTFLAGS="${RUSTFLAGS:+${RUSTFLAGS} }-W linker-messages" +unset CARGO_ENCODED_RUSTFLAGS + +printf 'Evidence: %s\n' "${ARTIFACT_DIR}" +{ + git -C "${REPO_ROOT}" rev-parse HEAD + rustc --version + cargo --version + xcrun swift --version + sw_vers +} > "${ARTIFACT_DIR}/environment.txt" 2>&1 + +set +e +cargo build --manifest-path "${REPO_ROOT}/libs/cua-driver/rust/Cargo.toml" \ + --release --locked -p cua-driver 2>&1 | tee "${ARTIFACT_DIR}/build.log" +BUILD_STATUSES=("${PIPESTATUS[@]}") +set -e + +if [[ "${BUILD_STATUSES[0]}" != 0 || "${BUILD_STATUSES[1]}" != 0 ]]; then + printf 'FAIL: native build or evidence capture failed (%s).\n' "${BUILD_STATUSES[*]}" >&2 + exit 1 +fi + +if grep -iE 'duplicate symbols?([[:space:]]|:)' "${ARTIFACT_DIR}/build.log" \ + > "${ARTIFACT_DIR}/duplicate-symbols.txt"; then + echo "FAIL: successful native build emitted duplicate-symbol linker diagnostics." >&2 + exit 1 +fi + +echo "PASS: fresh native build succeeded without duplicate-symbol linker diagnostics." From 60c62af0434a7bf3df9f6976e339a8df6ad0ed74 Mon Sep 17 00:00:00 2001 From: injaneity <44902825+injaneity@users.noreply.github.com> Date: Wed, 9 Sep 2026 08:53:45 -0500 Subject: [PATCH 2/3] fix(cua-driver): consume namespaced ScreenCaptureKit Swift bridge Update only screencapturekit from 6.0.1 to 8.0.1, the smallest published release containing the upstream private Swift module rename. Existing Cua capture and recording call sites compile unchanged; other locked dependencies are unchanged. Salvaged from doom-fish/screencapturekit-rs#159 via its published 8.0.1 release. The upstream fix by grishy is reused rather than reimplemented or vendored. Native red: fresh release build succeeded with 64 duplicate-symbol diagnostic lines; the regression check exited 1. Green: the identical fresh build check exits 0 with no duplicate symbols; unrelated rpath and dead-code warnings remain visible. All 365 platform unit tests pass, 2 ignored. Native capture/recording certification remains pending. Co-authored-by: Sergei G. <13949080+grishy@users.noreply.github.com> --- libs/cua-driver/rust/Cargo.lock | 4 ++-- libs/cua-driver/rust/crates/platform-macos/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/cua-driver/rust/Cargo.lock b/libs/cua-driver/rust/Cargo.lock index 5f3ca6831e..8c3eec1a9e 100644 --- a/libs/cua-driver/rust/Cargo.lock +++ b/libs/cua-driver/rust/Cargo.lock @@ -3795,9 +3795,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "screencapturekit" -version = "6.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74afe91a6a3f8859ff08339535891819f5438e7cb284c1b74cc8866eb80956bc" +checksum = "9ddaa8d6b16a2762c9a97c9a6297f04cb8ded0487e5ef02dc98b4e2bee3a26c7" dependencies = [ "apple-cf", "apple-metal", diff --git a/libs/cua-driver/rust/crates/platform-macos/Cargo.toml b/libs/cua-driver/rust/crates/platform-macos/Cargo.toml index d53bfe4c7a..5a18e6a516 100644 --- a/libs/cua-driver/rust/crates/platform-macos/Cargo.toml +++ b/libs/cua-driver/rust/crates/platform-macos/Cargo.toml @@ -60,7 +60,7 @@ objc2-quartz-core = { version = "0.2", features = ["CALayer"] } # ffmpeg subprocess on macOS. `macos_15_0` enables the `SCRecordingOutput` # convenience that finalises an mp4 in-process, removing the per-binary # Screen Recording TCC prompt that subprocess capture would otherwise trip. -screencapturekit = { version = "6", features = ["macos_15_0"] } +screencapturekit = { version = "8.0.1", features = ["macos_15_0"] } security-framework = { version = "3.7.0", default-features = false, features = ["OSX_10_15"] } zeroize = { workspace = true } getrandom = { workspace = true } From d1d2a7f37a8bb3a6a5686592a96487023d1f7ddc Mon Sep 17 00:00:00 2001 From: injaneity <44902825+injaneity@users.noreply.github.com> Date: Wed, 9 Sep 2026 08:53:47 -0500 Subject: [PATCH 3/3] ci(cua-driver): gate native macos duplicate-symbol diagnostics --- .github/workflows/ci-swift-linker.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/ci-swift-linker.yml diff --git a/.github/workflows/ci-swift-linker.yml b/.github/workflows/ci-swift-linker.yml new file mode 100644 index 0000000000..f658a7c916 --- /dev/null +++ b/.github/workflows/ci-swift-linker.yml @@ -0,0 +1,45 @@ +name: "CI: macOS Swift linker" + +on: + pull_request: + paths: + - "libs/cua-driver/rust/**" + - "scripts/ci/macos/test-swift-linker-symbols.sh" + - ".github/workflows/ci-swift-linker.yml" + push: + branches: [main] + paths: + - "libs/cua-driver/rust/**" + - "scripts/ci/macos/test-swift-linker-symbols.sh" + - ".github/workflows/ci-swift-linker.yml" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: swift-linker-${{ github.ref }} + cancel-in-progress: true + +jobs: + link: + name: Fresh macOS link without duplicate symbols + runs-on: macos-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 + - uses: dtolnay/rust-toolchain@stable + - name: Verify native linker output + env: + TMPDIR: ${{ runner.temp }}/ + run: bash scripts/ci/macos/test-swift-linker-symbols.sh + - name: Preserve linker evidence + if: always() + uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 + with: + name: swift-linker-evidence + if-no-files-found: error + path: | + ${{ runner.temp }}/cua-swift-linker.*/environment.txt + ${{ runner.temp }}/cua-swift-linker.*/build.log + ${{ runner.temp }}/cua-swift-linker.*/duplicate-symbols.txt