From: stephan Date: Wed, 4 Mar 2026 00:37:55 +0000 (+0000) Subject: opfs-wl is now loading and registering but it's still untested. X-Git-Tag: major-release~100^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ac95d9ce1324d2acce9877b4c7c389c223d7a39;p=thirdparty%2Fsqlite.git opfs-wl is now loading and registering but it's still untested. FossilOrigin-Name: 9a471f7491a371052bf1785098ba966dd0d03503e7d8b9fbcd65f07b038e5021 --- diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 371bec6bdd..7e48113ed2 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -913,7 +913,7 @@ endif sqlite3-api.jses += $(dir.api)/sqlite3-vfs-kvvfs.c-pp.js sqlite3-api.jses += $(dir.api)/sqlite3-vfs-opfs.c-pp.js sqlite3-api.jses += $(dir.api)/sqlite3-vfs-opfs-sahpool.c-pp.js -#sqlite3-api.jses += $(dir.api)/sqlite3-vfs-opfs-wl.c-pp.js +sqlite3-api.jses += $(dir.api)/sqlite3-vfs-opfs-wl.c-pp.js # Parallel builds can fail if $(sqlite3-license-version.js) is not # created early enough, so make all files in $(sqlite-api.jses) except diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js b/ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js index 294e7687be..740be8938b 100644 --- a/ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js +++ b/ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js @@ -51,6 +51,14 @@ */ "use strict"; const wPost = (type,...args)=>postMessage({type, payload:args}); +//#if nope +const urlParams = new URL(globalThis.location.href).searchParams; +if( !urlParams.has('vfs') ){ + throw new Error("Expecting vfs=opfs|opfs-wl URL argument for this worker"); +} +const isWebLocker = 'opfs-wl'===urlParams.get('vfs'); +const msgKeyPrefix = 'opfs-'; //isWebLocker ? 'opfs-wl-' : 'opfs-'; +//#endif const installAsyncProxy = function(){ const toss = function(...args){throw new Error(args.join(' '))}; if(globalThis.window === globalThis){ diff --git a/ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js index dfa44af5e1..c53bebdfe1 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js @@ -197,13 +197,14 @@ const installOpfsVfs = function callee(options){ promiseWasRejected = false; return promiseResolve_(sqlite3); }; + const workerArgs = '?vfs=opfs-wl'; const W = //#if target:es6-bundler-friendly - new Worker(new URL("sqlite3-opfs-async-proxy.js", import.meta.url)); + new Worker(new URL("sqlite3-opfs-async-proxy.js"+workerArgs, import.meta.url)); //#elif target:es6-module - new Worker(new URL(options.proxyUri, import.meta.url)); + new Worker(new URL(options.proxyUri+workerArgs, import.meta.url)); //#else - new Worker(options.proxyUri); + new Worker(options.proxyUri+workerArgs); //#endif setTimeout(()=>{ /* At attempt to work around a browser-specific quirk in which @@ -1156,6 +1157,7 @@ const installOpfsVfs = function callee(options){ OpfsWlDb.prototype = Object.create(sqlite3.oo1.DB.prototype); sqlite3.oo1.OpfsWlDb = OpfsWlDb; OpfsWlDb.importDb = opfsUtil.importDb; +//#if nope sqlite3.oo1.DB.dbCtorHelper.setVfsPostOpenCallback( opfsVfs.pointer, function(oo1Db, sqlite3){ @@ -1165,6 +1167,7 @@ const installOpfsVfs = function callee(options){ sqlite3.capi.sqlite3_busy_timeout(oo1Db, 10000); } ); +//#endif }/*extend sqlite3.oo1*/ const sanityCheck = function(){ diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js index dd1b4ba90b..934564c5ea 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js @@ -207,13 +207,14 @@ const installOpfsVfs = function callee(options){ promiseWasRejected = false; return promiseResolve_(sqlite3); }; + const workerArgs = '?vfs=opfs'; const W = //#if target:es6-bundler-friendly - new Worker(new URL("sqlite3-opfs-async-proxy.js", import.meta.url)); + new Worker(new URL("sqlite3-opfs-async-proxy.js"+workerArgs, import.meta.url)); //#elif target:es6-module - new Worker(new URL(options.proxyUri, import.meta.url)); + new Worker(new URL(options.proxyUri+workerArgs, import.meta.url)); //#else - new Worker(options.proxyUri); + new Worker(options.proxyUri+workerArgs); //#endif setTimeout(()=>{ /* At attempt to work around a browser-specific quirk in which diff --git a/manifest b/manifest index a23506fd3a..2f56d2c256 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C An\sinitial\sattempt\sto\splugging\sopfs-wl\sinto\sthe\sbuild\sbut\sits\sinitial\shandshake\swith\sthe\sasync\shalf\scollides\swith\sthe\sopfs\sVFS's\shandshake,\scausing\sbootstrapping\sto\sfail\smiserably.\sWe'll\sneed\sto\seither\sdevise\sa\shandshake\swhich\scan\sdifferentiate\sbetween\sthe\stwo\sinstances\sor\swe'll\sneed\sto\spreprocess\ssqlite3-opfs-async-proxy\sinto\stwo\scopies.\sMove\sthe\s(now)\sthree\scopies\sof\ssome\scommon\scode\sshared\sby\sthe\sopfs\spieces\sinto\sa\spreprocessor\s#include. -D 2026-03-03T23:43:40.326 +C opfs-wl\sis\snow\sloading\sand\sregistering\sbut\sit's\sstill\suntested. +D 2026-03-04T00:37:55.997 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -572,7 +572,7 @@ F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009e F ext/session/sqlite3session.c 6ebd02be470f36d41c4bd78927f39d507b62051ba025eacaed9936c769902a07 F ext/session/sqlite3session.h 7404723606074fcb2afdc6b72c206072cdb2b7d8ba097ca1559174a80bc26f7a F ext/session/test_session.c 190110e3bd9463717248dec1272b44fe9943e57b7646d0b4200dcf11e4dccee6 -F ext/wasm/GNUmakefile a64605e68d4561f440bdc538e01364210f75052469d6ea21bf2843f1539144e9 +F ext/wasm/GNUmakefile a0afdb3e6306997de1e123e8b8270affb744519c9e384dbc277d0af6a6ba1c91 F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a F ext/wasm/README.md 2e87804e12c98f1d194b7a06162a88441d33bb443efcfe00dc6565a780d2f259 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -593,12 +593,12 @@ F ext/wasm/api/sqlite3-api-oo1.c-pp.js 45454631265d9ce82685f1a64e1650ee19c8e121c F ext/wasm/api/sqlite3-api-prologue.js ccd8ece4b4580d2a70996218f28e810d70a86f5e2795f4d4a75f0603af24aef6 F ext/wasm/api/sqlite3-api-worker1.c-pp.js 1041dd645e8e821c082b628cd8d9acf70c667430f9d45167569633ffc7567938 F ext/wasm/api/sqlite3-license-version-header.js 98d90255a12d02214db634e041c8e7f2f133d9361a8ebf000ba9c9af4c6761cc -F ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js 0ec326d4c66c7af5a4c79a1be65c07c1e1844e641f133ba026a4a01eb1a37c56 w ext/wasm/api/sqlite3-opfs-async-proxy.js +F ext/wasm/api/sqlite3-opfs-async-proxy.c-pp.js 041f24cd61d470072303b0cd1bb73dd2928bf2c96c0fbf3d3f4a39024c4e9ae7 F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d F ext/wasm/api/sqlite3-vfs-kvvfs.c-pp.js 2ccf4322f42063aefc150972943e750c77f7926b866f1639d40eec05df075b6e F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 1575ea6bbcf2da1e6df6892c17521a0c1c1c199a672e9090176ea0b88de48bd9 -F ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js 1abe919013d759b311e7e3f5c4a326f9027b1b6a0fbe89db5f303e2ff109d5d4 -F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js ab2a73f41a2e109f25fd3159531e801ca14c782c297b2fc1836e6a02b795321b +F ext/wasm/api/sqlite3-vfs-opfs-wl.c-pp.js 072abf5bd30e5a611f9d15039bb41795fb517b5ade1b1973cbdd70c171a1f822 +F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e44649cf72b303b857ce4d7e33b13b88a1f97009514b1b84d2e9c2ecf511fca1 F ext/wasm/api/sqlite3-vtab-helper.c-pp.js 366596d8ff73d4cefb938bbe95bc839d503c3fab6c8335ce4bf52f0d8a7dee81 F ext/wasm/api/sqlite3-wasm.c 45bb20e19b245136711f9b78584371233975811b6560c29ed9b650e225417e29 F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js aa9715f661fb700459a5a6cb1c32a4d6a770723b47aa9ac0e16c2cf87d622a66 @@ -2190,8 +2190,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c -P 5910ed7ac843aa1fdb103ddcfaf6270d12cb39199205fc0b9f721fbf7fa2f851 -R d999a6bf319e44a9103bde13f0ab87af +P 1e0b72631aecb0bb72f4089116da221e6c4abf962db589de08132cd52c2be0e2 +R 32d905549a7b0f1874fdf6ef84b0e8af U stephan -Z 097c558a7425489e055f6ff0be38c909 +Z 466cb2ea030b3f6732fe2aeb3d4128c0 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9be206dbe2..558d2665e6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1e0b72631aecb0bb72f4089116da221e6c4abf962db589de08132cd52c2be0e2 +9a471f7491a371052bf1785098ba966dd0d03503e7d8b9fbcd65f07b038e5021