From: stephan Date: Tue, 25 Nov 2025 15:35:53 +0000 (+0000) Subject: In wasm builds, #if out the impls for the 3 core kvvfs i/o routines which get overwri... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63538027c7615ae656a8490c372b3c866b016d3;p=thirdparty%2Fsqlite.git In wasm builds, #if out the impls for the 3 core kvvfs i/o routines which get overwritten from JS (and thus aren't used) to reduce dependencies on POSIX APIs. FossilOrigin-Name: ac8af73c16ab821a7aa7d28a5fde8aeba0bc4d03c0af0dd2cff288c8fdabc49e --- diff --git a/manifest b/manifest index 7e2ad3f333..89dd4fa567 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C kvvfs\sinternal\scleanups.\sExperimentally\sadd\sasync\sevent\slisteners\sto\skvvfs\sto\sexplore\sbacking\sup\sa\skvvfs\sa\spage\sat\sa\stime. -D 2025-11-25T05:44:03.837 +C In\swasm\sbuilds,\s#if\sout\sthe\simpls\sfor\sthe\s3\score\skvvfs\si/o\sroutines\swhich\sget\soverwritten\sfrom\sJS\s(and\sthus\saren't\sused)\sto\sreduce\sdependencies\son\sPOSIX\sAPIs. +D 2025-11-25T15:35:53.299 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -717,7 +717,7 @@ F src/notify.c 57c2d1a2805d6dee32acd5d250d928ab94e02d76369ae057dee7d445fd64e878 F src/os.c 509452169d5ea739723e213b8e2481cf0e587f0e88579a912d200db5269f5f6d F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63 F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06 -F src/os_kv.c d4f6c56d8933010df6a436db973a0888d62ae88aefcbe3091a378adcf208a356 +F src/os_kv.c e12a9a0c12292ed8a4e06ee71368dcc515122b995ac1d1860212750df3abb285 F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2 F src/os_unix.c 7945ede1e85b2d1b910e1b4af9ba342e964b1e30e79f4176480a60736445cb36 F src/os_win.c a89b501fc195085c7d6c9eec7f5bd782625e94bb2a96b000f4d009703df1083f @@ -2178,8 +2178,8 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P be435b668f1aee56fc4965592c207de25283de238fe89002f1a68ba0567aca65 -R a40d02997945aa1084905b681811107d +P f355fd484947a645206c9b9c2fd6fe691455dece7fb1aa5b72cb51a86b39474f +R 93d4eb5b59489ea4dc2e925508b24b87 U stephan -Z 28f21285f9b3750dac51a6c728b3cdad +Z b720bd0cbd461c9ff070c111739d050c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 79e5fb3f7b..70d4b76591 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f355fd484947a645206c9b9c2fd6fe691455dece7fb1aa5b72cb51a86b39474f +ac8af73c16ab821a7aa7d28a5fde8aeba0bc4d03c0af0dd2cff288c8fdabc49e diff --git a/src/os_kv.c b/src/os_kv.c index 4a4a486d38..dfaaea1cf0 100644 --- a/src/os_kv.c +++ b/src/os_kv.c @@ -223,6 +223,7 @@ static int kvrecordWrite( const char *zKey, const char *zData ){ +#ifndef SQLITE_WASM FILE *fd; char zXKey[KVRECORD_KEY_SZ]; kvrecordMakeKey(zClass, zKey, zXKey); @@ -237,6 +238,15 @@ static int kvrecordWrite( }else{ return 1; } +#else + /* block the above out to reduce the WASM side's dependency + on POSIX I/O APIS. */ + UNUSED_PARAMETER(zClass); + UNUSED_PARAMETER(zKey); + UNUSED_PARAMETER(zData); + assert(!"overwritten by JS"); + return SQLITE_ERROR; +#endif } /* Delete a key (with its corresponding data) from the key/value @@ -244,11 +254,20 @@ static int kvrecordWrite( ** this routine is a no-op. */ static int kvrecordDelete(const char *zClass, const char *zKey){ +#ifndef SQLITE_WASM char zXKey[KVRECORD_KEY_SZ]; kvrecordMakeKey(zClass, zKey, zXKey); unlink(zXKey); SQLITE_KV_TRACE(("KVVFS-DELETE %-15s\n", zXKey)); return 0; +#else + /* block the above out to reduce the WASM side's dependency + on POSIX I/O APIS. */ + UNUSED_PARAMETER(zClass); + UNUSED_PARAMETER(zKey); + assert(!"overwritten by JS"); + return SQLITE_ERROR; +#endif } /* Read the value associated with a zKey from the key/value namespace given @@ -272,6 +291,7 @@ static int kvrecordRead( char *zBuf, int nBuf ){ +#ifndef SQLITE_WASM FILE *fd; struct stat buf; char zXKey[KVRECORD_KEY_SZ]; @@ -306,6 +326,16 @@ static int kvrecordRead( n, zBuf, n>50 ? "..." : "")); return (int)n; } +#else + /* block the above out to reduce the WASM side's dependency + on POSIX I/O APIS. */ + UNUSED_PARAMETER(zClass); + UNUSED_PARAMETER(zKey); + UNUSED_PARAMETER(zBuf); + UNUSED_PARAMETER(nBuf); + assert(!"overwritten by JS"); + return SQLITE_ERROR; +#endif } /*