From: stephan Date: Tue, 23 Sep 2025 08:44:07 +0000 (+0000) Subject: Make it easier to pick out which parallel build messages belong to which wasm build. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c0850f8b8e4280133e5c3f5e1f7768cc4766d63;p=thirdparty%2Fsqlite.git Make it easier to pick out which parallel build messages belong to which wasm build. FossilOrigin-Name: 913af3dd6a8da577ef19b0d82c8afec0c626d7fa5fddbdf418d2eb16c3050ab1 --- diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index 7d6d254f98..0fff6b37c0 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -510,7 +510,7 @@ endif SQLITE.strip-emcc-js-cruft = \ sed -i -e '/^.*= \(_sqlite3\|_fiddle\)[^=]*=.*createExportWrapper/d' \ -e '/^var \(_sqlite3\|_fiddle\)[^=]*=.*makeInvalidEarlyAccess/d' $@ || exit; \ - echo '[$@]: (Probably) stripped out createExportWrapper() and makeInvalidEarlyAccess() parts.' + echo '$(1) (Probably) stripped out createExportWrapper() and makeInvalidEarlyAccess() parts.' # When passing emcc_opt from the CLI, += and re-assignment have no # effect, so emcc_opt+=-g3 doesn't work. So... diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c index 23dd7daccf..a1034840cd 100644 --- a/ext/wasm/mkwasmbuilds.c +++ b/ext/wasm/mkwasmbuilds.c @@ -81,6 +81,17 @@ struct BuildDef { Base name of output JS and WASM files. */ const char *zBaseName; + /** + A glyph to use in log messages for this build, intended to help + the eyes distinguish the build lines more easily in parallel + builds. + */ + const char *zEmo; + /** + If the build needs its x.wasm renamed in its x.{js,mjs} + then this must hold the base name to rename it to. + Typically "sqlite3" or "sqlite3-64bit". + */ const char *zDotWasm; const char *zCmppD; /* Extra -D... flags for c-pp */ const char *zEmcc; /* Extra flags for emcc */ @@ -130,7 +141,8 @@ const BuildDefs oBuildDefs = { .vanilla = { /* This one's zBaseName and zEnv MUST be non-NULL so it can be used as a default for all others. */ - .zBaseName ="sqlite3", + .zEmo = "🍦", + .zBaseName = "sqlite3", .zDotWasm = 0, .zCmppD = 0, .zEmcc = 0, @@ -139,6 +151,7 @@ const BuildDefs oBuildDefs = { }, .vanilla64 = { + .zEmo = "🍨", .zBaseName = "sqlite3-64bit", .zDotWasm = 0, .zCmppD = 0, @@ -148,6 +161,7 @@ const BuildDefs oBuildDefs = { }, .esm = { + .zEmo = "🍬", .zBaseName = "sqlite3", .zDotWasm = 0, .zCmppD = "-Dtarget=es6-module", @@ -157,6 +171,7 @@ const BuildDefs oBuildDefs = { }, .esm64 = { + .zEmo = "🍫", .zBaseName = "sqlite3-64bit", .zDotWasm = 0, .zCmppD = "-Dtarget=es6-module", @@ -171,6 +186,7 @@ const BuildDefs oBuildDefs = { ** Testing these would require special-purpose node-based tools and ** custom test apps. Or we can pass them off as-is to the npm ** subproject and they spot failures pretty quickly ;). */ + .zEmo = "👛", .zBaseName = "sqlite3-bundler-friendly", .zDotWasm = "sqlite3", .zCmppD = "$(c-pp.D.esm) -Dtarget=es6-bundler-friendly", @@ -180,6 +196,7 @@ const BuildDefs oBuildDefs = { }, .bundler64 = { + .zEmo = "👜", .zBaseName = "sqlite3", .zDotWasm = 0, .zCmppD = "$(c-pp.D.bundler)", @@ -189,9 +206,9 @@ const BuildDefs oBuildDefs = { }, #if 0 - /* Entirely unsupported. */ .node = { + .zEmo = "", .zBaseName = "sqlite3-node", .zDotWasm = 0, .zCmppD = "$(c-pp.D.bundler)", @@ -202,6 +219,7 @@ const BuildDefs oBuildDefs = { /* Entirely unsupported. */ .wasmfs = { + .zEmo = "", .zBaseName = "sqlite3-wasmfs", .zDotWasm = 0, .zCmppD = "$(c-pp.D.bundler)", @@ -387,22 +405,22 @@ static void mk_prologue(void){ ps("else"); { ps("define SQLITE.CALL.WASM-OPT" - /* $1 = $@, $2 = build name*/ + /* $1 = build name, $2 = emoji*/ ); pf( - "echo '[$@]: Applying $(bin.wasm-opt)';\\\n" - "\trm -f wasm-opt-tmp.$(2).wasm;\\\n" + "echo '[$(2)$@]: Applying $(bin.wasm-opt)';\\\n" + "\trm -f wasm-opt-tmp.$(1).wasm;\\\n" /* It's very likely that the set of wasm-opt flags varies from ** version to version, so we'll ignore any errors here. */ - "\tif $(bin.wasm-opt) $(1) -o wasm-opt-tmp.$(2).wasm \\\n" + "\tif $(bin.wasm-opt) $@ -o wasm-opt-tmp.$(1).wasm \\\n" "\t\t%s; then \\\n" - "\t\tmv wasm-opt-tmp.$(2).wasm $(1); \\\n" + "\t\tmv wasm-opt-tmp.$(1).wasm $@; \\\n" #if 0 "\t\techo -n 'After wasm-opt: '; \\\n" "\t\tls -l $(1); \\\n" #endif "\telse \\\n" - "\t\techo 'WARNING: ignoring wasm-opt failure for $(1)'; \\\n" + "\t\techo '[$(2)$@]: WARNING: ignoring wasm-opt failure'; \\\n" "\tfi\n", zOptFlags ); @@ -521,7 +539,7 @@ static void mk_fiddle(void){ zTail); ps("\t@chmod -x $(basename $@).wasm"); ps("\t@$(maybe-wasm-strip) $(basename $@).wasm"); - ps("\t@$(SQLITE.strip-emcc-js-cruft)"); + ps("\t@$(call SQLITE.strip-emcc-js-cruft,NAME_GOES_HERE)"); pf("\t@cp -p $(SOAP.js) $(dir $@)\n"); if( 1==i ){/*fiddle.debug*/ pf("\tcp -p $(dir.fiddle)/index.html " @@ -566,10 +584,12 @@ void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ assert( oBuildDefs.vanilla.zEnv ); assert( zBaseName ); - pf("%s# Begin build [%s]. flags=0x%02x\n", zBanner, zBuildName, pB->flags); + pf("%s# Begin build [%s%s]. flags=0x%02x\n", zBanner, + pB->zEmo, zBuildName, pB->flags); pf("# zCmppD=%s\n# zBaseName=%s\n", pB->zCmppD ? pB->zCmppD : "", zBaseName); + pf("logtag.%s = [%s$@]:\n", zBuildName, pB->zEmo); pf("dir.dout.%s ?= $(dir.dout)/%s\n", zBuildName, zBuildName); pf("out.%s.base = $(dir.dout.%s)/%s\n", zBuildName, zBuildName, zBaseName); @@ -624,10 +644,10 @@ void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ ** running builds with long build times (like -Oz). */ "\n", zBuildName, zBuildName, zBuildName); - pf("\t@echo '[$@]: building ...'\n"); + pf("\t@echo '$(logtag.%s) building ...'\n", zBuildName); if( F_UNSUPPORTED & pB->flags ){ - ps("\t@echo '[$@]: ACHTUNG: unsupported build type. " - "Use at your own risk.'"); + pf("\t@echo '$(logtag.%s) ACHTUNG: unsupported build type. " + "Use at your own risk.'\n", zBuildName); } pf("\t$(bin.emcc) -o $@ $(emcc_opt_full) $(emcc.flags) \\\n"); pf("\t\t$(emcc.jsflags) -sENVIRONMENT=$(emcc.environment.%s) \\\n", @@ -650,17 +670,19 @@ void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ } pf("\t@chmod -x %s\n", zWasmOut); pf("\t@$(maybe-wasm-strip) %s\n", zWasmOut); - pf("\t@$(call SQLITE.CALL.WASM-OPT,%s,%s)\n", zWasmOut, zBuildName); - ps("\t@$(SQLITE.strip-emcc-js-cruft)"); + pf("\t@$(call SQLITE.CALL.WASM-OPT,%s,%s)\n", + zBuildName, pB->zEmo); + pf("\t@$(call SQLITE.strip-emcc-js-cruft,$(logtag.%s))\n", zBuildName); if( CP_JS & pB->flags && !(pB->zDotWasm/*handled below*/) ){ - ps("\t@cp -f $@ $(dir.dout)/. || exit; \\\n" - "echo '[$@]: ==> $(dir.dout)/$(notdir $@).'" + pf("\t@cp -f $@ $(dir.dout)/. || exit; \\\n" + "echo '$(logtag.%s) ==> $(dir.dout)/$(notdir $@).'\n", + zBuildName ); } if( CP_WASM & pB->flags ){ pf("\t@cp -f %s $(dir.dout)/. || exit; \\\n" - "echo '[%s]: ==> $(dir.dout)/$(notdir %s)'\n", - zWasmOut, zWasmOut, zWasmOut); + "echo '$(logtag.%s) ==> $(dir.dout)/$(notdir %s)'\n", + zWasmOut, zBuildName, zWasmOut); } /* ** The above $(bin.emcc) call will write out $@, and will create a @@ -673,13 +695,14 @@ void mk_lib_mode(const char *zBuildName, const BuildDef * pB){ ** pB->zDotWasm when copying to $(dir.dout). */ if( pB->zDotWasm && (CP_JS & pB->flags) ){ - pf("\t@echo '[$@]: Replacing \"%s.wasm\" in " + pf("\t@echo '$(logtag.%s) Replacing \"%s.wasm\" in " "$(dir.dout)/$(notdir $@) with \"%s.wasm\"'; \\\n" "sed " "-e 's/\"%s.wasm\"/\"%s.wasm\"/g' " "-e \"s/'%s.wasm'/'%s.wasm'/g\" " "$@ > $(dir.dout)/$(notdir $@)\n" "\t@ls -la $(dir.dout)/$(notdir $@)\n", + zBuildName, zBaseName, pB->zDotWasm, zBaseName, pB->zDotWasm, zBaseName, pB->zDotWasm); diff --git a/manifest b/manifest index 51f60caf88..8862ac8781 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C More\sbuild\srestructuring. -D 2025-09-23T08:23:23.789 +C Make\sit\seasier\sto\spick\sout\swhich\sparallel\sbuild\smessages\sbelong\sto\swhich\swasm\sbuild. +D 2025-09-23T08:44:07.905 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea @@ -578,7 +578,7 @@ F ext/session/sqlite3session.c 9cd47bfefb23c114b7a5d9ee5822d941398902f30516bf0dd 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 0ecf7ff692887d55d1fa37f1f6615c782f87c93c3cb0de264aefa2786ebd93f3 +F ext/wasm/GNUmakefile 4ed23b1978bff9853b5de97986a4ab0fb683931a2b6114bfe7f1bef478667483 F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a F ext/wasm/README.md 66ace67ae98a45e4116f2ca5425b716887bcee4d64febee804ff6398e1ae9ec7 F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff @@ -639,7 +639,7 @@ F ext/wasm/index-dist.html 56132399702b15d70c474c3f1952541e25cb0922942868f70daf1 F ext/wasm/index.html bcaa00eca521b372a6a62c7e7b17a870b0fcdf3e418a5921df1fd61e5344080d F ext/wasm/jaccwabyt/jaccwabyt.js bbac67bc7a79dca34afe6215fd16b27768d84e22273507206f888c117e2ede7d F ext/wasm/jaccwabyt/jaccwabyt.md 167fc0b624c9bc2c477846e336de9403842d81b1a24fc4d3b24317cb9eba734f -F ext/wasm/mkwasmbuilds.c 6bf9f22a62874a053ff8383b89497864a1a385f3dae43deea525953b2f65e50c +F ext/wasm/mkwasmbuilds.c ad6c8f9ac10dbbcf787208437c925ef529cc326a717fc6572b141e5045c70966 F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337 F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96 F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63 @@ -2175,8 +2175,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 1ad0169b022b280bcaaf94a7fa231591be96b514230ab5c98fbf15cd7df842dd F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 47526a75f2ad85100b1eae7ab1cf9a9dddd4430a99f7a30aa0c16548d1db9d33 -R 022960e7710c43f7a03c044d401495dc +P 7bee8ee76380b2c1beb320b55042f149c22f872c70b58461652fa5bcbf6ad3c7 +R 4b260be035b101a5e5da7fd57f6f98ed U stephan -Z cdedef3da028fd2a488e8188a24209ae +Z 28ef71ba6bfcc17d9cb47dcbe5b80cc7 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 88dd0cc38b..e7acc9f315 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7bee8ee76380b2c1beb320b55042f149c22f872c70b58461652fa5bcbf6ad3c7 +913af3dd6a8da577ef19b0d82c8afec0c626d7fa5fddbdf418d2eb16c3050ab1