]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Update wasmfs.make to get WASMFS building again, but changes made to OPFS-over-WASMFS...
authorstephan <stephan@noemail.net>
Sat, 17 Dec 2022 11:14:35 +0000 (11:14 +0000)
committerstephan <stephan@noemail.net>
Sat, 17 Dec 2022 11:14:35 +0000 (11:14 +0000)
FossilOrigin-Name: 32dc98c8001387b1970623192ec6cb89445000fa49bda5f4bd7c525bbe20bb5b

ext/wasm/GNUmakefile
ext/wasm/api/sqlite3-api-prologue.js
ext/wasm/index.html
ext/wasm/speedtest1-wasmfs.html
ext/wasm/wasmfs.make
manifest
manifest.uuid

index 370ea681f954e01f9a77a287328919ddd77040b8..93c9a221c09c697484681c90400d90ccb5c95a60 100644 (file)
@@ -599,20 +599,26 @@ $(sqlite3.mjs): $(pre-post-sqlite3.deps.esm)
 # Upstream RFE:
 # https://github.com/emscripten-core/emscripten/issues/18237
 ########################################################################
+# SQLITE3.xJS.EXPORT-DEFAULT is part of SQLITE3[-WASMFS].xJS.RECIPE,
+# factored into a separate piece to avoid code duplication. $1 is
+# the build mode: one of (vanilla, esm).
+define SQLITE3.xJS.ESM-EXPORT-DEFAULT
+if [ esm = $(1) ]; then \
+               echo "Fragile workaround for an Emscripten annoyance. See SQLITE3.xJS.RECIPE."; \
+               sed -i -e '0,/^export default/{/^export default/d}' $@ || exit $$?; \
+               if ! grep -q '^export default' $@; then \
+                       echo "Cannot find export default." 1>&2; \
+                       exit 1; \
+               fi; \
+fi
+endef
 define SQLITE3.xJS.RECIPE
        @echo "Building $@ ..."
        $(emcc.bin) -o $@ $(emcc_opt_full) $(emcc.flags) \
     $(emcc.jsflags) \
     $(pre-post-sqlite3.flags.$(1)) $(emcc.flags.sqlite3.$(1)) \
     $(cflags.common) $(SQLITE_OPT) $(sqlite3-wasm.c)
-       @if [ esm = $(1) ]; then \
-               echo "Fragile workaround for an Emscripten annoyance. See emcc.flags.sqlite3.esm."; \
-               sed -i -e '0,/^export default/{/^export default/d}' $@ || exit $$?; \
-               if ! grep -q '^export default' $@; then \
-                       echo "Cannot find export default." 1>&2; \
-                       exit 1; \
-               fi; \
-       fi
+       @$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,$(1))
        chmod -x $(sqlite3.wasm)
        $(maybe-wasm-strip) $(sqlite3.wasm)
        @ls -la $@ $(sqlite3.wasm)
@@ -665,29 +671,29 @@ all: batch
 ########################################################################
 # Wasmified speedtest1 is our primary benchmarking tool.
 #
-# speedtest1.eflags.common = emcc flags used by multiple builds of speedtest1
-# speedtest1.eflags = emcc flags used by main build of speedtest1
-speedtest1.eflags.common := $(emcc_opt_full)
-speedtest1.eflags :=
-speedtest1.eflags += -sENVIRONMENT=web
-speedtest1.eflags += -sALLOW_MEMORY_GROWTH
-speedtest1.eflags += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.$(emcc.INITIAL_MEMORY))
-speedtest1.eflags.common += -sINVOKE_RUN=0
-speedtest1.eflags.common += --no-entry
-#speedtest1.eflags.common += -flto
-speedtest1.eflags.common += -sABORTING_MALLOC
-speedtest1.eflags.common += -sSTRICT_JS
-speedtest1.eflags.common += -sMODULARIZE
-speedtest1.eflags.common += -Wno-limited-postlink-optimizations
+# emcc.speedtest1.common = emcc flags used by multiple builds of speedtest1
+# emcc.speedtest1 = emcc flags used by main build of speedtest1
+emcc.speedtest1.common := $(emcc_opt_full)
+emcc.speedtest1 :=
+emcc.speedtest1 += -sENVIRONMENT=web
+emcc.speedtest1 += -sALLOW_MEMORY_GROWTH
+emcc.speedtest1 += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.$(emcc.INITIAL_MEMORY))
+emcc.speedtest1.common += -sINVOKE_RUN=0
+emcc.speedtest1.common += --no-entry
+#emcc.speedtest1.common += -flto
+emcc.speedtest1.common += -sABORTING_MALLOC
+emcc.speedtest1.common += -sSTRICT_JS
+emcc.speedtest1.common += -sMODULARIZE
+emcc.speedtest1.common += -Wno-limited-postlink-optimizations
 EXPORTED_FUNCTIONS.speedtest1 := $(abspath $(dir.tmp)/EXPORTED_FUNCTIONS.speedtest1)
-speedtest1.eflags.common += -sSTACK_SIZE=512KB
-speedtest1.eflags.common += -sEXPORTED_FUNCTIONS=@$(EXPORTED_FUNCTIONS.speedtest1)
-speedtest1.eflags.common += $(emcc.exportedRuntimeMethods)
-speedtest1.eflags.common += -sALLOW_TABLE_GROWTH
-speedtest1.eflags.common += -sDYNAMIC_EXECUTION=0
-speedtest1.eflags.common += --minify 0
-speedtest1.eflags.common += -sEXPORT_NAME=$(sqlite3.js.init-func)
-speedtest1.eflags.common += -sWASM_BIGINT=$(emcc.WASM_BIGINT)
+emcc.speedtest1.common += -sSTACK_SIZE=512KB
+emcc.speedtest1.common += -sEXPORTED_FUNCTIONS=@$(EXPORTED_FUNCTIONS.speedtest1)
+emcc.speedtest1.common += $(emcc.exportedRuntimeMethods)
+emcc.speedtest1.common += -sALLOW_TABLE_GROWTH
+emcc.speedtest1.common += -sDYNAMIC_EXECUTION=0
+emcc.speedtest1.common += --minify 0
+emcc.speedtest1.common += -sEXPORT_NAME=$(sqlite3.js.init-func)
+emcc.speedtest1.common += -sWASM_BIGINT=$(emcc.WASM_BIGINT)
 speedtest1.exit-runtime0 := -sEXIT_RUNTIME=0
 speedtest1.exit-runtime1 := -sEXIT_RUNTIME=1
 # Re -sEXIT_RUNTIME=1 vs 0: if it's 1 and speedtest1 crashes, we get
@@ -712,7 +718,7 @@ $(EXPORTED_FUNCTIONS.speedtest1): $(EXPORTED_FUNCTIONS.api)
        @{ echo _wasm_main; cat $(EXPORTED_FUNCTIONS.api); } > $@
 speedtest1.js := $(dir.dout)/speedtest1.js
 speedtest1.wasm := $(dir.dout)/speedtest1.wasm
-speedtest1.cflags := $(cflags.common) -DSQLITE_SPEEDTEST1_WASM
+cflags.speedtest1 := $(cflags.common) -DSQLITE_SPEEDTEST1_WASM
 speedtest1.cses := $(speedtest1.c) $(sqlite3-wasm.c)
 $(eval $(call call-make-pre-js,speedtest1,vanilla))
 $(speedtest1.js): $(MAKEFILE) $(speedtest1.cses) \
@@ -720,8 +726,8 @@ $(speedtest1.js): $(MAKEFILE) $(speedtest1.cses) \
     $(EXPORTED_FUNCTIONS.speedtest1)
        @echo "Building $@ ..."
        $(emcc.bin) \
-        $(speedtest1.eflags) $(speedtest1.eflags.common) \
-        $(speedtest1.cflags) $(pre-post-speedtest1.flags.vanilla) \
+        $(emcc.speedtest1) $(emcc.speedtest1.common) \
+        $(cflags.speedtest1) $(pre-post-speedtest1.flags.vanilla) \
         $(SQLITE_OPT) \
         $(speedtest1.exit-runtime0) \
         -o $@ $(speedtest1.cses) -lm
index ef0885cb94bb29935800631eff2fb921d3009b7f..94514e47700beb415fec8335ebdb728689e9e15a 100644 (file)
      the `realloc(3)`-compatible routine for the WASM
      environment. Defaults to `"sqlite3_realloc"`.
 
-   - `wasmfsOpfsDir`[^1]: if the environment supports persistent
-     storage using OPFS-over-WASMFS , this directory names the "mount
-     point" for that directory. It must be prefixed by `/` and may
-     contain only a single directory-name part. Using the root
-     directory name is not supported by any current persistent
-     backend.  This setting is only used in WASMFS-enabled builds.
-
+   - `wasmfsOpfsDir`[^1]: As of 2022-12-17, this feature does not
+     currently work due to incompatible Emscripten-side changes made
+     in the WASMFS+OPFS combination. This option is currently ignored.
 
    [^1] = This property may optionally be a function, in which case this
           function re-assigns it to the value returned from that function,
@@ -138,6 +134,10 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
       config[k] = config[k]();
     }
   });
+  config.wasmOpfsDir =
+    /* 2022-12-17: WASMFS+OPFS can no longer be activated from the
+       main thread (aborts via a failed assert() if it's attempted),
+       which eliminates any(?) benefit to supporting it. */  false;
 
   /** 
       The main sqlite3 binding API gets installed into this object,
@@ -1050,6 +1050,13 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
   /** State for sqlite3_wasmfs_opfs_dir(). */
   let __wasmfsOpfsDir = undefined;
   /**
+     2022-12-17: incompatible WASMFS changes have made WASMFS+OPFS
+     unavailable from the main thread, which eliminates the most
+     significant benefit of supporting WASMFS. This function is now a
+     no-op which always returns a falsy value. Before that change,
+     this function behaved as documented below (and how it will again
+     if we can find a compelling reason to support it).
+
      If the wasm environment has a WASMFS/OPFS-backed persistent
      storage directory, its path is returned by this function. If it
      does not then it returns "" (noting that "" is a falsy value).
@@ -1066,6 +1073,8 @@ self.sqlite3ApiBootstrap = function sqlite3ApiBootstrap(
     if(undefined !== __wasmfsOpfsDir) return __wasmfsOpfsDir;
     // If we have no OPFS, there is no persistent dir
     const pdir = config.wasmfsOpfsDir;
+    console.error("sqlite3_wasmfs_opfs_dir() can no longer work due "+
+                  "to incompatible WASMFS changes. It will be removed.");
     if(!pdir
        || !self.FileSystemHandle
        || !self.FileSystemDirectoryHandle
index a547ce50fa456952e38ba4a47eb4aeaa6c9267e2..767cc5e74aa15d5908e2f2970906078524af86fd 100644 (file)
@@ -86,8 +86,6 @@
         <li>speedtest1 ports (sqlite3's primary benchmarking tool)...
           <ul>
             <li><a href='speedtest1.html'>speedtest1</a>: a main-thread WASM build of speedtest1.</li>
-            <!--li><a href='speedtest1-wasmfs.html?flags=--size,25'>speedtest1-wasmfs</a>: a variant of speedtest1 built solely for the wasmfs/opfs feature.
-                </li-->
             <li><a href='speedtest1.html?vfs=kvvfs'>speedtest1?vfs=kvvfs</a>: speedtest1 with the kvvfs.</li>
             <li><a href='speedtest1-worker.html?size=25'>speedtest1-worker</a>: an interactive Worker-thread variant of speedtest1.</li>
             <li><a href='speedtest1-worker.html?vfs=opfs&size=25'>speedtest1-worker?vfs=opfs</a>: speedtest1-worker with the
               a high-level overview of the symbols exposed by the JS
               module.</li>
             <li><a href='batch-runner.html'>batch-runner</a>: runs batches of SQL exported from speedtest1.</li>
-            <!--li><a href='scratchpad-wasmfs-main.html'>scratchpad-wasmfs-main</a>:
-              experimenting with WASMFS/OPFS-based persistence. Maintenance
-              reminder: we cannot currently (2022-09-15) load WASMFS in a
-              worker due to an Emscripten limitation.</li-->
             <li><a href='test-opfs-vfs.html'>test-opfs-vfs</a>
               (<a href='test-opfs-vfs.html?opfs-sanity-check&opfs-verbose'>same
               with verbose output and sanity-checking tests</a>) is an
             </li>
           </ul>
         </li>
+        <!--li>WASMFS-specific tests which currently do not work due to incompatible changes
+          made to the WASMFS+OPFS combination.
+          <ul>
+            <li><a href='speedtest1-wasmfs.html?flags=--size,25'>speedtest1-wasmfs</a>:
+              a variant of speedtest1 built solely for the wasmfs/opfs
+              feature.</li>
+            <li><a href='scratchpad-wasmfs-main.html'>scratchpad-wasmfs-main</a>:
+              experimenting with WASMFS/OPFS-based persistence. Maintenance
+              reminder: we cannot currently (2022-09-15) load WASMFS in a
+              worker due to an Emscripten wasm loader limitation.</li>
+          </ul>
+        </li-->
         <!--li><a href='x.html'></a></li-->
       </ul>
     </div>
index e35546702e2070366993700f135d2b56dba6cbf5..4c4db32bca1372b245a66f5478225948144567ed 100644 (file)
@@ -92,8 +92,9 @@
 
     const runTests = function(sqlite3){
         console.log("Module inited.");
-        const wasm = sqlite3.capi.wasm;
-        const unlink = wasm.xWrap("sqlite3_wasm_vfs_unlink", "int", ["string"]);
+        const wasm = sqlite3.wasm;
+        const __unlink = wasm.xWrap("sqlite3_wasm_vfs_unlink", "int", ["*","string"]);
+        const unlink = (fn)=>__unlink(0,fn);
         const pDir = wasmfsDir(wasm);
         if(pDir) log2('',"Persistent storage:",pDir);
         else{
index c64ce071e5cb80cda5541fe22e643540b3366ebb..020014f3e8c25a56ac0d4ad3b9510659971a484d 100644 (file)
@@ -15,101 +15,117 @@ MAKEFILE.wasmfs := $(lastword $(MAKEFILE_LIST))
 # Worker to an Emscripten quirk regarding loading nested Workers.
 dir.wasmfs := $(dir.wasm)
 sqlite3-wasmfs.js     := $(dir.wasmfs)/sqlite3-wasmfs.js
+sqlite3-wasmfs.mjs    := $(dir.wasmfs)/sqlite3-wasmfs.mjs
 sqlite3-wasmfs.wasm   := $(dir.wasmfs)/sqlite3-wasmfs.wasm
 
 CLEAN_FILES += $(sqlite3-wasmfs.js) $(sqlite3-wasmfs.wasm) \
-    $(subst .js,.worker.js,$(sqlite3-wasmfs.js))
+    $(subst .js,.worker.js,$(sqlite3-wasmfs.js)) \
+    $(sqlite3-wasmfs.mjs) \
+    $(subst .mjs,.worker.mjs,$(sqlite3-wasmfs.mjs))
 
 ########################################################################
 # emcc flags for .c/.o.
-sqlite3-wasmfs.cflags :=
-sqlite3-wasmfs.cflags += -std=c99 -fPIC
-sqlite3-wasmfs.cflags += -pthread
-sqlite3-wasmfs.cflags += $(cflags.common)
-sqlite3-wasmfs.cflags += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
+cflags.sqlite3-wasmfs :=
+cflags.sqlite3-wasmfs += -std=c99 -fPIC
+cflags.sqlite3-wasmfs += -pthread
+cflags.sqlite3-wasmfs += $(cflags.speedtest1)
+cflags.sqlite3-wasmfs += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
 
 ########################################################################
 # emcc flags specific to building the final .js/.wasm file...
-sqlite3-wasmfs.jsflags := -fPIC
-sqlite3-wasmfs.jsflags += --no-entry
-sqlite3-wasmfs.jsflags += --minify 0
-sqlite3-wasmfs.jsflags += -sMODULARIZE
-sqlite3-wasmfs.jsflags += -sSTRICT_JS
-sqlite3-wasmfs.jsflags += -sDYNAMIC_EXECUTION=0
-sqlite3-wasmfs.jsflags += -sNO_POLYFILL
-sqlite3-wasmfs.jsflags += -sEXPORTED_FUNCTIONS=@$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-api)
-sqlite3-wasmfs.jsflags += -sEXPORTED_RUNTIME_METHODS=FS,wasmMemory,allocateUTF8OnStack
-                                            # wasmMemory ==> for -sIMPORTED_MEMORY
-                                            # allocateUTF8OnStack ==> wasmfs internals
-sqlite3-wasmfs.jsflags += -sUSE_CLOSURE_COMPILER=0
-sqlite3-wasmfs.jsflags += -sIMPORTED_MEMORY
-#sqlite3-wasmfs.jsflags += -sINITIAL_MEMORY=13107200
-sqlite3-wasmfs.jsflags += -sSTACK_SIZE=1MB
-sqlite3-wasmfs.jsflags += -sEXPORT_NAME=$(sqlite3.js.init-func)
-sqlite3-wasmfs.jsflags += -sGLOBAL_BASE=4096 # HYPOTHETICALLY keep func table indexes from overlapping w/ heap addr.
-#sqlite3-wasmfs.jsflags += -sFILESYSTEM=0 # only for experimentation. sqlite3 needs the FS API
-#                                Perhaps the wasmfs build doesn't?
-#sqlite3-wasmfs.jsflags += -sABORTING_MALLOC
-sqlite3-wasmfs.jsflags += -sALLOW_TABLE_GROWTH
-sqlite3-wasmfs.jsflags += -Wno-limited-postlink-optimizations
+emcc.flags.sqlite3-wasmfs := -fPIC
+emcc.flags.sqlite3-wasmfs += --no-entry
+emcc.flags.sqlite3-wasmfs += --minify 0
+emcc.flags.sqlite3-wasmfs += -sMODULARIZE
+emcc.flags.sqlite3-wasmfs += -sEXPORT_NAME=$(sqlite3.js.init-func)
+emcc.flags.sqlite3-wasmfs += -sSTRICT_JS
+emcc.flags.sqlite3-wasmfs += -sDYNAMIC_EXECUTION=0
+emcc.flags.sqlite3-wasmfs += -sNO_POLYFILL
+emcc.flags.sqlite3-wasmfs += -sWASM_BIGINT=$(emcc.WASM_BIGINT)
+emcc.flags.sqlite3-wasmfs += -sEXPORTED_FUNCTIONS=@$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-api)
+emcc.flags.sqlite3-wasmfs += -sEXPORTED_RUNTIME_METHODS=FS,wasmMemory,allocateUTF8OnStack
+                          # wasmMemory ==> for -sIMPORTED_MEMORY
+                          # allocateUTF8OnStack ==> wasmfs internals
+emcc.flags.sqlite3-wasmfs += -sUSE_CLOSURE_COMPILER=0
+emcc.flags.sqlite3-wasmfs += -Wno-limited-postlink-optimizations
 # ^^^^^ it likes to warn when we have "limited optimizations" via the -g3 flag.
-sqlite3-wasmfs.jsflags += -sERROR_ON_UNDEFINED_SYMBOLS=0
-sqlite3-wasmfs.jsflags += -sLLD_REPORT_UNDEFINED
-#sqlite3-wasmfs.jsflags += --import-undefined
-sqlite3-wasmfs.jsflags += -sMEMORY64=0
-sqlite3-wasmfs.jsflags += -sINITIAL_MEMORY=128450560
+emcc.flags.sqlite3-wasmfs += -sALLOW_TABLE_GROWTH
+emcc.flags.sqlite3-wasmfs += -sSTACK_SIZE=512KB
+emcc.flags.sqlite3-wasmfs += -sGLOBAL_BASE=4096 # HYPOTHETICALLY keep func table indexes from overlapping w/ heap addr.
+emcc.flags.sqlite3-wasmfs += -sMEMORY64=0
+emcc.flags.sqlite3-wasmfs += -sIMPORTED_MEMORY
+emcc.flags.sqlite3-wasmfs += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
 # ^^^^ 64MB is not enough for WASMFS/OPFS test runs using batch-runner.js
-sqlite3-wasmfs.fsflags := -pthread -sWASMFS -sPTHREAD_POOL_SIZE=2 -sENVIRONMENT=web,worker
-# -sPTHREAD_POOL_SIZE values of 2 or higher trigger that bug.
-sqlite3-wasmfs.jsflags += $(sqlite3-wasmfs.fsflags)
-#sqlite3-wasmfs.jsflags += -sALLOW_MEMORY_GROWTH
+sqlite3-wasmfs.fsflags := -pthread -sWASMFS \
+    -sPTHREAD_POOL_SIZE=2 -sENVIRONMENT=web,worker \
+    -sERROR_ON_UNDEFINED_SYMBOLS=0 -sLLD_REPORT_UNDEFINED 
+# ^^^^^ why undefined symbols are necessary for the wasmfs build is anyone's guess.
+emcc.flags.sqlite3-wasmfs += $(sqlite3-wasmfs.fsflags)
+#emcc.flags.sqlite3-wasmfs += -sALLOW_MEMORY_GROWTH
 #^^^ using ALLOW_MEMORY_GROWTH produces a warning from emcc:
 #   USE_PTHREADS + ALLOW_MEMORY_GROWTH may run non-wasm code slowly,
 #   see https://github.com/WebAssembly/design/issues/1271 [-Wpthreads-mem-growth]
-sqlite3-wasmfs.jsflags += -sWASM_BIGINT=$(emcc.WASM_BIGINT)
+# And, indeed, it runs slowly if memory is permitted to grow.
+emcc.flags.sqlite3-wasmfs.vanilla :=
+emcc.flags.sqlite3-wasmfs.esm := -sEXPORT_ES6 -sUSE_ES6_IMPORT_META
 $(eval $(call call-make-pre-js,sqlite3-wasmfs,vanilla))
-sqlite3-wasmfs.jsflags += \
+$(eval $(call call-make-pre-js,sqlite3-wasmfs,esm))
+Xemcc.flags.sqlite3-wasmfs.vanilla += \
   $(pre-post-common.flags.vanilla) \
   $(pre-post-sqlite3-wasmfs.flags.vanilla)
-$(sqlite3-wasmfs.js): $(sqlite3-wasm.c) \
-    $(EXPORTED_FUNCTIONS.api) $(MAKEFILE) $(MAKEFILE.wasmfs) \
-    $(pre-post-sqlite3-wasmfs.deps.vanilla)
+Xemcc.flags.sqlite3-wasmfs.esm += \
+  $(pre-post-common.flags.esm) \
+  $(pre-post-sqlite3-wasmfs.flags.esm)
+$(sqlite3-wasmfs.js) $(sqlite3-wasmfs.mjs): $(sqlite3-wasm.c) \
+    $(EXPORTED_FUNCTIONS.api) $(MAKEFILE) $(MAKEFILE.wasmfs)
+$(sqlite3-wasmfs.js): $(pre-post-sqlite3-wasmfs.deps.vanilla)
+$(sqlite3-wasmfs.mjs): $(pre-post-sqlite3-wasmfs.deps.esm)
+# SQLITE3-WASMFS.xJS.RECIPE is the wasmfs-specific counterpart
+# of SQLITE3.xJS.RECIPE from the main makefile.
+define SQLITE3-WASMFS.xJS.RECIPE
        @echo "Building $@ ..."
        $(emcc.bin) -o $@ $(emcc_opt_full) $(emcc.flags) \
-      $(sqlite3-wasmfs.cflags) $(sqlite3-wasmfs.jsflags) \
-      $(pre-post-sqlite3-wasm.flags.vanilla) \
+      $(cflags.sqlite3-wasmfs) \
+      $(emcc.flags.sqlite3-wasmfs) $(emcc.flags.sqlite3-wasmfs.$(1)) \
+      $(pre-post-sqlite3-wasmfs.flags.$(1)) \
      $(sqlite3-wasm.c)
+       @$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,$(1))
        chmod -x $(sqlite3-wasmfs.wasm)
        $(maybe-wasm-strip) $(sqlite3-wasmfs.wasm)
-       @ls -la $@ $(sqlite3-wasmfs.wasm)
+       @ls -la $(sqlite3-wasmfs.wasm) sqlite3-wasmfs*js
+endef
+$(sqlite3-wasmfs.js):
+       $(call SQLITE3-WASMFS.xJS.RECIPE,vanilla)
+$(sqlite3-wasmfs.mjs): $(sqlite3-wasmfs.js)
+       $(call SQLITE3-WASMFS.xJS.RECIPE,esm)
 $(sqlite3-wasmfs.wasm): $(sqlite3-wasmfs.js)
-wasmfs: $(sqlite3-wasmfs.js)
-all: wasmfs
+wasmfs: $(sqlite3-wasmfs.js) $(sqlite3-wasmfs.mjs)
+#all: wasmfs
 
 ########################################################################
 # speedtest1 for wasmfs.
 speedtest1-wasmfs.js := $(dir.wasmfs)/speedtest1-wasmfs.js
 speedtest1-wasmfs.wasm := $(subst .js,.wasm,$(speedtest1-wasmfs.js))
-speedtest1-wasmfs.eflags := $(sqlite3-wasmfs.fsflags)
-speedtest1-wasmfs.eflags += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
-speedtest1-wasmfs.eflags += -sALLOW_MEMORY_GROWTH=0
-speedtest1-wasmfs.eflags += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
-$(eval $(call call-make-pre-js,speedtest1-wasmfs))
+emcc.flags.speedtest1-wasmfs := $(sqlite3-wasmfs.fsflags)
+emcc.flags.speedtest1-wasmfs += $(SQLITE_OPT) -DSQLITE_ENABLE_WASMFS
+emcc.flags.speedtest1-wasmfs += -sALLOW_MEMORY_GROWTH=0
+emcc.flags.speedtest1-wasmfs += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
+#$(eval $(call call-make-pre-js,speedtest1-wasmfs,vanilla))
 $(speedtest1-wasmfs.js): $(speedtest1.cses) $(sqlite3-wasmfs.js) \
   $(MAKEFILE) $(MAKEFILE.wasmfs) \
-  $(pre-post-speedtest1-wasmfs.deps) \
+  $(pre-post-sqlite3-wasmfs.deps) \
   $(EXPORTED_FUNCTIONS.speedtest1)
        @echo "Building $@ ..."
        $(emcc.bin) \
-        $(speedtest1-wasmfs.eflags) $(speedtest1.eflags.common) \
-        $(pre-post-speedtest1-wasmfs.flags) \
-        $(speedtest1.cflags) \
-        $(sqlite3-wasmfs.cflags) \
+         $(emcc.speedtest1.common) $(emcc.flags.speedtest1-wasmfs) \
+        $(pre-post-sqlite3-wasmfs.flags.vanilla) \
+        $(cflags.sqlite3-wasmfs) \
         -o $@ $(speedtest1.cses) -lm
        $(maybe-wasm-strip) $(speedtest1-wasmfs.wasm)
        ls -la $@ $(speedtest1-wasmfs.wasm)
 
-speedtest1: $(speedtest1-wasmfs.js)
+#speedtest1: $(speedtest1-wasmfs.js)
+wasmfs: $(speedtest1-wasmfs.js)
 CLEAN_FILES += $(speedtest1-wasmfs.js) $(speedtest1-wasmfs.wasm) \
      $(subst .js,.worker.js,$(speedtest1-wasmfs.js))
 # end speedtest1.js
index 72d954fbaf2bfae25f0743e4f6f706cadc60fe83..9a47027581158f3481be44c3833c022cf351ad25 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Disallow\ssome\sof\sthe\squery\sinvariant\stests\son\sSQL\sstatements\sthat\scontain\na\sGROUP\sBY\ssince\soutput\sterms\sthat\sare\sno\scovered\sby\sthe\sGROUP\sBY\sare\nindeterminant.
-D 2022-12-16T18:32:07.078
+C Update\swasmfs.make\sto\sget\sWASMFS\sbuilding\sagain,\sbut\schanges\smade\sto\sOPFS-over-WASMFS\ssince\swe\slast\stested\sit\shave\smade\sit\sincompatible\swith\show\swe\sused\sit.\sIt\scan\snow\sonly\sbe\sused\sfrom\sworker\sthreads,\seliminating\sthe\sone\sbenefit\sit\shad\sover\sthe\ssqlite3_vfs\sOPFS\simplementation.\sRemove/amend\sreferences\sto\sWASMFS\sin\sthe\sdocs\sand\sremove\sall\sWASMFS-specific\stest\sapp\slinks\sfrom\sindex.html.
+D 2022-12-17T11:14:35.220
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -491,7 +491,7 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
 F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
 F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
 F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
-F ext/wasm/GNUmakefile 32e5d1929d3e4d7c5892208d8078453e57339af8f7e9be320cdf96b2d60c69ba
+F ext/wasm/GNUmakefile 5c3398af8bace9c5d1c0e2b1134d7f48e7e6a345b6d5000969e7fcd3855e8c32
 F ext/wasm/README-dist.txt 2d670b426fc7c613b90a7d2f2b05b433088fe65181abead970980f0a4a75ea20
 F ext/wasm/README.md ef39861aa21632fdbca0bdd469f78f0096f6449a720f3f39642594af503030e9
 F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-api 4c7788042196cecab32f87d8e4965c183fea59037603888059f244b1752babcc
@@ -505,7 +505,7 @@ F ext/wasm/api/pre-js.c-pp.js b88499dc303c21fc3f55f2c364a0f814f587b60a9578430388
 F ext/wasm/api/sqlite3-api-cleanup.js 680d5ccfff54459db136a49b2199d9f879c8405d9c99af1dda0cc5e7c29056f4
 F ext/wasm/api/sqlite3-api-glue.js 63daa4b9c36faa4c338a32a06eb142869b9ae4885a3e01aad473e1b45357089f
 F ext/wasm/api/sqlite3-api-oo1.js c0c4ccc269cccee657ffd03f094da7e270e1367b7928926b3730d543555a12a6
-F ext/wasm/api/sqlite3-api-prologue.js 86eb4488f2be85e68c23ebcfad0834c24b6075e1645c67890cc4163c462efac1
+F ext/wasm/api/sqlite3-api-prologue.js 1767dfcd94bb4fa9dd4bd9ff6327117783d3656faf1058dcc1369db320d871fc
 F ext/wasm/api/sqlite3-api-worker1.js e94ba98e44afccfa482874cd9acb325883ade50ed1f9f9526beb9de1711f182f
 F ext/wasm/api/sqlite3-license-version-header.js a661182fc93fc2cf212dfd0b987f8e138a3ac98f850b1112e29b5fbdaecc87c3
 F ext/wasm/api/sqlite3-opfs-async-proxy.js 7795b84b66a7a8dedc791340709b310bb497c3c72a80bef364fa2a58e2ddae3f
@@ -538,13 +538,13 @@ F ext/wasm/fiddle/fiddle-worker.js b4a0c8ab6c0983218543ca771c45f6075449f63a1dcf2
 F ext/wasm/fiddle/fiddle.js 974b995119ac443685d7d94d3b3c58c6a36540e9eb3fed7069d5653284071715
 F ext/wasm/fiddle/index.html 5daf54e8f3d7777cbb1ca4f93affe28858dbfff25841cb4ab81d694efed28ec2
 F ext/wasm/index-dist.html c806b6005145b71d64240606e9c6e0bf56878ee8829c66fe7486cebf34b0e6b1
-F ext/wasm/index.html f151b7c7b5cfdc066567d556acd168e769efd4e982286dc5f849a5ee69ecd0ff
+F ext/wasm/index.html cc8b174ff01be282b399e64b58bdf3c921d7020da5d4e22e88bbbb4a6787a209
 F ext/wasm/jaccwabyt/jaccwabyt.js 06f2ef1ad640c26c593def3d960336e9bb789819b920516480895c38ed5f58fa
 F ext/wasm/jaccwabyt/jaccwabyt.md 37911f00db12cbcca73aa1ed72594430365f30aafae2fa9c886961de74e5e0eb
 F ext/wasm/module-symbols.html 573317801087e67c946a157783715d5716e027fcf484918a0c3aae4e627cc93d
 F ext/wasm/scratchpad-wasmfs-main.html 20cf6f1a8f368e70d01e8c17200e3eaa90f1c8e1029186d836d14b83845fbe06
 F ext/wasm/scratchpad-wasmfs-main.js 4c140457f4d6da9d646a49addd91edb6e9ad1643c6c48e3258b5bce24725dc18
-F ext/wasm/speedtest1-wasmfs.html bc28eb29b69a73864b8d7aae428448f8b7e1de81d8bfb9bba99541322054dbd0
+F ext/wasm/speedtest1-wasmfs.html 7a301f4f5b6ad4f5d37fd6e7ca03a2f5d5547fd289da60a39075a93d7646d354
 F ext/wasm/speedtest1-worker.html fe6b36a63de1012bb9fb4d2fb888b6de9c589c21b0aa3ae054459b0093e077bf
 F ext/wasm/speedtest1-worker.js 13b57c4a41729678a1194014afec2bd5b94435dcfc8d1039dfa9a533ac819ee1
 F ext/wasm/speedtest1.html ff048b4a623aa192e83e143e48f1ce2a899846dd42c023fdedc8772b6e3f07da
@@ -560,7 +560,7 @@ F ext/wasm/tests/opfs/concurrency/index.html 86d8ac435074d1e7007b91105f4897f368c
 F ext/wasm/tests/opfs/concurrency/test.js a98016113eaf71e81ddbf71655aa29b0fed9a8b79a3cdd3620d1658eb1cc9a5d
 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
 F ext/wasm/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd72273503ae7d5
-F ext/wasm/wasmfs.make 7ab655788bf0b52dce4538acbd5b11cdbe77edd36a14af5dec6dfe1ec4ab25fc
+F ext/wasm/wasmfs.make cf9a68162d92ca2bcb0b9528b244cb36d5cc2d84ccc9c2d398461927d6e75aea
 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
@@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 62e0c931ac952219f68e22d64e20836781bf330b4581e4662266172a97c9289b
-R 2a9bfbe7fdfa9c08a8f7d9b04e6ef9cc
-U drh
-Z f77ef26dbbf4f31f60b6c80077f1ca69
+P 28ba1fec4519e7ca9466f1a2f787c905f2cf880d38a004639f99f948e46a51e7
+R bc4bbe906c656894d069cd1f6228f4a2
+U stephan
+Z 092c21b3ca5e87136be491e74ab05c79
 # Remove this line to create a well-formed Fossil manifest.
index ae42c96af8bfde1daee12cfef63089609368a849..b48b089ec87fae186ac68199bf2b5f7c9baa0983 100644 (file)
@@ -1 +1 @@
-28ba1fec4519e7ca9466f1a2f787c905f2cf880d38a004639f99f948e46a51e7
\ No newline at end of file
+32dc98c8001387b1970623192ec6cb89445000fa49bda5f4bd7c525bbe20bb5b
\ No newline at end of file