diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f0601b48..94278b6d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -558,13 +558,19 @@ 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-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' + || contains(matrix.target, '-apple-') && '-Clink-arg=-ObjC' + || '' }} steps: - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable @@ -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