SQLite

Changes On Branch wasm-nodefs
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch wasm-nodefs Excluding Merge-Ins

This is equivalent to a diff from dd5977c9a8 to 0bcbde7c54

2024-03-06
11:35
Fix handling of "id=?" corner cases in rtree when the value on the RHS is a real value. Problem reported by forum post 1bb055be17. (check-in: 027e5336ac user: dan tags: trunk)
08:45
Wasm build tweaks to attempt to get the node.js-for-node.js build to use Emscripten's nodefs filesystem driver for persistent storage. This is completely untested - validating it requires a nodeist. (Closed-Leaf check-in: 0bcbde7c54 user: stephan tags: wasm-nodefs)
2024-03-05
18:41
Remove code that added a P4 parameter to the OP_Variable opcode. This is no longer required. (check-in: dd5977c9a8 user: dan tags: trunk)
17:33
Reformulate [34439fe3aeea7cbb] slightly to resolve a false-positive OOM reported in forum post 2eadfe94e3. (check-in: 8290646792 user: stephan tags: trunk)

Changes to ext/wasm/GNUmakefile.
78
79
80
81
82
83
84
85


86
87
88
89
90
91
92
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93







-
+
+







# - bundler-friendly = esm slightly tweaked for "bundler"
#   tools. Bundlers are invariably based on node.js, so these builds
#   are intended to be read at build-time by node.js but with a final
#   target of browsers.
#
# - node = for use by node.js for node.js, as opposed to by node.js on
#   behalf o browser-side code (use bundler-friendly for that). Note
#   that persistent storage (OPFS) is not available in these builds.
#   that persistent storage (OPFS, kvvfs) is not available in these
#   builds.
#
JS_BUILD_MODES := vanilla esm bunder-friendly node

########################################################################
# Emscripten SDK home dir and related binaries...
EMSDK_HOME ?= $(word 1,$(wildcard $(HOME)/emsdk $(HOME)/src/emsdk))
emcc.bin ?= $(word 1,$(wildcard $(EMSDK_HOME)/upstream/emscripten/emcc) $(shell which emcc))
734
735
736
737
738
739
740


741
742


743
744
745


746
747
748
749
750
751
752
735
736
737
738
739
740
741
742
743


744
745



746
747
748
749
750
751
752
753
754







+
+
-
-
+
+
-
-
-
+
+







  $$(pre-post-common.flags) \
  --post-js=$$(post-js.js.$(1)-$(2)) \
  --extern-post-js=$$(extern-post-js.js.$(1)-$(2))
pre-post-jses.$(1)-$(2).deps := $$(pre-post-jses.deps.common) \
  $$(post-js.js.$(1)-$(2)) $$(extern-post-js.js.$(1)-$(2))
$$(pre-js.js.$(1)-$(2)): $$(pre-js.js.$(1)-$(2).intermediary) $$(MAKEFILE)
	cp $$(pre-js.js.$(1)-$(2).intermediary) $$@
	@case $(1) in \
		sqlite3) ;; \
	@if [ sqlite3-wasmfs = $(1) ]; then \
		echo "delete Module[xNameOfInstantiateWasm] /*for WASMFS build*/;"; \
		sqlite3-wasmfs) \
			echo "delete Module[xNameOfInstantiateWasm] /*for WASMFS and node builds*/;" ;; \
	elif [ sqlite3 != $(1) ]; then \
		echo "Module[xNameOfInstantiateWasm].uri = '$(1).wasm';"; \
	fi >> $$@
		*) echo "Module[xNameOfInstantiateWasm].uri = '$(1).wasm';" ;; \
	esac >> $$@
pre-post-$(1)-$(2).deps := \
  $$(pre-post-jses.$(1)-$(2).deps) \
  $$(dir.tmp)/pre-js.$(1)-$(2).js
pre-post-$(1)-$(2).flags += \
  $$(pre-post-common.flags.$(1)-$(2)) \
  --pre-js=$$(dir.tmp)/pre-js.$(1)-$(2).js
endef
821
822
823
824
825
826
827
828

829
830
831
832
833
834
835
823
824
825
826
827
828
829

830
831
832
833
834
835
836
837







-
+







#
# $1 = one of: $(JS_BUILD_NAMES)
# $2 = build mode name: one of $(JS_BUILD_MODES)
# $3 = 1 for ESM build mode, else 0
# $4 = resulting sqlite-api JS/MJS file
# $5 = resulting JS/MJS file
# $6 = -D... flags for $(bin.c-pp)
# $7 = emcc -sXYZ flags (CURRENTLY UNUSED - was factored out)
# $7 = optional additional flags for emcc
#
# Maintenance reminder: be careful not to introduce spaces around args
# ($1, $2), otherwise string concatenation will malfunction.
#
# emcc.environment.$(2) must be set to a value for emcc's
# -sENVIRONMENT flag.
#
888
889
890
891
892
893
894
895





896
897
898
899
900
901
902
890
891
892
893
894
895
896

897
898
899
900
901
902
903
904
905
906
907
908







-
+
+
+
+
+







$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,esm,1,\
         $(sqlite3-api.mjs), $(sqlite3.mjs), -Dtarget=es6-module))
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,bundler-friendly,1,\
       $(sqlite3-api-bundler-friendly.mjs),$(sqlite3-bundler-friendly.mjs),\
       $(c-pp.D.sqlite3-esm) -Dtarget=es6-bundler-friendly))
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,node,1,\
       $(sqlite3-api-node.mjs),$(sqlite3-node.mjs),\
       $(c-pp.D.sqlite3-bundler-friendly) -Dtarget=node))
       $(c-pp.D.sqlite3-bundler-friendly) -Dtarget=node,-lnodefs.js))
# ^^^^ reminder to self: using -lnodefs.js affects the resulting JS but
#      not the .wasm file, so that build can/should use the canonical
#      wasm file.
#
# The various -D... values used by *.c-pp.js include:
#
# -Dtarget=es6-module: for all ESM module builds
#
# -Dtarget=node: for node.js builds
#
# -Dtarget=es6-module -Dtarget=es6-bundler-friendly: intended for