From ab0a88789afbe6e49714f874594eba479b05af0a Mon Sep 17 00:00:00 2001 From: abnormal749 <40458788+abnormal749@users.noreply.github.com> Date: Wed, 16 Sep 2026 03:44:14 +0800 Subject: [PATCH 1/2] Preserve WebRTC linkage in macOS releases The release job's empty RUSTFLAGS hides the Apple target settings, dropping Objective-C categories that WebRTC resolves at runtime. Keep -ObjC for macOS while preserving the Linux and Windows flags. --- .github/workflows/check.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f0601b48..3d70fc21 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -558,13 +558,13 @@ jobs: archive: zip runs-on: ${{ matrix.os }} env: - # Cleared for the same reason `plan-mutants` clears it: the workflow-wide - # value is `-Clink-arg=-fuse-ld=mold`, and only the Linux jobs that - # install mold can honor it. Two of these three runners cannot have mold - # at all, and MSVC hands the flag to `link.exe`, which dies with LNK1117. - # Release builds happen once per push rather than once per mutant, so the - # linker that is present everywhere is the right trade. - RUSTFLAGS: ${{ matrix.target == 'x86_64-pc-windows-msvc' && '-C target-feature=+crt-static' || '' }} + # Override the workflow's Linux-only mold flag. Even an empty RUSTFLAGS + # overrides .cargo/config.toml, so macOS must repeat -ObjC here or the + # linker omits WebRTC's NSString categories and the first room aborts. + RUSTFLAGS: >- + ${{ matrix.target == 'x86_64-pc-windows-msvc' && '-C target-feature=+crt-static' + || matrix.target == 'aarch64-apple-darwin' && '-Clink-arg=-ObjC' + || '' }} steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable From a2e5c7a42c6fbe0aa9c3576fb28ceb1f986485b8 Mon Sep 17 00:00:00 2001 From: abnormal749 <40458788+abnormal749@users.noreply.github.com> Date: Wed, 16 Sep 2026 06:58:25 +0800 Subject: [PATCH 2/2] Guard WebRTC linkage in macOS releases A successful release build can still omit WebRTC's Objective-C categories. Keep the Apple target coverage aligned with Cargo and reject that binary before packaging; selector references are insufficient because they survive even when the category is missing. --- .github/workflows/check.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3d70fc21..94278b6d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -558,12 +558,18 @@ jobs: archive: zip runs-on: ${{ matrix.os }} env: - # Override the workflow's Linux-only mold flag. Even an empty RUSTFLAGS - # overrides .cargo/config.toml, so macOS must repeat -ObjC here or the - # linker omits WebRTC's NSString categories and the first room aborts. + # Override the workflow-wide Linux-only mold flag with the + # platform-specific flags required by each release target. Neither + # non-Linux runner can use mold, and MSVC hands -fuse-ld=mold to link.exe, + # which fails with LNK1117. Releases build once per push rather than once + # per mutant, so using the platform's default linker is the right trade. + # + # Even an empty RUSTFLAGS overrides .cargo/config.toml, so Apple targets + # must repeat -ObjC here or the linker omits WebRTC's NSString categories + # and the first room aborts. RUSTFLAGS: >- ${{ matrix.target == 'x86_64-pc-windows-msvc' && '-C target-feature=+crt-static' - || matrix.target == 'aarch64-apple-darwin' && '-Clink-arg=-ObjC' + || contains(matrix.target, '-apple-') && '-Clink-arg=-ObjC' || '' }} steps: - uses: actions/checkout@v7 @@ -643,6 +649,18 @@ jobs: --env CARGO_HOME=/cargo \ ${{ matrix.image }} \ cargo build --release --locked --target ${{ matrix.target }} + # A successful link does not prove the Objective-C categories survived. + # The selector reference remains even when its implementation is absent, + # so match a method name entry rather than any occurrence of the selector. + - name: Verify macOS WebRTC linkage + if: runner.os == 'macOS' + shell: bash + run: | + binary=target/${{ matrix.target }}/release/codetrial + # Collect the output so grep cannot give otool SIGPIPE under pipefail. + objc=$(otool -oV "$binary") + grep -Eq '^[[:space:]]*name[[:space:]].*[[:space:]]stringForAbslStringView:$' <<< "$objc" \ + || { echo 'WebRTC NSString category is missing' >&2; exit 1; } # Two libraries set the floor, not one. The C++ half of this build links # libstdc++, so a newer compiler raises the GLIBCXX_ requirement whether # or not it touches GLIBC_, and a binary refused for either reason is