test: build the RTCP feedback, CES setter and NKWebKit request tests on macOS #16801

Merged
AdnanKhan-ak47 merged 1 commit from upstream-pr/16801 into main 2026-11-11 22:26:13 +00:00
AdnanKhan-ak47 commented 2026-11-07 16:51:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AdnanKhan-ak47 on 2026-11-07T16:51:05Z.


What

Three test sources on main don't compile with Apple clang and libc++, so their four tests can't run on macOS. Only the tests change; the libraries are untouched.

  • <initializer_list>: libwebrtc/tests/RtcpTransportFeedback.cpp (line 22) and tests/GuestCesGbSetters.cpp (line 180) use braced lists in range-for loops. libstdc++ pulls in <initializer_list> through the other headers; libc++ doesn't, so clang stops with "cannot deduce type of initializer list because std::initializer_list was not found". Both now include it.
  • ResourceRequestBase request{}: in libSceNKWebKit/tests/ResourceRequest.cpp, aggregate initialisation copy-initialises every omitted member from {}. WtfAbi::String's only default constructor is explicit String(StringImpl* value = nullptr), which copy-initialisation can't use. GCC accepts this; clang rejects it ("chosen constructor is explicit in copy-initialization", lines 29, 64, 89 and 115).
    • The four requests are now value-initialised (ResourceRequestBase request = ResourceRequestBase();). That zeroes the same fields and calls the members' default constructors directly.

Tested

macOS 27.2, Apple M4, Apple clang, x86_64 Release under Rosetta 2. Tree: this branch merged into main 090f57166a with #4630, #7804 and #16591, which macOS needs to build the libraries.

  • Before: the four test programs fail to compile.
  • After: they compile, and guest_webrtc_rtcp_transport_feedback, guest_ces_gbsetters, guest_ces_gbsetters_module and nkwebkit_resourcerequest pass, 4 of 4.
  • Not run: Linux and Windows. GCC already compiled all three files, and the changes are an include and an equivalent initialisation.
  • tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py: no overlap with open pull requests.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5203849693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16801). Originally posted by [AdnanKhan-ak47](https://github.com/AdnanKhan-ak47) on 2026-11-07T16:51:05Z. --- ### What Three test sources on `main` don't compile with Apple clang and libc++, so their four tests can't run on macOS. Only the tests change; the libraries are untouched. - **`<initializer_list>`:** `libwebrtc/tests/RtcpTransportFeedback.cpp` (line 22) and `tests/GuestCesGbSetters.cpp` (line 180) use braced lists in range-for loops. libstdc++ pulls in `<initializer_list>` through the other headers; libc++ doesn't, so clang stops with "cannot deduce type of initializer list because std::initializer_list was not found". Both now include it. - **`ResourceRequestBase request{}`:** in `libSceNKWebKit/tests/ResourceRequest.cpp`, aggregate initialisation copy-initialises every omitted member from `{}`. `WtfAbi::String`'s only default constructor is `explicit String(StringImpl* value = nullptr)`, which copy-initialisation can't use. GCC accepts this; clang rejects it ("chosen constructor is explicit in copy-initialization", lines 29, 64, 89 and 115). - The four requests are now value-initialised (`ResourceRequestBase request = ResourceRequestBase();`). That zeroes the same fields and calls the members' default constructors directly. ### Tested macOS 27.2, Apple M4, Apple clang, x86_64 Release under Rosetta 2. Tree: this branch merged into `main` `090f57166a` with #4630, #7804 and #16591, which macOS needs to build the libraries. - **Before:** the four test programs fail to compile. - **After:** they compile, and `guest_webrtc_rtcp_transport_feedback`, `guest_ces_gbsetters`, `guest_ces_gbsetters_module` and `nkwebkit_resourcerequest` pass, 4 of 4. - **Not run:** Linux and Windows. GCC already compiled all three files, and the changes are an include and an equivalent initialisation. - `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py`: no overlap with open pull requests. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
coptergui-ops commented 2026-11-07 20:23:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coptergui-ops on 2026-11-07T20:23:01Z.

Review: APPROVED


All three changes verified locally, including the compiler divergence itself.

  • The aggregate in question is real: ResourceRequestAbi.hpp:21 is struct ResourceRequestBase with WtfAbi::String members, and WtfStringAbi.hpp:76 gives that class exactly one defaulting constructor, explicit String(StringImpl* value = nullptr). ResourceRequestBase has no user-declared constructors, so request{} aggregate-initialises and copy-initialises each member from {} — ill-formed against an explicit ctor, which is what clang hits at the four cited sites (29, 64, 89, 115 — matching the TestURL/TestFirstParty/TestMethod/TestScalars functions in the test file).
  • I reproduced the behaviour with this machine's g++ and clang++ on the minimal shape (struct A { explicit A(long p=0)… }; struct B { A a; }; B x{};): g++ accepts with a warning, clang++ fails with the exact diagnostic quoted in the description ("chosen constructor is explicit in copy-initialization"), and B x = B(); compiles cleanly on both. So the fix is portable and the swap preserves meaning: value-initialisation default-constructs the members, which runs String(nullptr)'s direct initialisation (impl = nullptr) and zeroes the POD/bitfield members — the same result the static_assert'd offsetof layout on ResourceRequestAbi.hpp:52+ expects.
  • The two <initializer_list> additions match real use sites: line 22 of RtcpTransportFeedback.cpp is for (std::uint16_t value : {…}) and line 180 of GuestCesGbSetters.cpp is for (Setter setter : {Range, Uda}); neither file included the header before, and the includes land in sorted position. libc++ not transitively pulling it in is the standard reason libstdc++-compiled projects fail on Apple clang.
  • Test-only diff: three files, 6 added lines, 4 replaced — no library or debt files touched, so conventions only care about the usual checks (tools/check_conventions.py --base origin/main --head pr-16801 reports clean apart from the body placeholder of this run).
  • The macOS run (Apple M4, four tests passing after) and the "Linux/Windows not run" line are consistent with what I verified: the changes are one include per file and an equivalent initialisation, GCC compiled these before.

No blocking findings.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5814765124 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16801#pullrequestreview-5814765124). Originally posted by [coptergui-ops](https://github.com/coptergui-ops) on 2026-11-07T20:23:01Z. **Review:** APPROVED --- All three changes verified locally, including the compiler divergence itself. - The aggregate in question is real: `ResourceRequestAbi.hpp:21` is `struct ResourceRequestBase` with `WtfAbi::String` members, and `WtfStringAbi.hpp:76` gives that class exactly one defaulting constructor, `explicit String(StringImpl* value = nullptr)`. `ResourceRequestBase` has no user-declared constructors, so `request{}` aggregate-initialises and copy-initialises each member from `{}` — ill-formed against an explicit ctor, which is what clang hits at the four cited sites (29, 64, 89, 115 — matching the `TestURL/TestFirstParty/TestMethod/TestScalars` functions in the test file). - I reproduced the behaviour with this machine's g++ and clang++ on the minimal shape (`struct A { explicit A(long p=0)… }; struct B { A a; }; B x{};`): g++ accepts with a warning, clang++ fails with the exact diagnostic quoted in the description ("chosen constructor is explicit in copy-initialization"), and `B x = B();` compiles cleanly on both. So the fix is portable and the swap preserves meaning: value-initialisation default-constructs the members, which runs `String(nullptr)`'s direct initialisation (`impl = nullptr`) and zeroes the POD/bitfield members — the same result the static_assert'd offsetof layout on `ResourceRequestAbi.hpp:52+` expects. - The two `<initializer_list>` additions match real use sites: line 22 of `RtcpTransportFeedback.cpp` is `for (std::uint16_t value : {…})` and line 180 of `GuestCesGbSetters.cpp` is `for (Setter setter : {Range, Uda})`; neither file included the header before, and the includes land in sorted position. libc++ not transitively pulling it in is the standard reason libstdc++-compiled projects fail on Apple clang. - Test-only diff: three files, 6 added lines, 4 replaced — no library or debt files touched, so conventions only care about the usual checks (`tools/check_conventions.py --base origin/main --head pr-16801` reports clean apart from the body placeholder of this run). - The macOS run (Apple M4, four tests passing after) and the "Linux/Windows not run" line are consistent with what I verified: the changes are one include per file and an equivalent initialisation, GCC compiled these before. No blocking findings.
gabichuuuuu commented 2026-11-07 22:22:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:22:59Z.

Review: COMMENTED


Read 38bddbff44 against main.

The two <initializer_list> includes cover the braced-list range-for loops in those files (RtcpTransportFeedback.cpp:23, GuestCesGbSetters.cpp:181). ResourceRequestBase is an aggregate whose WtfAbi::String members have only an explicit default constructor, so = ResourceRequestBase() value-initialises it: the object is zeroed and the member constructors are called directly. That keeps what {} meant without the copy-list-initialisation of an explicit constructor that clang rejects, and C++17 guaranteed elision means no copy. The Windows MinGW job built and passed all four touched tests, so GCC is unaffected. Test-only change; nothing to add.

Not run here; this is from reading the code and the CI logs.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5815295479 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16801#pullrequestreview-5815295479). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-07T22:22:59Z. **Review:** COMMENTED --- Read `38bddbff44` against `main`. The two `<initializer_list>` includes cover the braced-list range-for loops in those files (`RtcpTransportFeedback.cpp:23`, `GuestCesGbSetters.cpp:181`). `ResourceRequestBase` is an aggregate whose `WtfAbi::String` members have only an explicit default constructor, so `= ResourceRequestBase()` value-initialises it: the object is zeroed and the member constructors are called directly. That keeps what `{}` meant without the copy-list-initialisation of an explicit constructor that clang rejects, and C++17 guaranteed elision means no copy. The Windows MinGW job built and passed all four touched tests, so GCC is unaffected. Test-only change; nothing to add. Not run here; this is from reading the code and the CI logs. AI-assisted: yes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!16801
No description provided.