feat(libSceNKWebKitRequirements): implement the SQLite exports #15186
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15186"
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 Noxy-HNR on 2026-11-02T20:23:29Z.
What
The 50
sqlite3_*exports of libSceNKWebKitRequirements now run SQLite instead of throwing. SQLite is a new submodule,3rdparty/sqlite(sqlite/sqlite atversion-3.54.1).cmake/Sqlite.cmakebuilds it from source. It first builds SQLite's own host tools (autosetup/jimsh0.cas the Tcl interpreter,lemon,mkkeywordhashandmksourceid), and uses them to generatesqlite3.h, the parser, the opcode tables,keywordhash.h,pragma.handctime.c, the same way SQLite'smain.mkdoes. No tclsh or system SQLite is needed, and no SQLite code is copied intocore/.src/Sqlite.cppholds only thin guest adapters:sqlite3_set_clientdata, so it is freed when the connection closes.sqlite3_user_datareturns the guest's own pointer.sqlite3_bind_bloborsqlite3_bind_text16is called right after SQLite copies the value, because SQLite cannot call a SysV function itself.sqlite3_open_v2maps ordinary file names through the guest path resolver.:memory:, empty names and non-URI names opened withSQLITE_OPEN_MEMORYpass through unchanged. WithSQLITE_OPEN_URI, afile:URI passes through only when it has no%and either its path is exactly:memory:or its lastmodeparameter ismemory; other file URIs throw throughNotImplemented_nid_no_patch. The guest VFS name is ignored. Read-write opens record the database and its-wal,-shmand-journalpaths forsceKernelSync.ATTACH DATABASEwith a non-empty name, including the attachment performed byVACUUM INTO, withSQLITE_AUTH. The guest authorizer cannot disable this restriction.ATTACH ''and plainVACUUMremain supported; guest-path resolution for file-producing attachments is unimplemented and recorded in debt.The prototypes are inferred from the export names, which hash to the inventory NIDs. Nothing was checked on a console, and the debt file records this along with the adapter limits. No title unblock is claimed.
Tested
New
guest_nk_req_sqlitetest, which calls only the guest exports:sqlite3_sql,sqlite3_next_stmt, last rowid, total changes and autocommit.user_dataandresult_error, an aggregate that is created and then deleted,sqlite3_interruptfrom inside a function, a collation in both encodings with its destroy calls on close, an authorizer denyingDELETE(SQLITE_AUTH), and extended result codes./wal.db): WAL mode, the WAL hook (including the default autocheckpoint argument it replaces),sqlite3_wal_checkpoint_v2, a busy handler hit by a second connection behindBEGIN EXCLUSIVE, andsqlite3_busy_timeoutreplacing it.mode=memorytext in paths, duplicatemodeparameters, percent-encoded parameters andSQLITE_OPEN_MEMORYcombined with file URIs must create no host file. Accepted memory URIs remain usable.ATTACHandVACUUM INTOare refused on memory and file connections, including after installing and clearing a permissive guest authorizer; plainVACUUMand empty-name attachment still work.Current-head result:
ec49a4f03fb635775909e285a408243dcebd4339, the hosted Windows build built and ranguest_nk_req_sqlite, which passed in 0.08 seconds. Applicable hosted checks pass. No fresh Linux runtime result for the URI/authorizer follow-up is recorded here.Historical results from before the URI/authorizer follow-up:
b28bb77217:ctest -R "guest_nk_req_sqlite|public_headers"66/66 passed.ctest -R guest_nk_req_sqlitepassed 3 of 3 runs. A checkout withcore.autocrlf=trueadds SQLite'salt1suffix toSQLITE_SOURCE_ID. That id is not exported and nothing depends on it.python tools/check_conventions.py --base origin/mainandpython core/libs/tests/test_public_headers.py --audit-only(399 libraries, 27,365 exports): passed.python tools/pr_overlap.py(1,690 open PRs): no other PR implements asqlite3_*export. #14374 (zlib) and #14421 (libjpeg, libxml2, libpsl) are older and also createlibSceNKWebKitRequirements/CMakeLists.txt. They also remove neighbouring stubs fromExport.cppandIdentified.hpp, and edit the same debt lines (#14421 also touches.gitmodules). This PR goes after them, and I'll rebase it onto their build file as they land. #14435 and #14448 only touch the end of.gitmodules.No console or retail-title test.
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)