mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Minor build cleanups and fix a harmless race condition in the OPFS part of tester1.js.
FossilOrigin-Name: 70ee6ee014bc4e2c1daa9b4a8909cf76ccecf32de1eb39055f20d3d0b1daa1bd
This commit is contained in:
@ -568,12 +568,14 @@ oz: clean
|
|||||||
|
|
||||||
include fiddle.make
|
include fiddle.make
|
||||||
|
|
||||||
ifneq (,$(filter wasmfs,$(MAKECMDGOALS)))
|
# Only add wasmfs if wasmfs.enable=1 or we're running (dist)clean
|
||||||
# wasmfs build disabled 2022-10-19 per /chat
|
wasmfs.enable ?= $(if $(filter %clean,$(MAKECMDGOALS)),1,0)
|
||||||
# discussion. OPFS-over-wasmfs was initially a stopgap measure and a
|
ifeq (1,$(wasmfs.enable))
|
||||||
# convenient point of comparison for the OPFS sqlite3_vfs's
|
# wasmfs build disabled 2022-10-19 per /chat discussion.
|
||||||
# performance, but it currently doubles our deliverables and build
|
# OPFS-over-wasmfs was initially a stopgap measure and a convenient
|
||||||
# maintenance burden for very little, if any, benefit.
|
# point of comparison for the OPFS sqlite3_vfs's performance, but it
|
||||||
|
# currently doubles our deliverables and build maintenance burden for
|
||||||
|
# little, if any, benefit.
|
||||||
#
|
#
|
||||||
########################################################################
|
########################################################################
|
||||||
# Some platforms do not support the WASMFS build. Raspberry Pi OS is one
|
# Some platforms do not support the WASMFS build. Raspberry Pi OS is one
|
||||||
|
@ -15,9 +15,11 @@
|
|||||||
#define SQLITE_WASM
|
#define SQLITE_WASM
|
||||||
#ifdef SQLITE_WASM_ENABLE_C_TESTS
|
#ifdef SQLITE_WASM_ENABLE_C_TESTS
|
||||||
/*
|
/*
|
||||||
** Functions blocked off by SQLITE_WASM_TESTS are intended solely for
|
** Code blocked off by SQLITE_WASM_TESTS is intended solely for use in
|
||||||
** use in unit/regression testing. They may be safely omitted from
|
** unit/regression testing. They may be safely omitted from
|
||||||
** client-side builds.
|
** client-side builds. The main unit test script, tester1.js, will
|
||||||
|
** skip related tests if it doesn't find the corresponding functions
|
||||||
|
** in the WASM exports.
|
||||||
*/
|
*/
|
||||||
# define SQLITE_WASM_TESTS 1
|
# define SQLITE_WASM_TESTS 1
|
||||||
#else
|
#else
|
||||||
@ -1026,7 +1028,7 @@ int sqlite3_wasm_vfs_create_file( sqlite3_vfs *pVfs,
|
|||||||
pPos += n;
|
pPos += n;
|
||||||
}
|
}
|
||||||
if( 0==rc && nData>0 ){
|
if( 0==rc && nData>0 ){
|
||||||
assert(nData<512);
|
assert( nData<blockSize );
|
||||||
rc = pIo->xWrite(pFile, pPos, nData, (sqlite3_int64)(pPos - pData));
|
rc = pIo->xWrite(pFile, pPos, nData, (sqlite3_int64)(pPos - pData));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1072,7 +1074,7 @@ sqlite3_kvvfs_methods * sqlite3_wasm_kvvfs_methods(void){
|
|||||||
return &sqlite3KvvfsMethods;
|
return &sqlite3KvvfsMethods;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__EMSCRIPTEN__) && defined(SQLITE_WASM_WASMFS)
|
#if defined(__EMSCRIPTEN__) && defined(SQLITE_ENABLE_WASMFS)
|
||||||
#include <emscripten/wasmfs.h>
|
#include <emscripten/wasmfs.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1093,7 +1095,7 @@ sqlite3_kvvfs_methods * sqlite3_wasm_kvvfs_methods(void){
|
|||||||
**
|
**
|
||||||
** Returns 0 on success, SQLITE_NOMEM if instantiation of the backend
|
** Returns 0 on success, SQLITE_NOMEM if instantiation of the backend
|
||||||
** object fails, SQLITE_IOERR if mkdir() of the zMountPoint dir in
|
** object fails, SQLITE_IOERR if mkdir() of the zMountPoint dir in
|
||||||
** the virtual FS fails. In builds compiled without SQLITE_WASM_WASMFS
|
** the virtual FS fails. In builds compiled without SQLITE_ENABLE_WASMFS
|
||||||
** defined, SQLITE_NOTFOUND is returned without side effects.
|
** defined, SQLITE_NOTFOUND is returned without side effects.
|
||||||
*/
|
*/
|
||||||
SQLITE_WASM_KEEP
|
SQLITE_WASM_KEEP
|
||||||
@ -1102,9 +1104,6 @@ int sqlite3_wasm_init_wasmfs(const char *zMountPoint){
|
|||||||
if( !zMountPoint || !*zMountPoint ) zMountPoint = "/opfs";
|
if( !zMountPoint || !*zMountPoint ) zMountPoint = "/opfs";
|
||||||
if( !pOpfs ){
|
if( !pOpfs ){
|
||||||
pOpfs = wasmfs_create_opfs_backend();
|
pOpfs = wasmfs_create_opfs_backend();
|
||||||
if( pOpfs ){
|
|
||||||
emscripten_console_log("Created WASMFS OPFS backend.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/** It's not enough to instantiate the backend. We have to create a
|
/** It's not enough to instantiate the backend. We have to create a
|
||||||
mountpoint in the VFS and attach the backend to it. */
|
mountpoint in the VFS and attach the backend to it. */
|
||||||
@ -1128,7 +1127,7 @@ int sqlite3_wasm_init_wasmfs(const char *zUnused){
|
|||||||
if(zUnused){/*unused*/}
|
if(zUnused){/*unused*/}
|
||||||
return SQLITE_NOTFOUND;
|
return SQLITE_NOTFOUND;
|
||||||
}
|
}
|
||||||
#endif /* __EMSCRIPTEN__ && SQLITE_WASM_WASMFS */
|
#endif /* __EMSCRIPTEN__ && SQLITE_ENABLE_WASMFS */
|
||||||
|
|
||||||
#if SQLITE_WASM_TESTS
|
#if SQLITE_WASM_TESTS
|
||||||
|
|
||||||
|
@ -1782,7 +1782,7 @@
|
|||||||
sh = await fh.createSyncAccessHandle();
|
sh = await fh.createSyncAccessHandle();
|
||||||
T.assert(fSize === await sh.getSize());
|
T.assert(fSize === await sh.getSize());
|
||||||
}finally{
|
}finally{
|
||||||
if(sh) sh.close();
|
if(sh) await sh.close();
|
||||||
unlink();
|
unlink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ sqlite3-wasmfs.cflags :=
|
|||||||
sqlite3-wasmfs.cflags += -std=c99 -fPIC
|
sqlite3-wasmfs.cflags += -std=c99 -fPIC
|
||||||
sqlite3-wasmfs.cflags += -pthread
|
sqlite3-wasmfs.cflags += -pthread
|
||||||
sqlite3-wasmfs.cflags += $(cflags.common)
|
sqlite3-wasmfs.cflags += $(cflags.common)
|
||||||
sqlite3-wasmfs.cflags += $(SQLITE_OPT) -DSQLITE_WASM_WASMFS
|
sqlite3-wasmfs.cflags += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# emcc flags specific to building the final .js/.wasm file...
|
# emcc flags specific to building the final .js/.wasm file...
|
||||||
@ -88,7 +88,7 @@ all: wasmfs
|
|||||||
speedtest1-wasmfs.js := $(dir.wasmfs)/speedtest1-wasmfs.js
|
speedtest1-wasmfs.js := $(dir.wasmfs)/speedtest1-wasmfs.js
|
||||||
speedtest1-wasmfs.wasm := $(subst .js,.wasm,$(speedtest1-wasmfs.js))
|
speedtest1-wasmfs.wasm := $(subst .js,.wasm,$(speedtest1-wasmfs.js))
|
||||||
speedtest1-wasmfs.eflags := $(sqlite3-wasmfs.fsflags)
|
speedtest1-wasmfs.eflags := $(sqlite3-wasmfs.fsflags)
|
||||||
speedtest1-wasmfs.eflags += $(SQLITE_OPT) -DSQLITE_WASM_WASMFS
|
speedtest1-wasmfs.eflags += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
|
||||||
speedtest1-wasmfs.eflags += -sALLOW_MEMORY_GROWTH=0
|
speedtest1-wasmfs.eflags += -sALLOW_MEMORY_GROWTH=0
|
||||||
speedtest1-wasmfs.eflags += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
|
speedtest1-wasmfs.eflags += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
|
||||||
$(eval $(call call-make-pre-js,speedtest1-wasmfs))
|
$(eval $(call call-make-pre-js,speedtest1-wasmfs))
|
||||||
|
20
manifest
20
manifest
@ -1,5 +1,5 @@
|
|||||||
C Clarify\sdocumentation\sregarding\sthe\s--recovery-db\soption\sto\s".recover"\sand\nthe\smagic\s789\sconfiguration\soption\sit\sis\sassociated\swith.
|
C Minor\sbuild\scleanups\sand\sfix\sa\sharmless\srace\scondition\sin\sthe\sOPFS\spart\sof\stester1.js.
|
||||||
D 2022-11-02T14:08:26.051
|
D 2022-11-02T14:08:59.340
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@ -487,7 +487,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
|
|||||||
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
|
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
|
||||||
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
||||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
||||||
F ext/wasm/GNUmakefile 49dbcffa0195d47b89b61f52795f7ed3af97ad0e1f765ff20be16d3e63e6f52b
|
F ext/wasm/GNUmakefile 78b64d110e66e18709c11437a74c29bc7855d85a713217db99127c7f304a332f
|
||||||
F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
|
F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
|
||||||
F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
|
F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
|
||||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 9120c2f8f51fa85f46dcf4dcb6b12f4a807d428f6089b99cdb08d8ddfcfd88b2
|
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 9120c2f8f51fa85f46dcf4dcb6b12f4a807d428f6089b99cdb08d8ddfcfd88b2
|
||||||
@ -507,7 +507,7 @@ F ext/wasm/api/sqlite3-api-worker1.js cac2f5c63f950f69b5249c9880d4cd385e914c354c
|
|||||||
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
|
F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
|
||||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 936f57737eb65afc0f4c3494b93f7b02208055226a7b3cb58f551c38b03ab083
|
F ext/wasm/api/sqlite3-opfs-async-proxy.js 936f57737eb65afc0f4c3494b93f7b02208055226a7b3cb58f551c38b03ab083
|
||||||
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
|
F ext/wasm/api/sqlite3-wasi.h 25356084cfe0d40458a902afb465df8c21fc4152c1d0a59b563a3fba59a068f9
|
||||||
F ext/wasm/api/sqlite3-wasm.c 41f4c807d5e027d5dd61d507cb0a78d0cee5618220e100860ff4c45ed1bd7c78
|
F ext/wasm/api/sqlite3-wasm.c af472ec27bc7a398a2b94329cb7a77f3411109fc17529a289fa10cc55424ece1
|
||||||
F ext/wasm/api/sqlite3-worker1-promiser.js 0c7a9826dbf82a5ed4e4f7bf7816e825a52aff253afbf3350431f5773faf0e4b
|
F ext/wasm/api/sqlite3-worker1-promiser.js 0c7a9826dbf82a5ed4e4f7bf7816e825a52aff253afbf3350431f5773faf0e4b
|
||||||
F ext/wasm/api/sqlite3-worker1.js 1e54ea3d540161bcfb2100368a2fc0cad871a207b8336afee1c445715851ec54
|
F ext/wasm/api/sqlite3-worker1.js 1e54ea3d540161bcfb2100368a2fc0cad871a207b8336afee1c445715851ec54
|
||||||
F ext/wasm/batch-runner.html 4deeed44fe41496dc6898d9fb17938ea3291f40f4bfb977e29d0cef96fbbe4c8
|
F ext/wasm/batch-runner.html 4deeed44fe41496dc6898d9fb17938ea3291f40f4bfb977e29d0cef96fbbe4c8
|
||||||
@ -549,9 +549,9 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555
|
|||||||
F ext/wasm/test-opfs-vfs.js 44363db07b2a20e73b0eb1808de4400ca71b703af718d0fa6d962f15e73bf2ac
|
F ext/wasm/test-opfs-vfs.js 44363db07b2a20e73b0eb1808de4400ca71b703af718d0fa6d962f15e73bf2ac
|
||||||
F ext/wasm/tester1-worker.html 51bf39e2b87f974ae3d5bc3086e2fb36d258f3698c54f6e21ba4b3b99636fa27
|
F ext/wasm/tester1-worker.html 51bf39e2b87f974ae3d5bc3086e2fb36d258f3698c54f6e21ba4b3b99636fa27
|
||||||
F ext/wasm/tester1.html 624ec41cd9f78a1f2b6d7df70aaa7a6394396b1f2455ecbd6de5775c1275b121
|
F ext/wasm/tester1.html 624ec41cd9f78a1f2b6d7df70aaa7a6394396b1f2455ecbd6de5775c1275b121
|
||||||
F ext/wasm/tester1.js db50ca105d683d1089f540dae4c2baf89a3c101704a05f22cefdcb517587ae8c
|
F ext/wasm/tester1.js 3a5558201359ff8a1c3051ab24fcc8bed5a4e99ae5e086e5184cbfc915d08724
|
||||||
F ext/wasm/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd72273503ae7d5
|
F ext/wasm/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd72273503ae7d5
|
||||||
F ext/wasm/wasmfs.make fb2d3c4a298b12cf1ec994ad1d0f1d027ae297449b364cde43d2eb807d68048f
|
F ext/wasm/wasmfs.make edfd60691d10fd19ada4c061280fd7fbe4cf5f6bf6b913268e8ebedfccea6ab5
|
||||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||||
@ -2054,8 +2054,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P ed1c3515ad6a988e07a8b4583fbc38be257e6eae7443b01a242b98207ce78162
|
P f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498
|
||||||
R 61e877321a6044c9940b1e7ec483318d
|
R 49cc6fc37416a3ba7fdfd0b20ce15895
|
||||||
U drh
|
U stephan
|
||||||
Z c1f74c9b622ab0020ca49c89b60463b4
|
Z b66cc4ccdf23cf485ede2fda7e429a86
|
||||||
# Remove this line to create a well-formed Fossil manifest.
|
# Remove this line to create a well-formed Fossil manifest.
|
||||||
|
@ -1 +1 @@
|
|||||||
f6fa0cffa921ccde8910e7fa4a63c2e4ef8ddb376c8ce99e436b27ac332c4498
|
70ee6ee014bc4e2c1daa9b4a8909cf76ccecf32de1eb39055f20d3d0b1daa1bd
|
Reference in New Issue
Block a user