Repository navigation
test: build the NKWebKit content type, libwebrtc key params and nested exception tests on macOS - #18521
Merged
oneandonlydean merged 1 commit intoNov 12, 2026
Conversation
…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.
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
PrivacyOnion
approved these changes
Nov 12, 2026
PrivacyOnion
left a comment
Contributor
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against ed57ff9151:
- Conventions:
tools/check_conventions.pypassed;git diff --checkclean. - Build:
guest_webrtc_key_params_testsbuilt 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three test translation units do not compile with libc++, so
BUILD_TESTING=ONstops 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:ContentTypeis an aggregate whoseWtfAbi::Stringmember hasexplicit String(StringImpl* value = nullptr), and libc++ rejectsContentType value{}as a copy-list-initialization of that member ("chosen constructor is explicit in copy-initialization"). Ten declarations becomeContentType value;, which default-initializes the member through the same constructor and leaves the same bytes.core/libs/prx/libwebrtc/tests/KeyParams.cpp: the file usesstd::initializer_listin 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:NestedExceptionLayoutholds aGuestExceptionPointer, which on libc++ isexplicit GuestExceptionPointer(void* primary)with no default constructor, soNestedExceptionLayout 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
main316a35712fwith 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 forlibkernelandlibSceLibcInternalto build at all.What:ContentType.cpp:40and nine more declarations,KeyParams.cpp:49missingstd::initializer_list,GuestLibcInternalNestedException.cpp:49,53no matching constructor forGuestExceptionPointer.nkwebkit_contenttype1.27 s,guest_webrtc_key_params0.40 s,guest_libc_internal_nested_exceptionin 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).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)