feat(libSceNKWebKit): implement WTF FileSystemImpl hardLink, createSymbolicLink and appendFileContentsToFileHandle #19823
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19823"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by B-Howell on 2026-11-14T00:35:22Z.
What
Implements three existing throwing
libSceNKWebKitstubs from the pinned PS5 11.x WebKit source (80f77e94c6), reusing the module's ownopenFile/closeFileandString::utf8exports:WTF::FileSystemImpl::hardLink(PduV0fym+xE) andcreateSymbolicLink(dbycEreQEcg) follow thestd::filesystembranch of FileSystem.cpp:716-728 (create_hard_link/create_symlinkwith anerror_code,return !ec). They convert both paths to UTF-8 and call the guestlink_nid_postfixandsymlink_nid_postfixinlibkernel_sys— the same callslibScePosixForWebKitforwards__wrap_linkand__wrap_symlinkto. A null or empty path fails withENOENTthere, so it returns false, as libc++link/symlinkwould.appendFileContentsToFileHandle(bFLwUoQqNHM) follows FileSystem.cpp:249-277: open read-only, 512 KiB chunks, fail on a read error or a short write, stop after a short read. The read and write retry onEINTRas FileSystemPOSIX.cpp:137-155 does.libSceNKWebKitnow linkslibkernel_sys. The typed prototypes move fromInventoryExports.hpptoWtfExports.hpp, the three inventory rows go, and a debt entry records what is unverified (console libc++ assumed to make singlelink/symlinkcalls; host buffer instead offastMalloc; symbolic links tested on Linux only).Tested
Ubuntu 22.04 on WSL2, GCC 11.4, Release, base
6fd2999417(currentmainis 4 commits ahead, all libc math; merges cleanly). Built and run at36b267b0dc; the head differs from it only in the debt-file wording.New
TestFileLinksintests/Wtf.cpp, under a guest path alias: hard link shares the file and reads back the content; linking onto an existing name, from a missing source, or with a null path returns false; a relative symbolic link is created (checked withsymlink_statusandread_symlink) and opens through to the file; an existing link path and null paths return false; appending into aReadWritehandle afterheadgiveshead+ the file, then a 536,633-byte file (loop path) and an exactly 524,288-byte file (full-buffer then zero-length read); a missing source and a read-only target return false.Red control (same test, the three bodies restored to
NotImplemented_nid_no_patch):ctest -R '^nkwebkit_wtf$'→Subprocess aborted,_ZN3WTF14FileSystemImpl8hardLinkERKNS_6StringES3_ not implemented.This change:
ctest -R '^nkwebkit_wtf$'→Passed3/3 runs.ctest -R '^public_headers'→ 65/65 passed.tools/progress.py: libraries done 15784 → 15787 (+3).2026-11-14: comment-only commit
69c1de3682eadds the verbatim upstream notices of FileSystem.cpp and FileSystemPOSIX.cpp under the existingDerived fromlines insrc/WtfSystem.cpp(maintainer ruling, #19819 comment). No code changed, so no rebuild;tools/check_conventions.py --base origin/mainpasses andgit diff --checkis clean.@JJenkx, Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release,
69c1de3682merged onto main04631f5042(report):nkwebkit_wtfpassed 3/3, none skipped.Debt fragment
c7124c5b49: merged main3ae84d01bd3(thetests/Wtf.cppconflict with #19103 kept both test groups) and moved this PR's debt edits intodocs/dev/debt/changes/claude-nkwebkit-wtf-fs-links.md; the debt files match main. WSL2 Ubuntu:nkwebkit_wtf_testsbuilt andctest -R ^nkwebkit_wtf$passed 1/1.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.Main merge
afc34922b28: ordinary merge ofmaincf058cf14bc. AlibSceNKWebKit/CMakeLists.txtconflict with the libpsl link from #20516, resolved by keeping both (libkernel_syspluspsl). WSL2 Ubuntu, Release:nkwebkit_wtf_testsbuilt,ctest -R ^nkwebkit_wtf$passed 1/1. The debt files matchmain;debt_fold.py --checkandcheck_conventions.py --base origin/mainpass.Main merge
b63f96f77fconto main1d3c669c843: conflict only intests/Wtf.cpp, where #19380 added its StackBounds and TimingScope tests next to this PR'sTestFileLinks; both test groups are kept. WSL2 Ubuntu, GCC, Release:nkwebkit_wtf_testsbuilt andctest -R ^nkwebkit_wtf$ --repeat until-fail:3passed.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.Main merge
e153728d304onto main33b699882b5: conflict only in thelibSceNKWebKit/CMakeLists.txtlink line, where #19680 addedicu_commonnext to this PR'slibkernel_sys; both are kept. WSL2 Ubuntu, GCC, Release:nkwebkit_wtf_testsbuilt andctest -R ^nkwebkit_wtf$ --repeat until-fail:3passed.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.Main merge
8b2caf00508onto mainb65eed22e13: conflicts inExport.cpp,InventoryExports.hpp,WtfExports.hppandtests/Wtf.cpp, all next to #19822, which implemented the neighbouringfileExists,deleteFile,deleteEmptyDirectory,moveFile,realPathandfilesHaveSameVolume. Both sides' stub removals are kept (none of the nine stubs remain), both sets ofWtfExports.hppdeclarations are kept, andTestFileLinksandTestFileSystemHelpersboth run. WSL2 Ubuntu, GCC, Release:nkwebkit_wtf_testsbuilt andctest -R ^nkwebkit_wtf$passed 1/1.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.Main merge
b33a3575785onto mainc8f72e905cc(after #22977): conflict only in thelibSceNKWebKit/CMakeLists.txtlink line, where #22977 addedlibcaironext to this PR'slibkernel_sys; both are kept, and no function was dropped or duplicated. Windows 11, WinLibs GCC 15.2.0 r7, Release:nkwebkit_wtf_testsandnkwebkit_dragimage_testsbuilt andctest -R "^nkwebkit_(wtf|dragimage)$" --repeat until-fail:3passed. (WSL Ubuntu 22.04 GCC 11.4 cannot buildmain'ssrc/DragImage.cppfrom #22977 at all, so this round was tested on Windows.)debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.Main merge
2821f223139onto maind3acf88f753(after #20327): conflict only in thelibSceNKWebKit/CMakeLists.txtlink line, where #20327 addedlibSceNKWebKitRequirementsnext to this PR'slibkernel_sys; both are kept, and no function was dropped or duplicated. Windows 11, WinLibs GCC 15.2.0 r7, Release:nkwebkit_wtf_testsandnkwebkit_dragimage_testsbuilt andctest -R "^nkwebkit_(wtf|dragimage)$" --repeat until-fail:3passed.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.Main merge
dcc4be45e55onto main609ae290c90(after #25541): conflict only in the stub lists ofExport.cppandInventoryExports.hpp, where #25541 implementedhardLinkOrCopyFileinsrc/WtfFileSystem.cppand removed its stub, next to the three stubs this PR removes. Both removals are kept, so each of the four functions has exactly one implementation. Windows 11, WinLibs GCC 15.2.0 r7, Release:nkwebkit_wtf_tests,nkwebkit_dragimage_testsandnkwebkit_wtffilesystemlinks_tests(from #25541) built andctest -R "^nkwebkit_(wtf|dragimage|wtffilesystemlinks)$" --repeat until-fail:3passed.debt_fold.py --checkandcheck_conventions.py --base origin/mainpass; the debt files match main.@ycbuzi, full ctest on Windows Server 2022 and 2025 (GitHub-hosted, WinLibs GCC 15.2.0),
dcc4be45e5merged into main (report): no failures beyond those on main on the same machine (6834 tests; 2025 had none).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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T01:05:49Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
34fdaf0191:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T00:02:08Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
684eacffff:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T04:43:40Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
24dd2ed869:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T23:57:26Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
c7124c5b49:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T02:02:57Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
afc34922b2:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-16T22:22:19Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b63f96f77f:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T01:44:00Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
9400a2f457:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T07:13:15Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
e153728d30:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T21:24:38Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
8b2caf0050:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T21:41:13Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and its reported tests support merging, with console behavior still unverified.
What I ran
Reviewed head
8b2caf0050878283864f5893bc76e2f5994cec44using the prepared diff andrepo_read.py. No commands or tests were run by me; build and test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No changed source files were excluded from review. Read:
CMakeLists.txt,WtfExports.hpp,WtfSystem.cpp,tests/Wtf.cpp, and the debt fragment.Export.cppandInventoryExports.hppwere excluded from the prepared bundle and not read; their diff hunks only remove three stubs and declarations.files.jsonwas unavailable. The reported Linux and Windows test runs were not independently reproduced; behavior on console firmware was not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T17:11:38Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b33a357578:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T17:34:08Z.
Review: COMMENTED
Reviewed — no blocking findings
A review could not be completed because the required review-folder contents and repository reader were not accessible through the available tools.
What I ran
No commands were run. The pinned head,
b33a3575785f0aa658a8bd20e5408312cf34cc06, was not inspected.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
The description, commits, diff, manifest, changed-file contents, and repository behavior were not read. No files can be confirmed as read against the reviewed list.
To get this to a good state
Provide access to the review inputs and pinned repository reader so the change can be reviewed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T05:38:17Z.
Review: APPROVED
Reviewed — looks good
The changed implementations and their callers appear sound at the pinned head; the reported test runs were supplied by the author and were not run in this review.
What I ran
Reviewed head
2821f223139fb0e5e985a5de7e6904cd374c2eb2; no build or test commands were run. Readdescription.md,commits.md,manifest.json,diff.patch, and the included full text forCMakeLists.txt,WtfExports.hpp,WtfSystem.cpp,Wtf.cpp, and the debt fragment. Targeted source context was read for the guest string ABI, link wrappers, and call sites.Export.cppandInventoryExports.hppwere excluded from the review bundle because they were too large; targeted ranges ofExport.cppwere read through the pinned reader.files.jsonwas not available through the reader.Results
Export.cppranges inspectedFindings
Blocking
None.
Non-blocking
None.
Not verified
No commands, build, or tests were run in this review. Console behavior remains unverified as the debt entry states. The full contents of
Export.cppandInventoryExports.hppwere not read; only relevant export-stub lines fromExport.cppwere inspected. The author-reported Linux, Windows, and WSL2 test results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T10:57:21Z.
Review: APPROVED
Reviewed — looks good
The reviewed code matches the stated implementation, and the reported checks provide supporting evidence; console behavior remains unverified.
What I ran
Reviewed head
dcc4be45e55a0a5a705df6c1e8a7335b5ff9f32dusing the prepared diff and pinned reader. No build or tests were run in this review; test results below are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full texts of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere excluded by the review-folder size rule; their changed regions were read through the pinned reader. Full text was read forcore/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cpp,core/libs/prx/libSceNKWebKit/tests/Wtf.cpp, anddocs/dev/debt/changes/claude-nkwebkit-wtf-fs-links.md. No programmatic checks were run by this review. Console libc++ behavior and symbolic link behavior on Windows remain unverified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-27T14:17:22Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
dcc4be45e5:tools/check_conventions.pypassed.nkwebkit_wtf_testsbuilt cleanly.nkwebkit_wtf):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WtfExports.hpp,core/libs/prx/libSceNKWebKit/src/WtfSystem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:48:07Z.
Review: COMMENTED
I ran
nkwebkit_wtfwith the patch applied on Linux. It passed the hard-link, symlink, and append cases, including the guest path resolution checks and the readback of the linked file.AI-assisted: yes.
Pull request closed