Skip to content

test: build the NKWebKit content type, libwebrtc key params and nested exception tests on macOS - #18521

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
011010:fix/macos-three-test-builds
Nov 12, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
011010:fix/macos-three-test-builds

Conversation

@011010

@011010 011010 commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

What

Three test translation units do not compile with libc++, so BUILD_TESTING=ON stops on them on macOS. Each failure is a standard-library strictness, not platform behaviour, and no behaviour changes.

  • core/libs/prx/libSceNKWebKit/tests/ContentType.cpp: ContentType is an aggregate whose WtfAbi::String member has explicit String(StringImpl* value = nullptr), and libc++ rejects ContentType value{} as a copy-list-initialization of that member ("chosen constructor is explicit in copy-initialization"). Ten declarations become ContentType value;, which default-initializes the member through the same constructor and leaves the same bytes.
  • core/libs/prx/libwebrtc/tests/KeyParams.cpp: the file uses std::initializer_list in a range-based for (for (std::int32_t type : {2, 3, -1, 0x7fffffff})) and relied on a transitive include. libc++ does not provide one, so <initializer_list> is now included.
  • core/libs/tests/GuestLibcInternalNestedException.cpp: NestedExceptionLayout holds a GuestExceptionPointer, which on libc++ is explicit GuestExceptionPointer(void* primary) with no default constructor, so NestedExceptionLayout baseObj{} cannot be value-initialized. The two layouts are initialized with the null pointer they were meant to hold.

These are three of the nine translation units that still stop a full macOS build. The other six are #17767 (libkernel/File/src/Stdio.cpp), #17532 (libSceLibcInternal/BasicString.cpp) and #16801 (the NKWebKit request, RTCP feedback and CES setter tests), so this pull request does not touch them.

Tested

  • macOS 27.0.1 (26A434), Apple M4 Mac mini, Apple clang 21.0.0, x86-64 Release under Rosetta 2, main 316a35712f with fix(libkernel): give FillStatfs the noexec flag so statfs builds on macOS #17767 and fix(libSceLibcInternal): clamp the string count as size_t on macOS #17532 applied, which the tree needs for libkernel and libSceLibcInternal to build at all.
  • Without this change, the three targets fail exactly as quoted in What: ContentType.cpp:40 and nine more declarations, KeyParams.cpp:49 missing std::initializer_list, GuestLibcInternalNestedException.cpp:49,53 no matching constructor for GuestExceptionPointer.
  • With it, all three targets build and their tests pass: nkwebkit_contenttype 1.27 s, guest_webrtc_key_params 0.40 s, guest_libc_internal_nested_exception in the same run, 3 of 3.
  • python3 tools/check_conventions.py --base origin/main: all conventions checks passed.
  • python3 tools/pr_overlap.py --branch fix/macos-three-test-builds: no overlap with open pull requests (1,981 open at the time).
  • Not tested: a full macOS build of the whole tree, which still stops earlier on the six objects listed above; no title, since these are test-only changes.

Checklist

…d exception tests on macOS

Three test translation units do not compile with libc++:

- `ContentType` is an aggregate whose `WtfAbi::String` member has an explicit
  constructor with a default argument, and libc++ rejects
  `ContentType value{}` as a copy-list-initialization of that member. Ten
  declarations become `ContentType value;`, which default-initializes the
  member through the same constructor and leaves the same bytes.
- `KeyParams.cpp` uses `std::initializer_list` in a range-based for and relied
  on a transitive include; libc++ does not provide one.
- `NestedExceptionLayout` holds a `GuestExceptionPointer`, which on libc++ has
  an explicit constructor and no default, so `{}` cannot initialize it. The two
  layouts are initialized with the null pointer they were meant to hold.
@JJenkx

JJenkx commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Windows check of head ed57ff9151, merged onto main 65351c2931 (6186517458, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.

  • guest_libc_internal_nested_exception, guest_webrtc_key_params, nkwebkit_contenttype pass in 3 of 3 runs, none skipped.

AI-assisted: yes.

@github-actions github-actions Bot added the prx label Nov 11, 2026

@PrivacyOnion PrivacyOnion left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against ed57ff9151:

  • Conventions: tools/check_conventions.py passed; git diff --check clean.
  • Build: guest_webrtc_key_params_tests built cleanly.
  • CTest (guest_webrtc_key_params):
    1/1 Test #4660: guest_webrtc_key_params ..........   Passed    0.03 sec
    100% tests passed, 0 tests failed out of 1
    
  • Code reading:
    • core/libs/prx/libSceNKWebKit/tests/ContentType.cpp: Verified that replacing aggregate value-initialization (ContentType value{}) with default initialization (ContentType value;) across all 10 instances invokes WtfAbi::String's default constructor (explicit String(StringImpl* = nullptr)), preserving a null impl pointer for containerType and parameter queries while resolving libc++'s rejection of explicit constructors during copy-list-initialization.
    • core/libs/prx/libSceNKWebKit/tests/ContentType.cpp: Confirmed that Construct, TestConstructors, TestContainerType, and TestParameterAbsent maintain identical object layouts and reference count accounting across both base (_ZN7WebCore11ContentTypeC2...) and complete (_ZN7WebCore11ContentTypeC1...) constructor and destructor calls.
    • core/libs/prx/libwebrtc/tests/KeyParams.cpp: Verified that adding #include <initializer_list> maintains strict lexicographical header sorting and provides the required standard library type for the range-based for loop over {2, 3, -1, 0x7fffffff} in TestUnknownTypesThrow on standard library implementations without transitive inclusion.
    • core/libs/tests/GuestLibcInternalNestedException.cpp: Confirmed that initializing NestedExceptionLayout with {nullptr, GuestExceptionPointer(nullptr)} provides explicit direct initialization of GuestExceptionPointer, satisfying libc++'s explicit GuestExceptionPointer(void*) constructor without relying on aggregate default initialization.
    • core/libs/tests/GuestLibcInternalNestedException.cpp: Verified that _ZNSt16nested_exceptionD2Ev_nid_postfix (base destructor) and _ZNSt16nested_exceptionD1Ev_nid_postfix (complete destructor) execute safely on the explicitly initialized null GuestExceptionPointer and leave the pointer null per _ZNKSt15__exception_ptr13exception_ptr6_M_getEv_nid_postfix.
    • Repository rules and conventions: Confirmed zero comments were introduced, the commit subject and PR title conform to Conventional Commits ('test: ...'), and no production library exports or debt documentation were altered.
  • Note: the AI-assisted checkbox can stay.

Looks Good To Me

@oneandonlydean
oneandonlydean merged commit 81912e9 into boykopovar:main Nov 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants