#
# $(call b.cp,@,src,dest)
#
-# $1 = build name, $2 = src file(s). $3 = dest dir
+# $1 = logtag, $2 = src file(s). $3 = dest dir
b.cp = $(call b.mkdir@); \
echo '$(logtag.$(1)) $(emo.disk) $(2) ==> $3'; \
cp -p $(2) $(3) || exit
# $1 = build name
# $2 = Input file(s): cat $(2) | $(bin.c-pp) ...
# $3 = Output file: $(bin.c-pp) -o $(3)
-# $4 = optional $(bin.c-pp) -D... flags */
+# $4 = optional $(bin.c-pp) -D... flags
define b.eval.c-pp
$(3): $$(MAKEFILE_LIST) $$(bin.c-pp) $(2)
@$$(call b.mkdir@); \
cflags.wasm_extra_init = -DSQLITE_WASM_EXTRA_INIT
endif
+#
+# Experimental and not known to work since the build upheaval in
+# 2025-09.
#
# If $(WASM_CUSTOM_INSTANTIATE) is 1 then mkwasmbuilds will add
# -Dcustom-Module.instantiateWasm to some of the builds. This is
/* ^^^^ ACHTUNG: blank line at the start is necessary because
Emscripten will not add a newline in some cases and we need
- a blank line for a sed-based kludge for the ES6 build. */
-/* extern-post-js.js must be appended to the resulting sqlite3.js
+ a blank line for a sed-based kludge for the ES6 build.
+
+ extern-post-js.js must be appended to the resulting sqlite3.js
file. It gets its name from being used as the value for the
--extern-post-js=... Emscripten flag. This code, unlike most of the
associated JS code, runs outside of the Emscripten-generated module
- init scope, in the current global scope. */
+ init scope, in the current global scope.
+
+ At the time this is run, the global-scope sqlite3InitModule
+ function will have just been defined.
+*/
//#if target=es6-module
const toExportForESM =
//#endif
documentation by being able to elide those details), we hide that
function and expose a hand-written sqlite3InitModule() to return
the sqlite3 object (most of the time).
-
- Unfortunately, we cannot modify the module-loader/exporter-based
- impls which Emscripten installs at some point in the file above
- this.
*/
const originalInit = sqlite3InitModule;
if(!originalInit){
sIMS.sqlite3Dir = li.join('/') + '/';
}
- globalThis.sqlite3InitModule = function ff(...args){
+ const sIM = globalThis.sqlite3InitModule = function ff(...args){
//console.warn("Using replaced sqlite3InitModule()",globalThis.location);
return originalInit(...args).then((EmscriptenModule)=>{
sIMS.debugModule("sqlite3InitModule() sIMS =",sIMS);
throw e;
});
};
- globalThis.sqlite3InitModule.ready = originalInit.ready;
+ sIM.ready = originalInit.ready;
if(sIMS.moduleScript){
let src = sIMS.moduleScript.src.split('/');
sIMS.scriptDir = src.join('/') + '/';
}
sIMS.debugModule('extern-post-js.c-pp.js sqlite3InitModuleState =',sIMS);
- if(0){
- console.warn("Replaced sqlite3InitModule()");
- console.warn("globalThis.location.href =",globalThis.location.href);
- if('undefined' !== typeof document){
- console.warn("document.currentScript.src =",
- document?.currentScript?.src);
- }
- }
//#ifnot target=es6-module
// Emscripten does not inject these module-loader bits in ES6 module
// builds and including them here breaks JS bundlers, so elide them
/* Replace the various module exports performed by the Emscripten
glue... */
if (typeof exports === 'object' && typeof module === 'object'){
- module.exports = sqlite3InitModule;
- module.exports.default = sqlite3InitModule;
+ module.exports = sIM;
+ module.exports.default = sIM;
}else if( 'function'===typeof define && define.amd ){
- define([], ()=>sqlite3InitModule);
+ define([], ()=>sIM);
}else if (typeof exports === 'object'){
- exports["sqlite3InitModule"] = sqlite3InitModule;
+ exports["sqlite3InitModule"] = sIM;
}
/* AMD modules get injected in a way we cannot override,
so we can't handle those here. */
//#endif // !target=es6-module
- return globalThis.sqlite3InitModule /* required for ESM */;
+ return sIM;
})();
//#if target=es6-module
sqlite3InitModule = toExportForESM;
//console.warn("This is the end of the Module.runSQLite3PostLoadInit handler.");
-}/*Module.runSQLite3PostLoadInit(EmscriptenModule)*/;
+}/*Module.runSQLite3PostLoadInit(...)*/;
//console.warn("This is the end of the setup of the (pending) Module.runSQLite3PostLoadInit");
//#endif ifnot target=es6-bundler-friendly
//#if custom-Module.instantiateWasm
+//#if !wasmfs
/**
Override Module.instantiateWasm().
In such builds we must disable this.
*/
-Module[
-//#if wasmfs
- 'emscripten-bug-17951'
-//#else
- 'instantiateWasm'
+Module['instantiateWasm'
/* This works, but it does not have the testing coverage in
the wild which Emscripten's default impl does, so we'll
save this option until we really need a custom
Module.instantiateWasm(). */
-//#endif
] = function callee(imports,onSuccess){
const sims = this;
const uri = Module.locateFile(
into their glue scripts.
*/
sIMS.wasmFilename = 'sqlite3.wasm';
+//#endif !wasmfs
//#endif custom-Module.instantiateWasm
/*
END FILE: api/pre-js.js, noting that the build process may append
*/
const p = globalThis.sqlite3ApiBootstrap(bootstrapConfig);
delete globalThis.sqlite3ApiBootstrap;
- return p;
+ return p /* the eventual result of globalThis.sqlite3InitModule() */;
}catch(e){
console.error("sqlite3ApiBootstrap() error:",e);
throw e;
);
sqlite3.scriptInfo /* used by some async init code */ =
sqlite3InitScriptInfo /* from post-js-header.js */;
- if( (sqlite3.__isUnderTest = sqlite3IsUnderTest) ){
+ if( (sqlite3.__isUnderTest = sqlite3IsUnderTest /* from post-js-header.js */) ){
sqlite3.config.emscripten = EmscriptenModule;
const iw = sqlite3InitScriptInfo.instantiateWasm;
if( iw ){
** populating those files. This is necessary for any builds which
** embed the library's JS parts of this build (as opposed to parts
** which do not use the library-level code).
+**
+** pB may be NULL.
*/
-static void mk_pre_post(char const *zBuildName){
+static void mk_pre_post(char const *zBuildName, BuildDef const * pB){
/* Very common printf() args combo. */
pf("%s# Begin --pre/--post flags for %s\n", zBanner, zBuildName);
pf("pre-js.%s.js = $(dir.tmp)/pre-js.%s.js\n",
zBuildName, zBuildName);
- if( 0==WASM_CUSTOM_INSTANTIATE ){
+ if( 0==WASM_CUSTOM_INSTANTIATE || !pB || !pB->zDotWasm ){
pf("$(eval $(call b.eval.c-pp,"
"%s,"
"$(pre-js.in.js),"
"))",
zBuildName, zBuildName, zBuildName);
}else{
+ assert( pB && pB->zDotWasm );
#if 0
- fixme;
+ pf("$(error fix the bit near %s:%d)\n",
+ __FILE__, __LINE__);
+#else
/* This part is needed for builds which have to rename the wasm file
in zDotWasm so that the loader can find it. */
- pf("pre-js.%s.js.intermediary = "
+ pf("pre-js.%s.intermediary = "
"$(dir.tmp)/pre-js.%s.intermediary.js\n",
zBuildName, zBuildName);
- pf("$(eval $(call SQLITE.CALL.C-PP.FILTER,$(pre-js.in.js),"
- "$(pre-js.%s.js.intermediary),"
+ pf("$(eval $(call b.eval.c-pp,"
+ "%s,"
+ "$(pre-js.in.js),"
+ "$(pre-js.%s.intermediary),"
C_PP_D_CUSTOM_INSTANTIATE "$(c-pp.D.%s)))\n",
+ zBuildName, zBuildName, zBuildName);
+ pf("$(pre-js.%s.js): $(pre-js.%s.intermediary)"
+ " $(out.dout)/%s\n" /* from a different build */
+ "\t$(call b.cp,%s,cp $(pre-js.%s.intermediary) $@\n",
+ zBuildName, zBuildName,
+ pB->zDotWasm,
zBuildName, zBuildName);
- pf("$(pre-js.%s.js): $(pre-js.%s.js.intermediary)\n",
- zBuildName, zBuildName);
- pf("\tcp $(pre-js.%s.js.intermediary) $@\n", zBuildName);
- pf("\t@echo 'sIMS.wasmFilename = \"$(out.%s.wasm)\";' >> $@\n",
- zBuildName)
- /* see api/pre-js.c-pp.js:Module.instantiateModule() */;
+ pf("\t@echo 'sIMS.wasmFilename = \"%s\";' >> $@\n",
+ pB->zDotWasm
+ /* see api/pre-js.c-pp.js:Module.instantiateModule() */
+ );
#endif
}
if( pB->flags & F_64BIT ){
pf("c-pp.D.%s += $(c-pp.D.64bit)\n", zBuildName);
}
- mk_pre_post(zBuildName);
+
+ mk_pre_post(zBuildName, pB);
{ /* build it... */
pf(zBanner
zBuildName, zBuildName);
emit_api_js(zBuildName, 0);
- mk_pre_post(zBuildName);
+ mk_pre_post(zBuildName, 0);
{/* emcc */
pf("$(out.%s.js): $(MAKEFILE_LIST) "
}
}
-#if 0
-static void mk_speedtest1(void){
- char const *zBuildName = "speedtest1";
- pf(zBanner "# Begin build %s\n", zBuildName);
- pf("emo.%s ="
- "🛼" // roller skates
- /*"🏎" //racecar doesn't show up well in my emacs or terminal */
- "\n",
- zBuildName);
- pf("logtag.%s = [$(emo.%s) [%s] $@]:\n"
- "$(info $(logtag.%s) Setting up target speedtest1)\n"
- "all: %s\n",
- zBuildName, zBuildName, zBuildName,
- zBuildName, zBuildName );
-
- pf("dir.dout.%s ?= $(dir.dout)\n", zBuildName);
- pf("out.%s.js = $(dir.dout)/speedtest1.js\n"
- "out.%s.wasm = $(dir.dout)/speedtest1.wasm\n",
- zBuildName, zBuildName);
-
- emit_api_js(zBuildName, 0);
- mk_pre_post(zBuildName);
-
- /* Main rules are in the makefile */
-
-#if 0
- mk_pre_post("speedtest1-vanilla");
- ps(zBanner "ifeq (1,$(HAVE_WASMFS))");
- mk_pre_post("speedtest1-wasmfs");
- ps("endif\n# ^^^ HAVE_WASMFS" zBanner);
-#endif
-#if 0
- mk_pre_post(0, "speedtest1","vanilla", 0, "speedtest1.wasm");
- mk_pre_post(0, "speedtest1-wasmfs", "esm",
- "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs",
- "speetest1-wasmfs.wasm");
-#endif
-}
-#endif
-
int main(int argc, char const ** argv){
int rc = 0;
const BuildDef *pB;
-C wasm\sdist:\sadd\s--snapshot\sflag,\sadd\s-64\sflag\sto\sinclude\s64-bit\sbuilds,\sand\sadd\smodule-symbols.html\sto\sthe\sdist.
-D 2025-09-25T18:53:28.163
+C Build\scleanups\sand\sdead\scode\sremoval.
+D 2025-09-26T01:38:07.516
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F ext/session/sqlite3session.h 7404723606074fcb2afdc6b72c206072cdb2b7d8ba097ca1559174a80bc26f7a
F ext/session/test_session.c 8766b5973a6323934cb51248f621c3dc87ad2a98f023c3cc280d79e7d78d36fb
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
-F ext/wasm/GNUmakefile f5c8895122666957bcf2b83a7bcef3e06e16d60b710282397f29bfa013e9c4bc
+F ext/wasm/GNUmakefile 552729e81c67b249cb1a502b2efa1d264c26058a190f080620d16da8ae1a5c91
F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
F ext/wasm/README.md 66ace67ae98a45e4116f2ca5425b716887bcee4d64febee804ff6398e1ae9ec7
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see fb29e62082a658f0d81102488414d422c393c4b20cc2f685b216bc566237957b
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
F ext/wasm/api/README.md f4c0d67caaee21a77b8938c30b5f79667bfc9d0c95d01b51df77ea35ee773884
-F ext/wasm/api/extern-post-js.c-pp.js 6bf4407c028fac7d387821420cd25f6d68ad80f7d526e86539b6a3012230917f
+F ext/wasm/api/extern-post-js.c-pp.js c9d73ffbe40c06de302e9ee92ff21bfed53102ccff383fbc0026771aab4ad42c
F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
-F ext/wasm/api/post-js-footer.js e617e5f81a907362de152576323155f02d24642e625fc05fb801b86b6a269444
+F ext/wasm/api/post-js-footer.js 5bd7170b5e8ce7b62102702bbcf47ef7b3b49cd56ed40c043fd990aa715b74ee
F ext/wasm/api/post-js-header.js 79d078aec33d93b640a19c574b504d88bb2446432f38e2fbb3bb8e36da436e70
-F ext/wasm/api/pre-js.c-pp.js 664551f490d296e0f4590d3a029787ab0782b9a1fa5954d73bde4fb2c6bfc709
-F ext/wasm/api/sqlite3-api-cleanup.js e643a96c5323e051e29046bfd6412750917ca2c955e31c9192fb924ecc8ed004
+F ext/wasm/api/pre-js.c-pp.js 1a02efe3ddb6ca929b32399b2761bf129912809ac59530a2cc7b4060f54bb2c4
+F ext/wasm/api/sqlite3-api-cleanup.js a3d6b9e449aefbb8bba283c2ba9477e2333a0eeb94a7a26b5bf952736f65a6dd
F ext/wasm/api/sqlite3-api-glue.c-pp.js 12f5b36775fab1e7bf5385689fded2b2a9f77360562515e9849acb5e66602e2d
F ext/wasm/api/sqlite3-api-oo1.c-pp.js db4c8ebb03bac60db32ce03f8c615b00f4e4ad53e7d5de5e63d2780cba052caa
-F ext/wasm/api/sqlite3-api-prologue.js 259c72c6a33ba1be2297c568cbc2ad53437d1d4b2613d7772c56a3aa00bf435d
+F ext/wasm/api/sqlite3-api-prologue.js b5a55ae74efcdcd0aa6a143d59e34137e43ae732f02b563dcab22d735f1599a4
F ext/wasm/api/sqlite3-api-worker1.c-pp.js 760191cd13416e6f5adfd9fcc8a97fed5645c9e0a5fbac213a2d4ce2d79a4334
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
F ext/wasm/api/sqlite3-opfs-async-proxy.js 9654b565b346dc609b75d15337f20acfa7af7d9d558da1afeb9b6d8eaa404966
F ext/wasm/jaccwabyt/jaccwabyt.js bbac67bc7a79dca34afe6215fd16b27768d84e22273507206f888c117e2ede7d
F ext/wasm/jaccwabyt/jaccwabyt.md 167fc0b624c9bc2c477846e336de9403842d81b1a24fc4d3b24317cb9eba734f
F ext/wasm/mkdist.sh 29f8a37a7aba41fa5df8e89b1fab02b83b35c43473c5cf808584872e022514b8 x
-F ext/wasm/mkwasmbuilds.c 3f27681fd3b32a78560feb3bb54f0f46a68f75024f65d9c5d4247f6bd08a04ad
+F ext/wasm/mkwasmbuilds.c 3a5318125a18586820aa616c1b1a04ae9cb22a14d08314c29064f7ed170107da
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P ab6eb4d3b723107da488770b1849b9f1d1c491348f1eaa544e0e07356b8fac7d
-R 5604f99b6885eee7b3387abf567432cd
+P e9a6391b377b6964620285192262a4dc9fe1712799f7aa8a8b37c5f718544ed2
+R dea7fcf911bad446482b33822a2cc98a
U stephan
-Z 54eb9cf8d86f8180d0b259e57237e3ca
+Z 1ba071457baea55e6abdc250bb9597e3
# Remove this line to create a well-formed Fossil manifest.
-e9a6391b377b6964620285192262a4dc9fe1712799f7aa8a8b37c5f718544ed2
+b516109e5accc885b71900402c800ae855407552648861334c895f0e5dea4ee5