From 40ce00b54613bce948251264c2dae694db881aa3 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 3 Feb 2025 16:26:30 +0000 Subject: [PATCH 01/26] Initial work on a fix for the SAHPool VFS's effectively-no-op digest calculation, as reported in [https://github.com/sqlite/sqlite-wasm/issues/97|ticket #97 of the downstream npm subproject]. This requires more testing alongside databases created before this version to ensure that it's backwards-compatible. FossilOrigin-Name: 9234c33f92d92bfddc6211c9c587f1072e70837c0ffe1416ef7d84d59bacd364 --- ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 56 ++++++++++++++++--- ext/wasm/tester1.c-pp.js | 2 +- manifest | 17 +++--- manifest.uuid | 2 +- 4 files changed, 61 insertions(+), 16 deletions(-) diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index 6551b5c89c..38a1b91dde 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -79,6 +79,32 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ capi.SQLITE_OPEN_MAIN_JOURNAL | capi.SQLITE_OPEN_SUPER_JOURNAL | capi.SQLITE_OPEN_WAL; + const FLAG_COMPUTE_DIGEST_V2 = 1 ? capi.SQLITE_OPEN_MEMORY : 0 + /* Part of the fix for + https://github.com/sqlite/sqlite-wasm/issues/97 + + Summary: prior to versions 3.49.1 and 3.50 computeDigest() always + computes a value of [0,0], so it does not actually do anything + useful. Fixing it invalidates old persistent files, so we + instead only fix it for files created or updated since the bug + was discovered and fixed. + + This flag determines whether we use the broken legacy + computeDigest() or the v2 variant. We only use this flag for + newly-created/overwritten files. Pre-existing files have the + broken digest stored in them so need to continue to use that. + + This flag is stored in the same space as the + SQLITE_OPEN_... flags and we must be careful here to not use an + flag bit which is otherwise relevant for the VFS. + SQLITE_OPEN_MEMORY is handled by sqlite3_open_v2() and friends, + not the VFS, so we'll repurpose that one. If we take a + currently-unused bit and it ends up, at some later point, being + used, we would have to invalidate existing VFS files in order to + move to another bit. Similarly, if the SQLITE_OPEN_MEMORY bit + were ever reassigned (which it won't be!), we'd invalidate all + VFS-side files. + */; /** Subdirectory of the VFS's space where "opaque" (randomly-named) files are stored. Changing this effectively invalidates the data @@ -329,6 +355,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ xOpen: function f(pVfs, zName, pFile, flags, pOutFlags){ const pool = getPoolForVfs(pVfs); try{ + flags &= ~FLAG_COMPUTE_DIGEST_V2; pool.log(`xOpen ${wasm.cstrToJs(zName)} ${flags}`); // First try to open a path that already exists in the file system. const path = (zName && wasm.peek8(zName)) @@ -631,7 +658,8 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ const fileDigest = new Uint32Array(HEADER_DIGEST_SIZE / 4); sah.read(fileDigest, {at: HEADER_OFFSET_DIGEST}); - const compDigest = this.computeDigest(this.#apBody); + const compDigest = this.computeDigest(this.#apBody, flags); + //console.warn("getAssociatedPath() compDigest",compDigest); if(fileDigest.every((v,i) => v===compDigest[i])){ // Valid digest const pathBytes = this.#apBody.findIndex((v)=>0===v); @@ -662,10 +690,17 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ if(HEADER_MAX_PATH_SIZE <= enc.written + 1/*NUL byte*/){ toss("Path too long:",path); } + if(path && flags){ + /* When re-writing files, update their digest, if needed, + to v2. We continue to use v1 for the (!path) case + (empty files) because there's little reason not to + use a digest of 0 for empty entries. */ + flags |= FLAG_COMPUTE_DIGEST_V2; + } this.#apBody.fill(0, enc.written, HEADER_MAX_PATH_SIZE); this.#dvBody.setUint32(HEADER_OFFSET_FLAGS, flags); - - const digest = this.computeDigest(this.#apBody); + const digest = this.computeDigest(this.#apBody, flags); + //console.warn("setAssociatedPath(",path,") digest",digest); sah.write(this.#apBody, {at: 0}); sah.write(digest, {at: HEADER_OFFSET_DIGEST}); sah.flush(); @@ -686,13 +721,20 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ metadata for each file as a validation check. Changing this algorithm invalidates all existing databases for this VFS, so don't do that. + + See the docs for FLAG_COMPUTE_DIGEST_V2 for more details. */ - computeDigest(byteArray){ + computeDigest(byteArray, fileFlags){ let h1 = 0xdeadbeef; let h2 = 0x41c6ce57; - for(const v of byteArray){ - h1 = 31 * h1 + (v * 307); - h2 = 31 * h2 + (v * 307); + if( fileFlags & FLAG_COMPUTE_DIGEST_V2 ){ + for(const v of byteArray){ + h1 = Math.imul(h1 ^ v, 2654435761); + h2 = Math.imul(h2 ^ v, 104729); + } + }else{ + /* this is what the buggy legacy computation worked out to */ + h1 = h2 = 0; } return new Uint32Array([h1>>>0, h2>>>0]); } diff --git a/ext/wasm/tester1.c-pp.js b/ext/wasm/tester1.c-pp.js index 880edcec1d..6d603752be 100644 --- a/ext/wasm/tester1.c-pp.js +++ b/ext/wasm/tester1.c-pp.js @@ -3492,7 +3492,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule; }); db.exec([ "create table t(a);", - "insert into t(a) values(1),(2),(3);", + "insert into t(a) values(1),(2),(1);", "select auxtest(a,a), auxtest(a,a) from t order by a" ]); }finally{ diff --git a/manifest b/manifest index 54fc8aa8ae..05212cec00 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\smore\scomplete\stest\sfor\s[76c8435a]\sand\sadd\ssome\scommentary\sabout\s(A)\sthe\sinability\sto\sautomatically\sclean\sup\sautomatically-generated\sWASM\sproxy\sfunctions\sfor\ssqlite3_set_auxdata()\sdestructors\sand\s(B)\show\sto\sdeal\swith\s(A)\sto\savoid\sleaking\sWASM\sproxy\sfunctions. -D 2025-02-03T14:55:56.185 +C Initial\swork\son\sa\sfix\sfor\sthe\sSAHPool\sVFS's\seffectively-no-op\sdigest\scalculation,\sas\sreported\sin\s[https://github.com/sqlite/sqlite-wasm/issues/97|ticket\s#97\sof\sthe\sdownstream\snpm\ssubproject].\sThis\srequires\smore\stesting\salongside\sdatabases\screated\sbefore\sthis\sversion\sto\sensure\sthat\sit's\sbackwards-compatible. +D 2025-02-03T16:26:30.488 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -645,7 +645,7 @@ F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d2 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89 F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d -F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js bb5e96cd0fd6e1e54538256433f1c60a4e3095063c4d1a79a8a022fc59be9571 +F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 2635b4c7f63a8ab496bcff91cb33a890d060e979c34d34e5c782d970fdbce36d F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 9b86ca2d8276cf919fbc9ba2a10e9786033b64f92c2db844d951804dee6c4b4e F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 F ext/wasm/api/sqlite3-wasm.c 6f9d8529072d072359cd22dc5dfb0572c524684686569cfbd0f9640d7619fc10 @@ -696,7 +696,7 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555 F ext/wasm/test-opfs-vfs.js 1618670e466f424aa289859fe0ec8ded223e42e9e69b5c851f809baaaca1a00c F ext/wasm/tester1-worker.html ebc4b820a128963afce328ecf63ab200bd923309eb939f4110510ab449e9814c F ext/wasm/tester1.c-pp.html 1c1bc78b858af2019e663b1a31e76657b73dc24bede28ca92fbe917c3a972af2 -F ext/wasm/tester1.c-pp.js fb8d0761daaa69bd40c8253cc2d6c8c37ada97e1751b7f07af7369842ba2aeae +F ext/wasm/tester1.c-pp.js 005a94be87b888ca33aff130aeaef58045781ebfb92e559063d14e0fee68c9bf F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2 @@ -2209,8 +2209,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 91ef45fc2902e46813366ec6b8317209f39f10e4a23c3808e33aceedab9da6c7 -R f2c90877762eddda2efda339cfb2ee34 +P d693c2dddbd10a2e0b77893b04b11502e30b768f1b06814105f7f35172845fb9 +R f5d8b5467421514674c485e5d9d6f1f0 +T *branch * sahpool-digest +T *sym-sahpool-digest * +T -sym-trunk * Cancelled\sby\sbranch. U stephan -Z 6cfffa02c18a4e52a298c977368cc8d7 +Z fa5f726034dfcd33aa64a420eace023f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c7225ebda1..0ea45d1c37 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d693c2dddbd10a2e0b77893b04b11502e30b768f1b06814105f7f35172845fb9 +9234c33f92d92bfddc6211c9c587f1072e70837c0ffe1416ef7d84d59bacd364 From c97abeac0b33a06a274bc4363b5162c5eed6a5d0 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 3 Feb 2025 17:21:54 +0000 Subject: [PATCH 02/26] Add a test app to assist in validating the SAHPool digest calculation fix. FossilOrigin-Name: a1e304b8020025cc73a658bd8c7697d59b4f3ad96cac0a3e36553a3207d13dc6 --- ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 4 +- ext/wasm/tests/opfs/sahpool/digest-worker.js | 95 ++++++++++++ ext/wasm/tests/opfs/sahpool/digest.html | 141 ++++++++++++++++++ manifest | 17 +-- manifest.uuid | 2 +- 5 files changed, 247 insertions(+), 12 deletions(-) create mode 100644 ext/wasm/tests/opfs/sahpool/digest-worker.js create mode 100644 ext/wasm/tests/opfs/sahpool/digest.html diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index 38a1b91dde..08b77c9c1e 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -659,7 +659,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ const fileDigest = new Uint32Array(HEADER_DIGEST_SIZE / 4); sah.read(fileDigest, {at: HEADER_OFFSET_DIGEST}); const compDigest = this.computeDigest(this.#apBody, flags); - //console.warn("getAssociatedPath() compDigest",compDigest); + console.warn("getAssociatedPath() flags",flags.toString(16), "compDigest", compDigest); if(fileDigest.every((v,i) => v===compDigest[i])){ // Valid digest const pathBytes = this.#apBody.findIndex((v)=>0===v); @@ -700,7 +700,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ this.#apBody.fill(0, enc.written, HEADER_MAX_PATH_SIZE); this.#dvBody.setUint32(HEADER_OFFSET_FLAGS, flags); const digest = this.computeDigest(this.#apBody, flags); - //console.warn("setAssociatedPath(",path,") digest",digest); + console.warn("setAssociatedPath(",path,") digest",digest); sah.write(this.#apBody, {at: 0}); sah.write(digest, {at: HEADER_OFFSET_DIGEST}); sah.flush(); diff --git a/ext/wasm/tests/opfs/sahpool/digest-worker.js b/ext/wasm/tests/opfs/sahpool/digest-worker.js new file mode 100644 index 0000000000..5396252a83 --- /dev/null +++ b/ext/wasm/tests/opfs/sahpool/digest-worker.js @@ -0,0 +1,95 @@ +/* + 2025-01-31 + + The author disclaims copyright to this source code. In place of a + legal notice, here is a blessing: + + * May you do good and not evil. + * May you find forgiveness for yourself and forgive others. + * May you share freely, never taking more than you give. + + *********************************************************************** + + This file is part of sahpool-pausing.js's demonstration of the + pause/unpause feature of the opfs-sahpool VFS. +*/ +const clog = console.log.bind(console); +const wPost = (type,...args)=>postMessage({type, payload:args}); +const log = (...args)=>{ + clog("Worker:",...args); + wPost('log',...args); +} + +const hasOpfs = ()=>{ + return globalThis.FileSystemHandle + && globalThis.FileSystemDirectoryHandle + && globalThis.FileSystemFileHandle + && globalThis.FileSystemFileHandle.prototype.createSyncAccessHandle + && navigator?.storage?.getDirectory; +}; +if( !hasOpfs() ){ + wPost('error',"OPFS not detected"); + throw new Error("OPFS not detected"); +} + +clog("Importing sqlite3..."); +const searchParams = new URL(self.location.href).searchParams; +importScripts(searchParams.get('sqlite3.dir') + '/sqlite3.js'); + +const runTests = function(sqlite3, poolUtil){ + const fname = '/my.db'; + let db = new poolUtil.OpfsSAHPoolDb(fname); + let n = (new Date()).valueOf(); + try { + db.exec([ + "create table if not exists t(a);" + ]); + db.exec({ + sql: "insert into t(a) values(?)", + bind: n++ + }); + log("Record count: ",db.selectValue("select count(*) from t")); + }finally{ + db.close(); + } + + db = new poolUtil.OpfsSAHPoolDb(fname); + try { + db.exec({ + sql: "insert into t(a) values(?)", + bind: n++ + }); + log("Record count: ",db.selectValue("select count(*) from t")); + }finally{ + db.close(); + } + + const fname2 = '/my2.db'; + db = new poolUtil.OpfsSAHPoolDb(fname2); + try { + db.exec([ + "create table if not exists t(a);" + ]); + db.exec({ + sql: "insert into t(a) values(?)", + bind: n++ + }); + log("Record count: ",db.selectValue("select count(*) from t")); + }finally{ + db.close(); + } +}; + +globalThis.sqlite3InitModule().then(async function(sqlite3){ + log("sqlite3 version:",sqlite3.capi.sqlite3_libversion(), + sqlite3.capi.sqlite3_sourceid()); + const sahPoolConfig = { + name: 'opfs-sahpool-digest', + clearOnInit: false, + initialCapacity: 6 + }; + return sqlite3.installOpfsSAHPoolVfs(sahPoolConfig).then(poolUtil=>{ + log('vfs acquired'); + runTests(sqlite3, poolUtil); + }); +}); diff --git a/ext/wasm/tests/opfs/sahpool/digest.html b/ext/wasm/tests/opfs/sahpool/digest.html new file mode 100644 index 0000000000..c4ba6cc1aa --- /dev/null +++ b/ext/wasm/tests/opfs/sahpool/digest.html @@ -0,0 +1,141 @@ + + + + + + + + + sqlite3 tester: OpfsSAHPool Digest + + +

+ +

+ This is a test app for the digest calculation of the OPFS + SAHPool VFS. It requires running it with a new database created using + v3.49.0 or older, then running it again with a newer version, then + again with 3.49.0 or older. +

+
+ + +
+
+ + + diff --git a/manifest b/manifest index 05212cec00..638b314db7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Initial\swork\son\sa\sfix\sfor\sthe\sSAHPool\sVFS's\seffectively-no-op\sdigest\scalculation,\sas\sreported\sin\s[https://github.com/sqlite/sqlite-wasm/issues/97|ticket\s#97\sof\sthe\sdownstream\snpm\ssubproject].\sThis\srequires\smore\stesting\salongside\sdatabases\screated\sbefore\sthis\sversion\sto\sensure\sthat\sit's\sbackwards-compatible. -D 2025-02-03T16:26:30.488 +C Add\sa\stest\sapp\sto\sassist\sin\svalidating\sthe\sSAHPool\sdigest\scalculation\sfix. +D 2025-02-03T17:21:54.248 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -645,7 +645,7 @@ F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d2 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89 F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d -F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js 2635b4c7f63a8ab496bcff91cb33a890d060e979c34d34e5c782d970fdbce36d +F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js d1d17004bfee7a9159b56888b83345c6219262448297a81966faae4fd28f749c F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 9b86ca2d8276cf919fbc9ba2a10e9786033b64f92c2db844d951804dee6c4b4e F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 F ext/wasm/api/sqlite3-wasm.c 6f9d8529072d072359cd22dc5dfb0572c524684686569cfbd0f9640d7619fc10 @@ -700,6 +700,8 @@ F ext/wasm/tester1.c-pp.js 005a94be87b888ca33aff130aeaef58045781ebfb92e559063d14 F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2 +F ext/wasm/tests/opfs/sahpool/digest-worker.js cdf4bb6dad5e274985e4b0022d0d85f9e782df03352044d8c7c22532845d7304 +F ext/wasm/tests/opfs/sahpool/digest.html 83d0c2f1dd6fe83e9088c603091514ac8549ee04a4632d8cc51d27fd094f05b3 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 F main.mk 8cfe182232ac7bbc87530792db6f31c09f2a2f35e9887d0412978746efe42ea9 @@ -2209,11 +2211,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d693c2dddbd10a2e0b77893b04b11502e30b768f1b06814105f7f35172845fb9 -R f5d8b5467421514674c485e5d9d6f1f0 -T *branch * sahpool-digest -T *sym-sahpool-digest * -T -sym-trunk * Cancelled\sby\sbranch. +P 9234c33f92d92bfddc6211c9c587f1072e70837c0ffe1416ef7d84d59bacd364 +R 176b17e8248aa3df480fb81ba267bf4c U stephan -Z fa5f726034dfcd33aa64a420eace023f +Z 9279d9607c28db362f757a9d03a072e6 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0ea45d1c37..fef85d18dd 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9234c33f92d92bfddc6211c9c587f1072e70837c0ffe1416ef7d84d59bacd364 +a1e304b8020025cc73a658bd8c7697d59b4f3ad96cac0a3e36553a3207d13dc6 From d2f7dfa6190f529f7e543380b6663074e9078207 Mon Sep 17 00:00:00 2001 From: stephan Date: Wed, 26 Feb 2025 03:03:08 +0000 Subject: [PATCH 03/26] More work on the sahpool digest fix. New/fixed versions can read legacy (no digest) files but the reverse is only possible in limited circumstances (when files originated from a legacy version). The burning question is whether the real fix would be to remove this digest check altogether, as it only applies in a very limited context, and the fact that it was broken for some 18 months unnoticed suggests that its value might not be worth the CPU cycles. FossilOrigin-Name: 0df62b776c68bebb0e187b353b6f29b0a41a29f0a1c8d6728fa6b9f7ce0d13f7 --- ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js | 52 ++++++++++++------- ext/wasm/tests/opfs/sahpool/digest-worker.js | 9 ++-- ext/wasm/tests/opfs/sahpool/digest.html | 2 +- manifest | 16 +++--- manifest.uuid | 2 +- 5 files changed, 48 insertions(+), 33 deletions(-) diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js index 08b77c9c1e..94c890850d 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js @@ -79,23 +79,39 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ capi.SQLITE_OPEN_MAIN_JOURNAL | capi.SQLITE_OPEN_SUPER_JOURNAL | capi.SQLITE_OPEN_WAL; - const FLAG_COMPUTE_DIGEST_V2 = 1 ? capi.SQLITE_OPEN_MEMORY : 0 + const FLAG_COMPUTE_DIGEST_V2 = capi.SQLITE_OPEN_MEMORY /* Part of the fix for https://github.com/sqlite/sqlite-wasm/issues/97 - Summary: prior to versions 3.49.1 and 3.50 computeDigest() always - computes a value of [0,0], so it does not actually do anything - useful. Fixing it invalidates old persistent files, so we - instead only fix it for files created or updated since the bug - was discovered and fixed. + Summary: prior to versions 3.49.2 and 3.50.0 computeDigest() + always computes a value of [0,0] due to overflows, so it does not + do anything useful. Fixing it invalidates old persistent files, + so we instead only fix it for files created or updated since the + bug was discovered and fixed. This flag determines whether we use the broken legacy computeDigest() or the v2 variant. We only use this flag for newly-created/overwritten files. Pre-existing files have the broken digest stored in them so need to continue to use that. - This flag is stored in the same space as the - SQLITE_OPEN_... flags and we must be careful here to not use an + What this means, in terms of db file compatibility between + versions: + + - DBs created with versions older than this fix (<=3.49.1) + can be read by post-fix versions. Such DBs which are written + to in-place (not replaced) by newer versions can still be read + by older versions, as the affected digest is only modified + when the SAH slot is assigned to a given filename. + + - DBs created with post-fix versions will, when read by a pre-fix + version, be seen as having a "bad digest" and will be + unceremoniously replaced by that pre-fix version. When swapping + back to a post-fix version, that version will see that the file + entry is missing the FLAG_COMPUTE_DIGEST_V2 bit so will treat it + as a legacy file. + + This flag is stored in the same memory as the variour + SQLITE_OPEN_... flags and we must be careful here to not use a flag bit which is otherwise relevant for the VFS. SQLITE_OPEN_MEMORY is handled by sqlite3_open_v2() and friends, not the VFS, so we'll repurpose that one. If we take a @@ -659,7 +675,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ const fileDigest = new Uint32Array(HEADER_DIGEST_SIZE / 4); sah.read(fileDigest, {at: HEADER_OFFSET_DIGEST}); const compDigest = this.computeDigest(this.#apBody, flags); - console.warn("getAssociatedPath() flags",flags.toString(16), "compDigest", compDigest); + //warn("getAssociatedPath() flags",'0x'+flags.toString(16), "compDigest", compDigest); if(fileDigest.every((v,i) => v===compDigest[i])){ // Valid digest const pathBytes = this.#apBody.findIndex((v)=>0===v); @@ -691,16 +707,16 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ toss("Path too long:",path); } if(path && flags){ - /* When re-writing files, update their digest, if needed, - to v2. We continue to use v1 for the (!path) case - (empty files) because there's little reason not to - use a digest of 0 for empty entries. */ + /* When creating or re-writing files, update their digest, if + needed, to v2. We continue to use v1 for the (!path) case + (empty files) because there's little reason not to use a + digest of 0 for empty entries. */ flags |= FLAG_COMPUTE_DIGEST_V2; } this.#apBody.fill(0, enc.written, HEADER_MAX_PATH_SIZE); this.#dvBody.setUint32(HEADER_OFFSET_FLAGS, flags); const digest = this.computeDigest(this.#apBody, flags); - console.warn("setAssociatedPath(",path,") digest",digest); + //console.warn("setAssociatedPath(",path,") digest",digest); sah.write(this.#apBody, {at: 0}); sah.write(digest, {at: HEADER_OFFSET_DIGEST}); sah.flush(); @@ -725,18 +741,18 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){ See the docs for FLAG_COMPUTE_DIGEST_V2 for more details. */ computeDigest(byteArray, fileFlags){ - let h1 = 0xdeadbeef; - let h2 = 0x41c6ce57; if( fileFlags & FLAG_COMPUTE_DIGEST_V2 ){ + let h1 = 0xdeadbeef; + let h2 = 0x41c6ce57; for(const v of byteArray){ h1 = Math.imul(h1 ^ v, 2654435761); h2 = Math.imul(h2 ^ v, 104729); } + return new Uint32Array([h1>>>0, h2>>>0]); }else{ /* this is what the buggy legacy computation worked out to */ - h1 = h2 = 0; + return new Uint32Array([0,0]); } - return new Uint32Array([h1>>>0, h2>>>0]); } /** diff --git a/ext/wasm/tests/opfs/sahpool/digest-worker.js b/ext/wasm/tests/opfs/sahpool/digest-worker.js index 5396252a83..4308566675 100644 --- a/ext/wasm/tests/opfs/sahpool/digest-worker.js +++ b/ext/wasm/tests/opfs/sahpool/digest-worker.js @@ -48,7 +48,7 @@ const runTests = function(sqlite3, poolUtil){ sql: "insert into t(a) values(?)", bind: n++ }); - log("Record count: ",db.selectValue("select count(*) from t")); + log(fname,"record count: ",db.selectValue("select count(*) from t")); }finally{ db.close(); } @@ -59,7 +59,7 @@ const runTests = function(sqlite3, poolUtil){ sql: "insert into t(a) values(?)", bind: n++ }); - log("Record count: ",db.selectValue("select count(*) from t")); + log(fname,"record count: ",db.selectValue("select count(*) from t")); }finally{ db.close(); } @@ -74,15 +74,14 @@ const runTests = function(sqlite3, poolUtil){ sql: "insert into t(a) values(?)", bind: n++ }); - log("Record count: ",db.selectValue("select count(*) from t")); + log(fname2,"record count: ",db.selectValue("select count(*) from t")); }finally{ db.close(); } }; globalThis.sqlite3InitModule().then(async function(sqlite3){ - log("sqlite3 version:",sqlite3.capi.sqlite3_libversion(), - sqlite3.capi.sqlite3_sourceid()); + log("sqlite3 version:",sqlite3.version); const sahPoolConfig = { name: 'opfs-sahpool-digest', clearOnInit: false, diff --git a/ext/wasm/tests/opfs/sahpool/digest.html b/ext/wasm/tests/opfs/sahpool/digest.html index c4ba6cc1aa..fdcd98ec13 100644 --- a/ext/wasm/tests/opfs/sahpool/digest.html +++ b/ext/wasm/tests/opfs/sahpool/digest.html @@ -36,7 +36,7 @@ *********************************************************************** This is a bugfix test for the OPFS SAHPool VFS. It requires setting up - a database created using v3.49.0 or older, then runnig it again with + a database created using v3.49.0 or older, then running it again with a newer version. */ (function(){ diff --git a/manifest b/manifest index 638b314db7..21e7317364 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\stest\sapp\sto\sassist\sin\svalidating\sthe\sSAHPool\sdigest\scalculation\sfix. -D 2025-02-03T17:21:54.248 +C More\swork\son\sthe\ssahpool\sdigest\sfix.\sNew/fixed\sversions\scan\sread\slegacy\s(no\sdigest)\sfiles\sbut\sthe\sreverse\sis\sonly\spossible\sin\slimited\scircumstances\s(when\sfiles\soriginated\sfrom\sa\slegacy\sversion).\sThe\sburning\squestion\sis\swhether\sthe\sreal\sfix\swould\sbe\sto\sremove\sthis\sdigest\scheck\saltogether,\sas\sit\sonly\sapplies\sin\sa\svery\slimited\scontext,\sand\sthe\sfact\sthat\sit\swas\sbroken\sfor\ssome\s18\smonths\sunnoticed\ssuggests\sthat\sits\svalue\smight\snot\sbe\sworth\sthe\sCPU\scycles. +D 2025-02-26T03:03:08.171 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -645,7 +645,7 @@ F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d2 F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89 F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d -F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js d1d17004bfee7a9159b56888b83345c6219262448297a81966faae4fd28f749c +F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js c18540f86e2d10a48d67f933edb05e29a0e2c904dbdc996f3c765a8b63c49aea F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 9b86ca2d8276cf919fbc9ba2a10e9786033b64f92c2db844d951804dee6c4b4e F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616 F ext/wasm/api/sqlite3-wasm.c 6f9d8529072d072359cd22dc5dfb0572c524684686569cfbd0f9640d7619fc10 @@ -700,8 +700,8 @@ F ext/wasm/tester1.c-pp.js 005a94be87b888ca33aff130aeaef58045781ebfb92e559063d14 F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88 F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2 -F ext/wasm/tests/opfs/sahpool/digest-worker.js cdf4bb6dad5e274985e4b0022d0d85f9e782df03352044d8c7c22532845d7304 -F ext/wasm/tests/opfs/sahpool/digest.html 83d0c2f1dd6fe83e9088c603091514ac8549ee04a4632d8cc51d27fd094f05b3 +F ext/wasm/tests/opfs/sahpool/digest-worker.js f8320caaf6368ee8c59f259de5bebe68232f678390dc773ee61c466e171881dc +F ext/wasm/tests/opfs/sahpool/digest.html 08122dabf8ef56ac7d40f43660e178811166842bb47b37cbb11003030bb9ce09 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 F main.mk 8cfe182232ac7bbc87530792db6f31c09f2a2f35e9887d0412978746efe42ea9 @@ -2211,8 +2211,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9234c33f92d92bfddc6211c9c587f1072e70837c0ffe1416ef7d84d59bacd364 -R 176b17e8248aa3df480fb81ba267bf4c +P a1e304b8020025cc73a658bd8c7697d59b4f3ad96cac0a3e36553a3207d13dc6 +R 428e6412102dca0ea6c390f44246e72c U stephan -Z 9279d9607c28db362f757a9d03a072e6 +Z eddb8c14b5cfddbfe410d5840cc6ef5c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fef85d18dd..2130fc3e97 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a1e304b8020025cc73a658bd8c7697d59b4f3ad96cac0a3e36553a3207d13dc6 +0df62b776c68bebb0e187b353b6f29b0a41a29f0a1c8d6728fa6b9f7ce0d13f7 From 72b5c6db35df9382c976c0e1f125216e62489d4a Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 11 Mar 2025 15:46:23 +0000 Subject: [PATCH 04/26] Avoid running test cases involving ANSI control characters or Unicode on Windows in a slave interpreter, as that combination does not work. FossilOrigin-Name: f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d --- manifest | 23 +++++++++++++---------- manifest.uuid | 2 +- test/shell1.test | 6 +++--- test/shell4.test | 2 +- test/shell5.test | 4 ++-- test/shellA.test | 12 ++++++------ test/tester.tcl | 9 +++++++++ 7 files changed, 35 insertions(+), 23 deletions(-) diff --git a/manifest b/manifest index 1b5df60ebc..5500fc5e4a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C The\ssubstitute\s"puts"\scommand\sused\sby\sthe\sWindows\simplementation\sof\nsqlite3_analyzer\smust\sinvoke\sfflush()\safter\seach\sline\sof\soutput.\s\sOtherwise\nthe\soutput\scan\sbe\struncated\swhen\sredirected\sinto\sa\sfile. -D 2025-03-11T12:19:27.605 +C Avoid\srunning\stest\scases\sinvolving\sANSI\scontrol\scharacters\sor\sUnicode\non\sWindows\sin\sa\sslave\sinterpreter,\sas\sthat\scombination\sdoes\snot\swork. +D 2025-03-11T15:46:23.643 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -1638,16 +1638,16 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21 F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707 F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 -F test/shell1.test 573942b8d0e444956445993d5a5275c6912bc49b654441eec0b5e1e735f2e5b7 +F test/shell1.test a00910c3d811420c15c1411106871c65678516435e352cbb013a09839bf327c6 F test/shell2.test 01a01f76ed98088ce598794fbf5b359e148271541a8ddbf79d21cc353cc67a24 F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8 -F test/shell4.test 522fdc628c55eff697b061504fb0a9e4e6dfc5d9087a633ab0f3dd11bcc4f807 -F test/shell5.test 0e5f8ce08206b9998a778cfe1989e20e47839153c05af2da29198150172e22fc +F test/shell4.test ad7eee983b5e7f1dd92d8c87bc0f39474086bc32c980c00f3934c54aabc636a2 +F test/shell5.test d17e7927ab8b7f720efbdd9b5d05fceb6c3c56c25917901b315400214bf24ef4 F test/shell6.test e3b883b61d4916b6906678a35f9d19054861123ad91b856461e0a456273bdbb8 F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d5c3 F test/shell8.test aea51ecbcd4494c746b096aeff51d841d04d5f0dc4b62eb42427f16109b87acd F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209 -F test/shellA.test 079c05c11947ade4ea8d51053d3abb687ec96a3dce6680d01838519b705190c5 +F test/shellA.test 4ecff8b7b2c0122ba8174abfbcc4b0f59e44d80f2a911068f8cd4cfc6661032d F test/shmlock.test 3dbf017d34ab0c60abe6a44e447d3552154bd0c87b41eaf5ceacd408dd13fda5 F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3 F test/show_speedtest1_rtree.tcl 32e6c5f073d7426148a6936a0408f4b5b169aba5 @@ -1729,7 +1729,7 @@ F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30 F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc -F test/tester.tcl 2244752d5dd5135c03370fa09fec3d02c87440521ca600c09c635b1c2cded9ef +F test/tester.tcl e7f0c903b2d9dcaa44e707db183d22a5fe17b3f9a3c05a5eed1f4cb5c8fe63bc F test/testrunner.tcl 0ffa67806e75aa2c186c63d7d00b16bb45adb91ed6560461fda6dbe3e18c885e x F test/testrunner_data.tcl 6d7e7824bb36278ea65c33f7da6dd3ca101fc7d6f7a765b807dce0aa68c52521 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 @@ -2213,8 +2213,11 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2cfccdbe08b7b14a6b255f7157ac20d0807327adefcb33fcffeeed14c7603fe1 -R 7158e964e2d9b27882ac231601582e3d +P ba058ce90a2ba9ebc4d8fb289108c04f80fa85da01c0b8bd58855681836ba83d +R 2d0f5c98c34656c9305a00020578df75 +T *branch * windows-ansi +T *sym-windows-ansi * +T -sym-trunk * U drh -Z 67031cafd0f114410834393ff697fc3b +Z bdc3151ad87897e8fba6141365623040 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 537d580928..95d38dfa00 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ba058ce90a2ba9ebc4d8fb289108c04f80fa85da01c0b8bd58855681836ba83d +f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d diff --git a/test/shell1.test b/test/shell1.test index 598005a900..f89d34d536 100644 --- a/test/shell1.test +++ b/test/shell1.test @@ -1228,7 +1228,7 @@ do_test shell1-8.1 { FROM pow2, c WHERE pow2.x=ieee754_exponent(c.n); } } {0 47.49000000000000198951966012828052043914794921875} -do_test shell1-8.2 { +do_test_with_ansi_output shell1-8.2 { catchcmd :memory: { .mode box SELECT ieee754(47.49) AS x; @@ -1238,7 +1238,7 @@ SELECT ieee754(47.49) AS x; ├───────────────────────────────┤ │ ieee754(6683623321994527,-47) │ └───────────────────────────────┘}} -do_test shell1-8.3 { +do_test_with_ansi_output shell1-8.3 { catchcmd ":memory: --box" { select ieee754(6683623321994527,-47) as x; } @@ -1254,7 +1254,7 @@ do_test shell1-8.4 { +------------------+-----+ | 6683623321994527 | -47 | +------------------+-----+}} -do_test shell1-8.5 { +do_test_with_ansi_output shell1-8.5 { catchcmd ":memory: --box" { create table t(a text, b int); insert into t values ('too long for one line', 1), ('shorter', NULL); diff --git a/test/shell4.test b/test/shell4.test index 4b7e9b8eec..4275911ef0 100644 --- a/test/shell4.test +++ b/test/shell4.test @@ -140,7 +140,7 @@ do_test shell4-3.1 { close $fd exec $::CLI_ONLY :memory: --interactive ".read t1.txt" } {squirrel} -do_test shell4-3.2 { +do_test_with_ansi_output shell4-3.2 { set fd [open t1.txt wb] puts $fd "SELECT 'pound: \302\243';" close $fd diff --git a/test/shell5.test b/test/shell5.test index 8eb905974b..70a2298bcb 100644 --- a/test/shell5.test +++ b/test/shell5.test @@ -553,7 +553,7 @@ Columns renamed during .import shell5.csv due to duplicates: # Tests for preserving utf-8 that is not also ASCII. # -do_test shell5-6.1 { +do_test_with_ansi_output shell5-6.1 { set out [open shell5.csv w] fconfigure $out -translation lf puts $out {あい,うえお} @@ -566,7 +566,7 @@ SELECT * FROM t1;} } {0 { あい = 1 うえお = 2}} -do_test shell5-6.2 { +do_test_with_ansi_output shell5-6.2 { set out [open shell5.csv w] fconfigure $out -translation lf puts $out {1,2} diff --git a/test/shellA.test b/test/shellA.test index 1a8161bf38..f3959d4283 100644 --- a/test/shellA.test +++ b/test/shellA.test @@ -35,7 +35,7 @@ do_execsql_test shellA-1.0 { # Initial verification that the database created correctly # and that our calls to the CLI are working. # -do_test shellA-1.2 { +do_test_with_ansi_output shellA-1.2 { exec {*}$CLI test.db {.mode box --escape symbol} {SELECT * FROM t1;} } { ┌───┬──────────────────────────┐ @@ -67,7 +67,7 @@ do_test shellA-1.3 { } { ^[[31mVT-100 codes^[[0m } -do_test shellA-1.4 { +do_test_with_ansi_output shellA-1.4 { exec {*}$CLI test.db --escape symbol {SELECT x FROM t1 WHERE a=2;} } { ␛[31mVT-100 codes␛[0m @@ -77,7 +77,7 @@ do_test shellA-1.5 { } { ^[[31mVT-100 codes^[[0m } -do_test shellA-1.6 { +do_test_with_ansi_output shellA-1.6 { exec {*}$CLI test.db {.mode list --escape symbol} {SELECT x FROM t1 WHERE a=2;} } { ␛[31mVT-100 codes␛[0m @@ -134,7 +134,7 @@ do_test shellA-2.4 { # ".mode line" # -do_test shellA-3.1 { +do_test_with_ansi_output shellA-3.1 { exec {*}$CLI test.db --line --escape symbol \ {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)} } { @@ -177,7 +177,7 @@ line # ".mode box" # -do_test shellA-4.1 { +do_test_with_ansi_output shellA-4.1 { exec {*}$CLI test.db --box --escape ascii \ {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)} } { @@ -196,7 +196,7 @@ do_test shellA-4.1 { │ 8 │ last line │ └───┴──────────────────────────┘ } -do_test shellA-4.2 { +do_test_with_ansi_output shellA-4.2 { exec {*}$CLI test.db {.mode qbox} {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)} } { ┌───┬───────────────────────────────────────────┐ diff --git a/test/tester.tcl b/test/tester.tcl index 66d9aeae36..444a9d8433 100644 --- a/test/tester.tcl +++ b/test/tester.tcl @@ -809,6 +809,15 @@ proc do_test {name cmd expected} { flush stdout } +# Like do_test except the test is not run in a slave interpreter +# on Windows because of issues with ANSI and UTF8 I/O on Win11. +# +proc do_test_with_ansi_output {name cmd expected} { + if {![info exists ::SLAVE] || $::tcl_platform(platform)!="windows"} { + uplevel 1 [list do_test $name $cmd $expected] + } +} + proc dumpbytes {s} { set r "" for {set i 0} {$i < [string length $s]} {incr i} { From 42db4d043e8a1f63d809cf6031ba2ab6208f47fd Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 15 Mar 2025 23:42:32 +0000 Subject: [PATCH 05/26] Enhance the fuzzcheck testing tool with new command-line options: --brief, and --slice M N. FossilOrigin-Name: e64132723db0c4f2b9a58932a93beb1671e42006eebc1aeaa8f320e717043051 --- manifest | 13 ++++----- manifest.uuid | 2 +- test/fuzzcheck.c | 74 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 3abd0f8344..dc9851a03a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\suse\sof\sthe\sC99\sflexible\sarray\sfeature,\swhen\savailable,\sso\sthat\nthe\s-fsanitize=bounds-strict\soption\scan\sbe\sused,\swhen\savailable.\n[forum:/forumpost/311dbf9a1cadfae6|Forum\sthread\s311dbf9a1c]. -D 2025-03-15T19:55:19.890 +C Enhance\sthe\sfuzzcheck\stesting\stool\swith\snew\scommand-line\soptions:\n--brief,\sand\s--slice\sM\sN. +D 2025-03-15T23:42:32.735 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -1278,7 +1278,7 @@ F test/fuzz3.test 70ba57260364b83e964707b9d4b5625284239768ab907dd387c740c0370ce3 F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634 F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830 F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2 -F test/fuzzcheck.c e94511f5f5b8c134c83535b4799004b85ead69ed8375d74e9af90e41549a82ad +F test/fuzzcheck.c 19f8af47a5c4ee2c3943fdee270f1f14e3d83fe968a9737a7557fb4e3c06efc1 F test/fuzzdata1.db 3e86d9cf5aea68ddb8e27c02d7dfdaa226347426c7eb814918e4d95475bf8517 F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba @@ -2213,9 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2dd5b6895a3b23c2b9cbf0c1c1e802faf8f2b41ef60819eea25d609755266e64 f101c46cf83e532fd33034abccba496bf395ef10c161af003211614d6581d5eb -R cffcee5ac5b13fdb08ee088881970bf2 -T +closed f101c46cf83e532fd33034abccba496bf395ef10c161af003211614d6581d5eb +P d4307a0d43f42e96ec06ad2c1d8d0f5c8ecae759bae8231b1998633089809f49 +R b41c223f32c59ab49558d35f05a2bfa9 U drh -Z 5f005a89032955065b39a2e143d5c279 +Z 01a995e61d39142e747ab20e203c7c6f # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d6e3fced3a..ed9e64db29 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d4307a0d43f42e96ec06ad2c1d8d0f5c8ecae759bae8231b1998633089809f49 +e64132723db0c4f2b9a58932a93beb1671e42006eebc1aeaa8f320e717043051 diff --git a/test/fuzzcheck.c b/test/fuzzcheck.c index 7d5da2ce27..09898d7b35 100644 --- a/test/fuzzcheck.c +++ b/test/fuzzcheck.c @@ -391,6 +391,21 @@ static void renderDbSqlForCLI( if( nSql>0 && zSql[nSql-1]!='\n' ) fprintf(out, "\n"); } +/* +** Find the tail (the last component) of a pathname. +*/ +static const char *pathTail(const char *zPath){ + const char *zTail = zPath; + while( zPath[0] ){ + if( zPath[0]=='/' && zPath[1]!=0 ) zTail = &zPath[1]; +#ifndef __unix__ + if( zPath[0]=='\\' && zPath[1]!=0 ) zTail = &zPath[1]; +#endif + zPath++; + } + return zTail; +} + /* ** Read the complete content of a file into memory. Add a 0x00 terminator ** and return a pointer to the result. @@ -1847,6 +1862,7 @@ static void showHelp(void){ "Read databases and SQL scripts from SOURCE-DB and execute each script against\n" "each database, checking for crashes and memory leaks.\n" "Options:\n" +" --brief Output only a summary of results at the end\n" " --cell-size-check Set the PRAGMA cell_size_check=ON\n" " --dbid M..N Use only the databases where dbid between M and N\n" " \"M..\" for M and afterwards. Just \"M\" for M only\n" @@ -1873,6 +1889,7 @@ static void showHelp(void){ " --result-trace Show the results of each SQL command\n" " --script Output CLI script instead of running tests\n" " --skip N Skip the first N test cases\n" +" --slice M N Run only the M-th out of each group of N tests\n" " --spinner Use a spinner to show progress\n" " --sqlid M..N Use only SQL where sqlid between M..N\n" " \"M..\" for M and afterwards. Just \"M\" for M only\n" @@ -1887,6 +1904,7 @@ static void showHelp(void){ int main(int argc, char **argv){ sqlite3_int64 iBegin; /* Start time of this program */ int quietFlag = 0; /* True if --quiet or -q */ + int briefFlag = 0; /* Output summary report at the end */ int verboseFlag = 0; /* True if --verbose or -v */ char *zInsSql = 0; /* SQL statement for --load-db or --load-sql */ int iFirstInsArg = 0; /* First argv[] for --load-db or --load-sql */ @@ -1934,6 +1952,8 @@ int main(int argc, char **argv){ int nV; /* How much to increase verbosity with -vvvv */ sqlite3_int64 tmStart; /* Start of each test */ int iEstTime = 0; /* LPF for the time-to-go */ + int iSliceSz = 0; /* Divide the test space into this many pieces */ + int iSliceIdx = 0; /* Only run the piece with this index */ sqlite3_config(SQLITE_CONFIG_URI,1); registerOomSimulator(); @@ -1954,6 +1974,12 @@ int main(int argc, char **argv){ if( z[0]=='-' ){ z++; if( z[0]=='-' ) z++; + if( strcmp(z,"brief")==0 ){ + briefFlag = 1; + quietFlag = 1; + verboseFlag = 1; + eVerbosity = 0; + }else if( strcmp(z,"cell-size-check")==0 ){ cellSzCkFlag = 1; }else @@ -2044,6 +2070,7 @@ int main(int argc, char **argv){ g.uRandom = atoi(argv[++i]); }else if( strcmp(z,"quiet")==0 || strcmp(z,"q")==0 ){ + briefFlag = 0; quietFlag = 1; verboseFlag = 0; eVerbosity = 0; @@ -2062,12 +2089,19 @@ int main(int argc, char **argv){ if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]); nSkip = atoi(argv[++i]); }else + if( strcmp(z,"slice")==0 ){ + if( i>=argc-2 ) fatalError("missing arguments on %s", argv[i]); + iSliceIdx = integerValue(argv[++i]); + iSliceSz = integerValue(argv[++i]); + /* --slice implices --brief */ + briefFlag = 1; + quietFlag = 1; + verboseFlag = 1; + eVerbosity = 0; + }else if( strcmp(z,"spinner")==0 ){ bSpinner = 1; }else - if( strcmp(z,"timer")==0 ){ - bTimer = 1; - }else if( strcmp(z,"sqlid")==0 ){ const char *zDotDot; if( i>=argc-1 ) fatalError("missing arguments on %s", argv[i]); @@ -2093,10 +2127,14 @@ int main(int argc, char **argv){ fatalError("timeout is not available on non-unix systems"); #endif }else + if( strcmp(z,"timer")==0 ){ + bTimer = 1; + }else if( strcmp(z,"vdbe-debug")==0 ){ bVdbeDebug = 1; }else if( strcmp(z,"verbose")==0 ){ + briefFlag = 0; quietFlag = 0; verboseFlag++; eVerbosity++; @@ -2163,6 +2201,12 @@ int main(int argc, char **argv){ fatalError("cannot import into more than one database"); } } + if( iSliceSz<=iSliceIdx + || iSliceSz<=0 + || iSliceIdx<0 + ){ + iSliceSz = iSliceIdx = 0; + } /* Process each source database separately */ for(iSrcDb=0; iSrcDbpNext){ tmStart = timeOfDay(); if( isDbSql(pSql->a, pSql->sz) ){ + if( iSliceSz>0 && (nTest%iSliceSz)!=iSliceIdx ){ + nTest++; + continue; + } sqlite3_snprintf(sizeof(g.zTestName), g.zTestName, "sqlid=%d",pSql->id); if( bScript ){ /* No progress output */ @@ -2510,6 +2558,10 @@ int main(int argc, char **argv){ for(pDb=g.pFirstDb; pDb; pDb=pDb->pNext){ int openFlags; const char *zVfs = "inmem"; + if( iSliceSz>0 && (nTest%iSliceSz)!=iSliceIdx ){ + nTest++; + continue; + } sqlite3_snprintf(sizeof(g.zTestName), g.zTestName, "sqlid=%d,dbid=%d", pSql->id, pDb->id); if( bScript ){ @@ -2616,7 +2668,20 @@ int main(int argc, char **argv){ } } } - if( bScript ){ + if( briefFlag ){ + sqlite3_int64 iElapse = timeOfDay() - iBegin; + if( iSliceSz>0 ){ + printf("%s %s: slice %d/%d of %d tests, %d.%03d seconds\n", + pathTail(argv[0]), pathTail(g.zDbFile), + iSliceIdx, iSliceSz, nTest, + (int)(iElapse/1000), (int)(iElapse%1000)); + }else{ + printf("%s %s: 0 errors, %d tests, %d.%03d seconds\n", + pathTail(argv[0]), pathTail(g.zDbFile), nTest, + (int)(iElapse/1000), (int)(iElapse%1000)); + } + iBegin = timeOfDay(); + }else if( bScript ){ /* No progress output */ }else if( bSpinner ){ int nTotal = g.nDb*g.nSql; @@ -2634,6 +2699,7 @@ int main(int argc, char **argv){ } /* End loop over all source databases */ + if( !quietFlag && !bScript ){ sqlite3_int64 iElapse = timeOfDay() - iBegin; if( g.nInvariant ){ From fc293f7c0e926501b914c63d5e2e4eb900a4833b Mon Sep 17 00:00:00 2001 From: drh <> Date: Sun, 16 Mar 2025 00:13:29 +0000 Subject: [PATCH 06/26] Rework the run-fuzzcheck makefile target so that it better exploit parallelism. Test case "make -j16 run-fuzzcheck FUZZDB=20250222.db" went from 596 seconds down to 107 seconds. FossilOrigin-Name: 18bda13e197e4b4ec7464b3e70012f71edc05f73d8b14bb48bad452f81c7e185 --- main.mk | 135 ++++++++++++++++++++++++++++++++++++++++++++++++-- manifest | 12 ++--- manifest.uuid | 2 +- 3 files changed, 138 insertions(+), 11 deletions(-) diff --git a/main.mk b/main.mk index 4f88a062b4..3b4ce443e5 100644 --- a/main.mk +++ b/main.mk @@ -2192,11 +2192,138 @@ xbin: fuzzcheck-ubsan$(T.exe) # # FUZZDB=test/fuzzdata*.db make run-fuzzcheck # -run-fuzzcheck: fuzzcheck$(T.exe) fuzzcheck-asan$(T.exe) fuzzcheck-ubsan$(T.exe) +# The original rules for this target were like this: +# +# run-fuzzcheck: fuzzcheck$(T.exe) fuzzcheck-asan$(T.exe) fuzzcheck-ubsan$(T.exe) +# @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi +# ./fuzzcheck$(T.exe) --spinner $(FUZZDB) +# ./fuzzcheck-asan$(T.exe) --spinner $(FUZZDB) +# ./fuzzcheck-ubsan$(T.exe) --spinner $(FUZZDB) +# +# What follows is a decomposition of these rules in a way that allows make +# to run things in parallel when using the -jN option. +# +run-fuzzcheck: run-fuzzcheck-n0 +run-fuzzcheck-n0: fuzzcheck$(T.exe) @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi - ./fuzzcheck$(T.exe) --spinner $(FUZZDB) - ./fuzzcheck-asan$(T.exe) --spinner $(FUZZDB) - ./fuzzcheck-ubsan$(T.exe) --spinner $(FUZZDB) + ./fuzzcheck$(T.exe) --slice 0 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n1 +run-fuzzcheck-n1: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 1 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n2 +run-fuzzcheck-n2: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 2 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n3 +run-fuzzcheck-n3: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 3 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n4 +run-fuzzcheck-n4: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 4 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n5 +run-fuzzcheck-n5: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 5 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n6 +run-fuzzcheck-n6: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 6 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n7 +run-fuzzcheck-n7: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 7 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n8 +run-fuzzcheck-n8: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 8 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-n9 +run-fuzzcheck-n9: fuzzcheck$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck$(T.exe) --slice 9 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a0 +run-fuzzcheck-a0: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 0 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a1 +run-fuzzcheck-a1: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 1 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a2 +run-fuzzcheck-a2: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 2 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a3 +run-fuzzcheck-a3: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 3 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a4 +run-fuzzcheck-a4: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 4 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a5 +run-fuzzcheck-a5: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 5 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a6 +run-fuzzcheck-a6: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 6 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a7 +run-fuzzcheck-a7: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 7 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a8 +run-fuzzcheck-a8: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 8 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-a9 +run-fuzzcheck-a9: fuzzcheck-asan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-asan$(T.exe) --slice 9 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u0 +run-fuzzcheck-u0: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 0 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u1 +run-fuzzcheck-u1: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 1 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u2 +run-fuzzcheck-u2: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 2 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u3 +run-fuzzcheck-u3: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 3 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u4 +run-fuzzcheck-u4: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 4 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u5 +run-fuzzcheck-u5: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 5 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u6 +run-fuzzcheck-u6: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 6 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u7 +run-fuzzcheck-u7: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 7 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u8 +run-fuzzcheck-u8: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 8 10 $(FUZZDB) +run-fuzzcheck: run-fuzzcheck-u9 +run-fuzzcheck-u9: fuzzcheck-ubsan$(T.exe) + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + ./fuzzcheck-ubsan$(T.exe) --slice 9 10 $(FUZZDB) + ossshell$(T.exe): $(TOP)/test/ossfuzz.c $(TOP)/test/ossshell.c sqlite3.c sqlite3.h $(T.link) -o $@ $(FUZZCHECK_OPT) $(TOP)/test/ossshell.c \ diff --git a/manifest b/manifest index dc9851a03a..fa23eaa811 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\sfuzzcheck\stesting\stool\swith\snew\scommand-line\soptions:\n--brief,\sand\s--slice\sM\sN. -D 2025-03-15T23:42:32.735 +C Rework\sthe\srun-fuzzcheck\smakefile\starget\sso\sthat\sit\sbetter\sexploit\sparallelism.\nTest\scase\s"make\s-j16\srun-fuzzcheck\sFUZZDB=20250222.db"\nwent\sfrom\s596\sseconds\sdown\sto\s107\sseconds. +D 2025-03-16T00:13:29.453 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -705,7 +705,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk e15a567c0bcc1aed49d53944c92a30705e77d21be087cbc0f7359cf1bddb31c8 +F main.mk ec71d4fda51578c017ea922cc28cb71395e097bd58900943fd31599933299230 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P d4307a0d43f42e96ec06ad2c1d8d0f5c8ecae759bae8231b1998633089809f49 -R b41c223f32c59ab49558d35f05a2bfa9 +P e64132723db0c4f2b9a58932a93beb1671e42006eebc1aeaa8f320e717043051 +R a0d6184ee2c59df7a27bc937eaa19775 U drh -Z 01a995e61d39142e747ab20e203c7c6f +Z 4d1b91d0df9093e02464f9ab269aee1c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ed9e64db29..d21cad483e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e64132723db0c4f2b9a58932a93beb1671e42006eebc1aeaa8f320e717043051 +18bda13e197e4b4ec7464b3e70012f71edc05f73d8b14bb48bad452f81c7e185 From bafddb17d7d3109f4bc2d48c4a07765e410310c8 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 16 Mar 2025 11:24:32 +0000 Subject: [PATCH 07/26] Consolidate some much-duplicated run-fuzzcheck recipe code in main.mk. FossilOrigin-Name: c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa --- main.mk | 61 ++++++++++++++++++++++++++------------------------- manifest | 14 ++++++------ manifest.uuid | 2 +- 3 files changed, 39 insertions(+), 38 deletions(-) diff --git a/main.mk b/main.mk index 3b4ce443e5..ff25719f5f 100644 --- a/main.mk +++ b/main.mk @@ -2203,125 +2203,126 @@ xbin: fuzzcheck-ubsan$(T.exe) # What follows is a decomposition of these rules in a way that allows make # to run things in parallel when using the -jN option. # +FUZZDB_CHECK = @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi run-fuzzcheck: run-fuzzcheck-n0 run-fuzzcheck-n0: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n1 run-fuzzcheck-n1: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n2 run-fuzzcheck-n2: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n3 run-fuzzcheck-n3: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n4 run-fuzzcheck-n4: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n5 run-fuzzcheck-n5: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n6 run-fuzzcheck-n6: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n7 run-fuzzcheck-n7: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n8 run-fuzzcheck-n8: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n9 run-fuzzcheck-n9: fuzzcheck$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck$(T.exe) --slice 9 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a0 run-fuzzcheck-a0: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a1 run-fuzzcheck-a1: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a2 run-fuzzcheck-a2: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a3 run-fuzzcheck-a3: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a4 run-fuzzcheck-a4: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a5 run-fuzzcheck-a5: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a6 run-fuzzcheck-a6: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a7 run-fuzzcheck-a7: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a8 run-fuzzcheck-a8: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a9 run-fuzzcheck-a9: fuzzcheck-asan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-asan$(T.exe) --slice 9 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u0 run-fuzzcheck-u0: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u1 run-fuzzcheck-u1: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u2 run-fuzzcheck-u2: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u3 run-fuzzcheck-u3: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u4 run-fuzzcheck-u4: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u5 run-fuzzcheck-u5: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u6 run-fuzzcheck-u6: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u7 run-fuzzcheck-u7: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u8 run-fuzzcheck-u8: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u9 run-fuzzcheck-u9: fuzzcheck-ubsan$(T.exe) - @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi + $(FUZZDB_CHECK) ./fuzzcheck-ubsan$(T.exe) --slice 9 10 $(FUZZDB) diff --git a/manifest b/manifest index fa23eaa811..c40a6b30a1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rework\sthe\srun-fuzzcheck\smakefile\starget\sso\sthat\sit\sbetter\sexploit\sparallelism.\nTest\scase\s"make\s-j16\srun-fuzzcheck\sFUZZDB=20250222.db"\nwent\sfrom\s596\sseconds\sdown\sto\s107\sseconds. -D 2025-03-16T00:13:29.453 +C Consolidate\ssome\smuch-duplicated\srun-fuzzcheck\srecipe\scode\sin\smain.mk. +D 2025-03-16T11:24:32.667 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -705,7 +705,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk ec71d4fda51578c017ea922cc28cb71395e097bd58900943fd31599933299230 +F main.mk 49dc86f98d28724ffab580159ed46a1c2658d5c01e227794ce8e48128a420967 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e64132723db0c4f2b9a58932a93beb1671e42006eebc1aeaa8f320e717043051 -R a0d6184ee2c59df7a27bc937eaa19775 -U drh -Z 4d1b91d0df9093e02464f9ab269aee1c +P 18bda13e197e4b4ec7464b3e70012f71edc05f73d8b14bb48bad452f81c7e185 +R e37b35226abab9636091409f51115d3e +U stephan +Z a039519926ce716e9a22d933e09747f3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d21cad483e..15d7b90e00 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -18bda13e197e4b4ec7464b3e70012f71edc05f73d8b14bb48bad452f81c7e185 +c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa From 539442300c35e465c7e583949169a99392e8a241 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 16 Mar 2025 12:27:21 +0000 Subject: [PATCH 08/26] Configure-internal doc cleanups. No functional changes. FossilOrigin-Name: be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab --- autosetup/proj.tcl | 11 +++++++++-- autosetup/sqlite-config.tcl | 19 ++++++++++--------- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index f367b01567..e00710b5d4 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1039,8 +1039,15 @@ proc proj-check-soname {{libname "libfoo.so.0"}} { # Checks whether CC supports -fsanitize=X, where X is each entry of # the given list of flags. If any of those flags are supported, it # returns the string "-fsanitize=X..." where X... is a comma-separated -# list of all supported flags. If none of the given options are -# supported then it returns an empty string. +# list of all flags from the original set which are supported. If none +# of the given options are supported then it returns an empty string. +# +# Example: +# +# set f [proj-check-fsanitize {address bounds-check just-testing}] +# +# Will, on many systems, resolve to "-fsanitize=address,bounds-check", +# but may also resolve to "-fsanitize=address". proc proj-check-fsanitize {{opts {address bounds-strict}}} { set sup {} foreach opt $opts { diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 3644b4872a..111d822c22 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -1,6 +1,6 @@ # This file holds functions for autosetup which are specific to the # sqlite build tree. They are in this file, instead of auto.def, so -# that they can be reused in the TEA sub-tree. This file requires +# that they can be reused in the autoconf sub-tree. This file requires # functions from proj.tcl. if {[string first " " $autosetup(srcdir)] != -1} { @@ -24,7 +24,6 @@ use system ; # Will output "Host System" and "Build System" lines if {"--help" ni $::argv} { msg-result "Source dir = $::autosetup(srcdir)" msg-result "Build dir = $::autosetup(builddir)" - use cc cc-db cc-shared cc-lib pkg-config } @@ -445,7 +444,7 @@ proc sqlite-configure-finalize {} { # top-level build and the "autoconf" build, but it's not intended to # be a catch-all dumping ground for such. proc sqlite-post-options-init {} { - define PACKAGE_NAME "sqlite" + define PACKAGE_NAME sqlite define PACKAGE_URL {https://sqlite.org} define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum define PACKAGE_STRING "[get-define PACKAGE_NAME] [get-define PACKAGE_VERSION]" @@ -1285,7 +1284,9 @@ proc sqlite-handle-icu {} { if {[opt-bool icu-collations]} { msg-result "Enabling ICU collations." sqlite-add-feature-flag -shell -DSQLITE_ENABLE_ICU_COLLATIONS - # Recall that shell.c builds with sqlite3.c + # Recall that shell.c builds with sqlite3.c except in the case + # of --disable-static-shell, a combination we do not + # specifically attempt to account for. } } elseif {[opt-bool icu-collations]} { proj-warn "ignoring --enable-icu-collations because neither --with-icu-ldflags nor --with-icu-config provided any linker flags" @@ -1428,7 +1429,7 @@ proc sqlite-handle-dll-basename {} { # The name of the import library is [define]d in SQLITE_OUT_IMPLIB. # # If the configure flag --out-implib is not used (or programmatically -# set) then this is a no-op (but see [sqliet-handle-env-quirks]). If +# set) then this is a no-op (but see [sqlite-handle-env-quirks]). If # that flag is used but the capability is not available, a fatal error # is triggered. # @@ -1507,7 +1508,7 @@ proc sqlite-env-is-unix-on-windows {{envTuple ""}} { # # [define]s SQLITE_DLL_INSTALL_RULES to a symbolic name suffix for a # set of "make install" rules to use for installation of the DLL -# deliverable. The makefile is tasked with with providing rules named +# deliverable. The makefile is tasked with providing rules named # install-dll-NAME which runs the installation for that set, as well # as providing a rule named install-dll which resolves to # install-dll-NAME (perhaps indirectly, depending on whether the DLL @@ -1519,13 +1520,13 @@ proc sqlite-env-is-unix-on-windows {{envTuple ""}} { # # On platforms where an "import library" is conventionally used but # --out-implib was not explicitly used, automatically add that flag. -# This conventionally applies to the "Unix on Windows" environments -# like msys and cygwin. +# This conventionally applies only to the "Unix on Windows" +# environments like msys and cygwin. # # 3) --dll-basename: # # On the same platforms addressed by --out-implib, if --dll-basename -# is not specified, --dll-basename=auto is implied. +# is not explicitly specified, --dll-basename=auto is implied. proc sqlite-handle-env-quirks {} { set instName unix-generic; # name of installation rules set set autoDll 0; # true if --out-implib/--dll-basename should be implied diff --git a/manifest b/manifest index c40a6b30a1..d5e77ae0e7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Consolidate\ssome\smuch-duplicated\srun-fuzzcheck\srecipe\scode\sin\smain.mk. -D 2025-03-16T11:24:32.667 +C Configure-internal\sdoc\scleanups.\sNo\sfunctional\schanges. +D 2025-03-16T12:27:21.085 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl bacaf1ed827067942a6d33f2a5c95bd649ceacae2a8ddc584d0f74456fb9167e -F autosetup/sqlite-config.tcl a7f4d093d63bc1da9ec3d44f392f377ce4c86aa7e48532ae51619e55558f5fbe +F autosetup/proj.tcl 5832513884aab068ab67fc8081a06793749312bce85509f27a822ad1e4df62f0 +F autosetup/sqlite-config.tcl a650eced0ad414bca6335bbd33136dfd0d0dc4dc7c279e7836fcdc471771eb44 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 18bda13e197e4b4ec7464b3e70012f71edc05f73d8b14bb48bad452f81c7e185 -R e37b35226abab9636091409f51115d3e +P c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa +R 3e2bab33a1215d3d1df21710dcb6fd5c U stephan -Z a039519926ce716e9a22d933e09747f3 +Z 677359532c348140e3ec1f8ae1a81268 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 15d7b90e00..8d58c317d5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa +be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab From ab689657943f08ec31d1b73cc8e60bfbb2bd5ad3 Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 16 Mar 2025 13:09:21 +0000 Subject: [PATCH 09/26] Add --asan-fsanitize=... configure flag to the canonical build to optionally set -fsantize flags for the fuzzcheck-asan tool. Teach proj-check-fsanitiz to fail for flags which the compiler emits any warning for, for reasons described in its comments. FossilOrigin-Name: 013730e9b92af39cb7fd2871df9b4bc81b8990f918892bd79370704421672da0 --- Makefile.in | 2 +- auto.def | 5 ++++- autosetup/proj.tcl | 5 ++++- autosetup/sqlite-config.tcl | 4 ++++ main.mk | 4 ++-- manifest | 20 ++++++++++---------- manifest.uuid | 2 +- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Makefile.in b/Makefile.in index 91135edba3..6a2ba323a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -136,7 +136,7 @@ HAVE_WASI_SDK = @HAVE_WASI_SDK@ libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@ # -fsanitize flags for the fuzzcheck-asap app -CFLAGS.fuzzcheck.fsanitize = @CFLAGS_FUZZCHECK_FSANITIZE@ +CFLAGS.fuzzcheck-asan.fsanitize = @CFLAGS_ASAN_FSANITIZE@ T.cc.sqlite = $(T.cc) @TARGET_DEBUG@ diff --git a/auto.def b/auto.def index dcc7371ec0..ee852dddf5 100644 --- a/auto.def +++ b/auto.def @@ -46,7 +46,10 @@ sqlite-configure canonical { define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] - define CFLAGS_FUZZCHECK_FSANITIZE [proj-check-fsanitize {address bounds-strict}] + if {[set fsan [join [opt-val asan-fsanitize] ","]] in {auto ""}} { + set fsan address,bounds-strict + } + define CFLAGS_ASAN_FSANITIZE [proj-check-fsanitize [split $fsan ", "]] sqlite-handle-tcl sqlite-handle-emsdk diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index e00710b5d4..ba5427b6a5 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1051,7 +1051,10 @@ proc proj-check-soname {{libname "libfoo.so.0"}} { proc proj-check-fsanitize {{opts {address bounds-strict}}} { set sup {} foreach opt $opts { - cc-with {} { + # -nooutput is used because -fsanitize=hwaddress will otherwise + # pass this test on x86_64, but then warn at build time that + # "hwaddress is not supported for this target". + cc-with {-nooutput 1} { if {[cc-check-flags "-fsanitize=$opt"]} { lappend sup $opt } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 111d822c22..899d8a507e 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -337,6 +337,10 @@ proc sqlite-configure {buildMode configScript} { => {Enable #line macros in the amalgamation} dynlink-tools => {Dynamically link libsqlite3 to certain tools which normally statically embed it} + asan-fsanitize:=auto + => {Comma- or space-separated list of -fsanitize flags for use with the + fuzzcheck-asan tool. Only those which the compiler claims to support + will actually be used. May be provided multiple times.} } {*} { dump-defines=0 diff --git a/main.mk b/main.mk index ff25719f5f..97a747566b 100644 --- a/main.mk +++ b/main.mk @@ -2169,10 +2169,10 @@ fuzzy: fuzzcheck$(T.exe) xbin: fuzzcheck$(T.exe) # -fsanitize=... flags for fuzzcheck-asan. -CFLAGS.fuzzcheck.fsanitize ?= -fsanitize=address +CFLAGS.fuzzcheck-asan.fsanitize ?= -fsanitize=address fuzzcheck-asan$(T.exe): $(FUZZCHECK_SRC) sqlite3.c sqlite3.h $(FUZZCHECK_DEP) - $(T.link) -o $@ $(CFLAGS.fuzzcheck.fsanitize) $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) \ + $(T.link) -o $@ $(CFLAGS.fuzzcheck-asan.fsanitize) $(FUZZCHECK_OPT) $(FUZZCHECK_SRC) \ sqlite3.c $(LDFLAGS.libsqlite3) fuzzy: fuzzcheck-asan$(T.exe) xbin: fuzzcheck-asan$(T.exe) diff --git a/manifest b/manifest index d5e77ae0e7..6fe3756f0f 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C Configure-internal\sdoc\scleanups.\sNo\sfunctional\schanges. -D 2025-03-16T12:27:21.085 +C Add\s--asan-fsanitize=...\sconfigure\sflag\sto\sthe\scanonical\sbuild\sto\soptionally\sset\s-fsantize\sflags\sfor\sthe\sfuzzcheck-asan\stool.\sTeach\sproj-check-fsanitiz\sto\sfail\sfor\sflags\swhich\sthe\scompiler\semits\sany\swarning\sfor,\sfor\sreasons\sdescribed\sin\sits\scomments. +D 2025-03-16T13:09:21.699 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 2788f5a3c36e26817707003170871936d44f46c5b45f8cbefe07c9f1a51a8988 +F Makefile.in 2c4d3c20e42ddd7596432c8d45feeaf709f93b37279e274ea413034912a4f840 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc ef04498c7e227a0f459b105bb4952f26cc985d1d6340a367e62d5a79c4689dfb F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -14,7 +14,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 619383263dfd0ee31df6a9d3e9828f65943d9fbcd274084046680641e5de53cb +F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 6c98c82f52aa27a5c586080cf7c61c811174c2b6d8b8de33fd657d78d541dd7d F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 5832513884aab068ab67fc8081a06793749312bce85509f27a822ad1e4df62f0 -F autosetup/sqlite-config.tcl a650eced0ad414bca6335bbd33136dfd0d0dc4dc7c279e7836fcdc471771eb44 +F autosetup/proj.tcl bdf0489d4ce8110fc1d4a09b1e2e274e50dd51711637b55c7c63a6a7ecec2aa5 +F autosetup/sqlite-config.tcl 3dddc1f949acfc1cad9faf13ece5095ce5ee34dea96f50aeb96aa91641c3a08c F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -705,7 +705,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 49dc86f98d28724ffab580159ed46a1c2658d5c01e227794ce8e48128a420967 +F main.mk 11b4da311dedf3bf0301999b307c117fe1b5e4fdc260cb35105d235db0fec13b F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2213,8 +2213,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c0d9b9fad3a2f23941927f1be2abded3bde2f2b04f7a5f3cc0a54a978020ebaa -R 3e2bab33a1215d3d1df21710dcb6fd5c +P be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab +R 699bb2f6a1869a511409b94aecd9b45c U stephan -Z 677359532c348140e3ec1f8ae1a81268 +Z b465670c31108cfd99bca4e96066f044 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 8d58c317d5..fec909f33f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -be3a2e631100b711996b9524a54fc604966513a62d83fc916270a6226da7adab +013730e9b92af39cb7fd2871df9b4bc81b8990f918892bd79370704421672da0 From 1774ec3ad0e4d450cc1026a0370f7c53e7fb9705 Mon Sep 17 00:00:00 2001 From: stephan Date: Mon, 17 Mar 2025 14:59:55 +0000 Subject: [PATCH 10/26] Add support for the --with-wasi-sdk configure flag to the autoconf build. FossilOrigin-Name: 44880fa3f0748604ef50b942c28390e041138759efea1d076dfcaa1da48970cb --- autoconf/Makefile.in | 10 +++++++--- autoconf/auto.def | 3 ++- autosetup/sqlite-config.tcl | 9 +++++---- manifest | 17 ++++++++--------- manifest.uuid | 2 +- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index e59864a20b..0fa9065be8 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -50,6 +50,7 @@ CC = @CC@ ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@ ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@ +HAVE_WASI_SDK = @HAVE_WASI_SDK@ CFLAGS = @CFLAGS@ @CPPFLAGS@ # @@ -236,11 +237,14 @@ sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL)) $(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \ $(LDFLAGS) $(LDFLAGS.readline) -all: sqlite3$(T.exe) +sqlite3$(T.exe)-1: +sqlite3$(T.exe)-0: sqlite3$(T.exe) +all: sqlite3$(T.exe)-$(HAVE_WASI_SDK) -install-shell: sqlite3$(T.exe) $(install-dir.bin) +install-shell-0: sqlite3$(T.exe) $(install-dir.bin) $(INSTALL.strip) sqlite3$(T.exe) "$(install-dir.bin)" -install: install-shell +install-shell-1: +install: install-shell-$(HAVE_WASI_SDK) install-headers: $(TOP)/sqlite3.h $(install-dir.include) $(INSTALL.noexec) $(TOP)/sqlite3.h $(TOP)/sqlite3ext.h "$(install-dir.include)" diff --git a/autoconf/auto.def b/autoconf/auto.def index 3ba900d957..5d7ff83913 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -5,6 +5,7 @@ # "autoconf" bundle of the SQLite project. use sqlite-config sqlite-configure autoconf { - sqlite-check-common-bins + sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] + sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 899d8a507e..42b4382cfa 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -258,11 +258,11 @@ proc sqlite-configure {buildMode configScript} { # Options for exotic/alternative build modes alternative-builds { - {canonical} { - # Potential TODO: add --with-wasi-sdk support to the autoconf - # build + {*} { with-wasi-sdk:=/opt/wasi-sdk => {Top-most dir of the wasi-sdk for a WASI build} + } + {canonical} { with-emsdk:=auto => {Top-most dir of the Emscripten SDK installation. @@ -1656,7 +1656,8 @@ proc sqlite-handle-wasi-sdk {} { tcl threadsafe } { - if {[opt-bool $opt]} { + if {[proj-opt-exists $opt] && [opt-bool $opt]} { + # -^^^^ distinguish between canonical and autoconf builds msg-result " --disable-$opt" proj-opt-set $opt 0 } diff --git a/manifest b/manifest index ea7d2d3b75..f9c0490429 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\slong-standing\sfilename\sdigest\scomputation\sbug\sin\sthe\sOPFS\sSAHPool\sVFS\swhich\scaused\sall\sVFS-stored\sfilenames\sto\shave\sa\sdigest\svalue\sof\s0.\sSee\s[/forumpost/042d53c928382021]\sand\sfor\sfull\sdetails. -D 2025-03-16T14:05:42.209 +C Add\ssupport\sfor\sthe\s--with-wasi-sdk\sconfigure\sflag\sto\sthe\sautoconf\sbuild. +D 2025-03-17T14:59:55.092 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -16,11 +16,11 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in 6c98c82f52aa27a5c586080cf7c61c811174c2b6d8b8de33fd657d78d541dd7d +F autoconf/Makefile.in b499f790938d5334a5e22fa9a91af603661e714dea40cd5fb60d03f500b3ae4f F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 -F autoconf/auto.def 8d81c1d728d8462a9b6c1ca0714013bbb097aee0ae5e79309d7939cead98e295 +F autoconf/auto.def 42d239bda4feffe1cf8a431dae35f83d100f2c17ed4b189edeb12f067bd4fa90 F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl bdf0489d4ce8110fc1d4a09b1e2e274e50dd51711637b55c7c63a6a7ecec2aa5 -F autosetup/sqlite-config.tcl 3dddc1f949acfc1cad9faf13ece5095ce5ee34dea96f50aeb96aa91641c3a08c +F autosetup/sqlite-config.tcl a2eb8234de355233787ad7bc926d8a622ef9f97594749374c4360b63c37fc223 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2215,9 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 013730e9b92af39cb7fd2871df9b4bc81b8990f918892bd79370704421672da0 500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865 -R 9266ed4d88e1ccecb16602d4a66164a0 -T +closed 500f2e6ec74b4c0e4ac0365ba4e0d81ed6df8dd09dc0f8af65d294c3453f8865 Closed\sby\sintegrate-merge. +P 493cbe74504e8eb1ca8f2edf49fdab6bebc7fe36ffab06932a4b8c5a4eea86cd +R 2a00f59ca343d92d1ab593996ae581fb U stephan -Z 8dfe9f7d9c954162ba84353f5fc2343c +Z c372334b201c7cc2e21fcf33dbf843ab # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3d3dbbdd32..7e8796ece6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -493cbe74504e8eb1ca8f2edf49fdab6bebc7fe36ffab06932a4b8c5a4eea86cd +44880fa3f0748604ef50b942c28390e041138759efea1d076dfcaa1da48970cb From 7b99cd60632a5bfcb790e55757a69a0e20b3433e Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 17 Mar 2025 15:13:47 +0000 Subject: [PATCH 11/26] Prevent integer overflow when parsing NEAR queries in FTS5. FossilOrigin-Name: 1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6 --- ext/fts5/fts5_expr.c | 3 ++- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ext/fts5/fts5_expr.c b/ext/fts5/fts5_expr.c index d7574aec52..0a9b08ed15 100644 --- a/ext/fts5/fts5_expr.c +++ b/ext/fts5/fts5_expr.c @@ -2015,7 +2015,8 @@ void sqlite3Fts5ParseSetDistance( ); return; } - nNear = nNear * 10 + (p->p[i] - '0'); + if( nNear<214748363 ) nNear = nNear * 10 + (p->p[i] - '0'); + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ } }else{ nNear = FTS5_DEFAULT_NEARDIST; diff --git a/manifest b/manifest index f9c0490429..2b0493d4f9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\ssupport\sfor\sthe\s--with-wasi-sdk\sconfigure\sflag\sto\sthe\sautoconf\sbuild. -D 2025-03-17T14:59:55.092 +C Prevent\sinteger\soverflow\swhen\sparsing\sNEAR\squeries\sin\sFTS5. +D 2025-03-17T15:13:47.985 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -110,7 +110,7 @@ F ext/fts5/fts5Int.h bffbd0acdcdf509899681f4e1cfeef1c955030acd9fe15ff9082410f80c F ext/fts5/fts5_aux.c da4a7a9a11ec15c6df0699d908915a209bcde48f0b04101461316b59f71abffb F ext/fts5/fts5_buffer.c f1e6d0324d7c55329d340673befc26681a372a4d36086caa8d1ec7d7c53066c7 F ext/fts5/fts5_config.c e7d8dd062b44a66cd77e5a0f74f23a2354cd1f3f8575afb967b2773c3384f7f8 -F ext/fts5/fts5_expr.c 887a611b34094c828ff5fb19bbc50a6b1bbfd28791db01b0c8bf722e3c9f437a +F ext/fts5/fts5_expr.c be9e5f7f11d87e7bd3680832c93c13050fe351994b5052b0215c2ef40312c23a F ext/fts5/fts5_hash.c a6266cedd801ab7964fa9e74ebcdda6d30ec6a96107fa24148ec6b7b5b80f6e0 F ext/fts5/fts5_index.c d171f2a507abccb3d524bf461b01f0d3971a9bf221be622ac7c671a991cb62ee F ext/fts5/fts5_main.c 57933c18efe1058d8871199875c7a59744dabc3904f3aefbf9ff4a4e11fc79e2 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 493cbe74504e8eb1ca8f2edf49fdab6bebc7fe36ffab06932a4b8c5a4eea86cd -R 2a00f59ca343d92d1ab593996ae581fb -U stephan -Z c372334b201c7cc2e21fcf33dbf843ab +P 44880fa3f0748604ef50b942c28390e041138759efea1d076dfcaa1da48970cb +R 62b06ea4ad92e5bc3b483d586cc748b3 +U drh +Z 243e630e7be3fc1ae898e3d108d054eb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 7e8796ece6..5b483f0349 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -44880fa3f0748604ef50b942c28390e041138759efea1d076dfcaa1da48970cb +1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6 From 17df9cd909e06800986a4dc34f3f42bc863f57ec Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 18 Mar 2025 10:28:56 +0000 Subject: [PATCH 12/26] Update the docs in tool/mkccode.tcl to reflect that it's more generic than it was when the docs were written. Change the shebang line to use /bin/env tclsh instead of a hard-coded tclsh path. FossilOrigin-Name: 9300f7f42dfd143f77fd51aa9e080099540854d36b6997ab1a16be7d77f78d8e --- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/mkccode.tcl | 13 ++++++------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index 2b0493d4f9..170e6538ad 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Prevent\sinteger\soverflow\swhen\sparsing\sNEAR\squeries\sin\sFTS5. -D 2025-03-17T15:13:47.985 +C Update\sthe\sdocs\sin\stool/mkccode.tcl\sto\sreflect\sthat\sit's\smore\sgeneric\sthan\sit\swas\swhen\sthe\sdocs\swere\swritten.\sChange\sthe\sshebang\sline\sto\suse\s/bin/env\stclsh\sinstead\sof\sa\shard-coded\stclsh\spath. +D 2025-03-18T10:28:56.725 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -2151,7 +2151,7 @@ F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439 F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176 F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a F tool/mkautoconfamal.sh c5e65fa1c922f2e3b3e4f6cd0331ec7d84bdef085f32cb1c46673cdf95ec8090 -F tool/mkccode.tcl 210159febe0ef0ecbc53c79833500663ceaba0115b2b374405818dc835b5f84b x +F tool/mkccode.tcl c42a8f8cf78f92e83795d5447460dbce7aaf78a3bbf9082f1507dc71a3665f3c x F tool/mkctimec.tcl f76dbfc74cefad8d126384ba3263677939f077bd184fcdf8c592a1daf64f50c3 x F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559 F tool/mkmsvcmin.tcl d76c45efda1cce2d4005bcea7b8a22bb752e3256009f331120fb4fecb14ebb7a @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 44880fa3f0748604ef50b942c28390e041138759efea1d076dfcaa1da48970cb -R 62b06ea4ad92e5bc3b483d586cc748b3 -U drh -Z 243e630e7be3fc1ae898e3d108d054eb +P 1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6 +R a929af68b23ab89a4ef69e835299c074 +U stephan +Z cc5c9a3f1559d25c8e48b1b5fb513517 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5b483f0349..9ff19c6263 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6 +9300f7f42dfd143f77fd51aa9e080099540854d36b6997ab1a16be7d77f78d8e diff --git a/tool/mkccode.tcl b/tool/mkccode.tcl index ecafbdadb9..8b4fae82c9 100755 --- a/tool/mkccode.tcl +++ b/tool/mkccode.tcl @@ -1,17 +1,16 @@ -#!/usr/bin/tclsh +#!/bin/env tclsh # -# Use this script to build C-language source code for a program that uses -# tclsqlite.c together with custom TCL scripts and/or C extensions for -# either SQLite or TCL. +# This script is used to amalgamate C source code files into a single +# unit. # # Usage example: # # tclsh mkccode.tcl -DENABLE_FEATURE_XYZ demoapp.c.in >demoapp.c # # The demoapp.c.in file contains a mixture of C code, TCL script, and -# processing directives used by mktclsqliteprog.tcl to build the final C-code -# output file. Most lines of demoapp.c.in are copied straight through into -# the output. The following control directives are recognized: +# processing directives used by mkccode.tcl to build the final C-code +# output file. Most lines of demoapp.c.in are copied straight through +# into the output. The following control directives are recognized: # # BEGIN_STRING # From a49265b71778cc061ea69bb1dda8d12765512468 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 18 Mar 2025 11:36:15 +0000 Subject: [PATCH 13/26] General updates to autosetup/README.md. FossilOrigin-Name: be8ad5cf579662c54b7e7bc492d8ca03b1f9032c5dad9a6b20590ca1ac00840b --- autosetup/README.md | 105 +++++++++++++++++++++++++------------------- manifest | 12 ++--- manifest.uuid | 2 +- 3 files changed, 68 insertions(+), 51 deletions(-) diff --git a/autosetup/README.md b/autosetup/README.md index 2d6cf723c0..a61f94fbda 100644 --- a/autosetup/README.md +++ b/autosetup/README.md @@ -14,7 +14,7 @@ build infrastructure. It is not an [Autosetup][] reference. - Symbolic Names of Feature Flags - Do Not Update Global Shared State - [Updating Autosetup](#updating) - - [Patching Autosetup for Project-local changes](#patching) + - ***[Patching Autosetup for Project-local changes](#patching)*** ------------------------------------------------------------------------ @@ -42,12 +42,13 @@ following files: (e.g. Fossil), and personal projects of SQLite's developers. It is essentially an amalgamation of a decade's worth of autosetup-related utility code. -- [auto.def][]: the primary driver for the `./configure` process. - When we talk about "the configure script," we're referring to - this file. - [sqlite-config.tcl][]: utility code which is too project-specific for `proj.tcl`. We split this out of `auto.def` so that it can be used by both `auto.def` and... +- [auto.def][]: the primary driver for the `./configure` process. + When we talk about "the configure script," we're technically + referring to this file, though it actually contains very little + of the TCL code. - [autoconf/auto.def][]: the main driver script for the "autoconf" bundle's configure script. It is essentially a slightly trimmed-down version of the main `auto.def` file. The `autoconf` dir was ported @@ -61,11 +62,11 @@ Autosetup API Tips This section briefly covers only APIs which are frequently useful in day-to-day maintenance and might not be immediately recognized as such -obvious from a casual perusal of the relevant TCL files. The complete -docs of those with `proj-` prefix can be found in [proj.tcl][] and -those with an `sqlite-` prefix are in [sqlite-config.tcl][]. The -others are scattered around [the TCL files in -./autosetup](/dir/autosetup). +from a casual perusal of the relevant TCL files. The complete docs of +those with `proj-` prefix can be found in [proj.tcl][] and those with +an `sqlite-` prefix are in [sqlite-config.tcl][]. The others are part +of Autosetup's core packages and are scattered around [the TCL files +in ./autosetup](/dir/autosetup). In (mostly) alphabetical order: @@ -83,19 +84,14 @@ In (mostly) alphabetical order: Works like `get-env` but will, if that function finds no match, look for a file named `./.env-$VAR` and, if found, return its trimmed contents. This can be used, e.g., to set a developer's - local preferences for the default `CFLAGS`. - -- **`define-for-opt flag defineName ?checkingMsg? ?yesVal=1? ?noVal=0?`**\ - `[define $defineName]` to either `$yesVal` or `$noVal`, depending on - whether `--$flag` is truthy or not. `$checkingMsg` is a - human-readable description of the check being made, e.g. "enable foo?" - If no `checkingMsg` is provided, the operation is silent.\ - Potential TODO: change the final two args to `-yes` and `-no` - flags. They're rarely needed, though: search [auto.def][] for - `TSTRNNR_OPTS` for an example of where they are used. + local preferences for the default `CFLAGS`.\ + Tip: adding `-O0` to `.env-CFLAGS` reduces rebuild times + considerably at the cost of performance in `make devtest` and the + like. - **`proj-fatal msg`**\ - Emits `$msg` to stderr and exits with non-zero. + Emits `$msg` to stderr and exits with non-zero. Its differences from + autosetup's `user-error` are purely cosmetic. - **`proj-if-opt-truthy flag thenScript ?elseScript?`**\ Evals `thenScript` if the given `--flag` is truthy, else it @@ -117,7 +113,10 @@ In (mostly) alphabetical order: else 0. This distinction can be used to determine, e.g., whether `--with-readline` was provided or whether we're searching for readline by default. In the former case, failure to find it should - be treated as fatal, where in the latter case it's not. + be treated as fatal, where in the latter case it's not.\ + Unlike most functions which deal with `--flags`, this one does not + validate that `$FLAG` is a registered flag so will not fail fatally + if `$FLAG` is not registered as an Autosetup option. - **`proj-val-truthy value`**\ Returns 1 if `$value` is "truthy," See `proj-opt-truthy` for the definition @@ -139,6 +138,15 @@ In (mostly) alphabetical order: The shell-specific counterpart of `sqlite-add-feature-flag` which only adds the given flag(s) to the CLI-shell-specific CFLAGS. +- **`sqlite-configure BUILD-NAME {script}`**\ + This is where all configure `--flags` are defined for all known + build modes ("canonical" or "autoconf"). After processing all flags, + this function runs `$script`, which contains the build-mode-specific + configuration bits, and then runs any finalization bits which are + common to all build modes. The `auto.def` files are intended to contain + exactly two commands: + `use sqlite-config; sqlite-configure BUILD-NAME {script}` + - **`user-notice msg`**\ Queues `$msg` to be sent to stderr, but does not emit it until either `show-notices` is called or the next time autosetup would @@ -152,13 +160,18 @@ In (mostly) alphabetical order: Ensuring TCL Compatibility ======================================================================== -It is important that any TCL files used by the configure process -remain compatible with both [JimTCL][] and the canonical TCL. Though -JimTCL has outstanding compatibility with canonical TCL, it does have -a few corners with incompatibilities, e.g. regular expressions. If a -script runs in JimTCL without using any JimTCL-specific features, then -it's a certainty that it will run in canonical TCL as well. The -opposite, however, is not _always_ the case. +One of the significant benefits of using Autosetup is that (A) this +project uses many TCL scripts in the build process and (B) Autosetup +comes with a TCL interpreter named [JimTCL][]. + +It is important that any TCL files used by the configure process and +makefiles remain compatible with both [JimTCL][] and the canonical +TCL. Though JimTCL has outstanding compatibility with canonical TCL, +it does have a few corners with incompatibilities, e.g. regular +expressions. If a script runs in JimTCL without using any +JimTCL-specific features, then it's a certainty that it will run in +canonical TCL as well. The opposite, however, is not _always_ the +case. When [`./configure`](/file/configure) is run, it goes through a bootstrapping process to find a suitable TCL with which to run the @@ -187,14 +200,17 @@ compatibility across TCL implementations: before looking for a system-level `tclsh`. Be aware, though, that `make distclean` will remove that file. -**Note that `jimsh0` is distinctly different from the `jimsh`** which -gets built for code-generation purposes. The latter requires +**Note that `./jimsh0` is distinctly different from the `./jimsh`** +which gets built for code-generation purposes. The latter requires non-default build flags to enable features which are platform-dependent, most notably to make its `[file normalize]` work. This means, for example, that the configure script and its utility APIs must not use `[file normalize]`, but autosetup provides a TCL-only implementation of `[file-normalize]` (note the dash) for -portable use in the configure script. +portable use in the configure script. Contrariwise, code-generation +scripts invoked via `make` may use `[file normalize]`, as they'll use +`./jimsh` or `tclsh` instead of `./jimsh0`. + Known TCL Incompatibilities ------------------------------------------------------------------------ @@ -221,6 +237,7 @@ A summary of known incompatibilities in JimTCL - `regsub` does not support the `\y` flag. A workaround is demonstrated in [](/info/c2e5dd791cce3ec4). + Design Conventions ======================================================================== @@ -247,8 +264,9 @@ dots are not permitted. The `X.y` convention is used in the makefiles primarily because the person who did the initial port finds that considerably easier on the eyes and fingers. In practice, the `X_Y` form of such exports is used -exactly once in [Makefile.in][], where it's translated into into `X.y` -form for consumption by [Makefile.in][] and [main.mk][]. For example: +exactly once in [Makefile.in][], where it's translated from `@X_Y@` +into into `X.y` form for consumption by [Makefile.in][] and +[main.mk][]. For example: > ``` @@ -265,9 +283,9 @@ of taste, for which there is no accounting.) Do Not Update Global Shared State ------------------------------------------------------------------------ -In both the legacy Autotools-driven build and in common Autosetup -usage, feature tests performed by the configure script may amend -global flags such as `LIBS`, `LDFLAGS`, and `CFLAGS`[^as-cflags]. That's +In both the legacy Autotools-driven build and common Autosetup usage, +feature tests performed by the configure script may amend global flags +such as `LIBS`, `LDFLAGS`, and `CFLAGS`[^as-cflags]. That's appropriate for a makefile which builds a single deliverable, but less so for makefiles which produce multiple deliverables. Drawbacks of that approach include: @@ -275,8 +293,8 @@ that approach include: - It's unlikely that every single deliverable will require the same core set of those flags. - It can be difficult to determine the origin of any given change to - that global state because those changes are hidden behind voodoo performed - outside the immediate visibility of the configure script's + that global state because those changes are hidden behind voodoo + performed outside the immediate visibility of the configure script's maintainer. - It can force the maintainers of the configure script to place tests in a specific order so that the resulting flags get applied at @@ -357,12 +375,11 @@ Patching Autosetup for Project-local Changes Autosetup reserves the flag name **`--debug`** for its own purposes, and its own special handling of `--enable-...` flags makes `--debug` -an alias for `--enable-debug`. As we have a long history of using -`--enable-debug` for this project's own purposes, we patch autosetup -to use the name `--autosetup-debug` in place of `--debug`. That -requires (as of this writing) four small edits in -[](/file/autosetup/autosetup), as demonstrated in [check-in -3296c8d3](/info/3296c8d3). +an alias for `--enable-debug`. As this project has a long history of +using `--enable-debug`, we patch autosetup to use the name +`--autosetup-debug` in place of `--debug`. That requires (as of this +writing) four small edits in [](/file/autosetup/autosetup), as +demonstrated in [check-in 3296c8d3](/info/3296c8d3). If autosetup is upgraded and this patch is _not_ applied the invoking `./configure` will fail loudly because of the declaration of the diff --git a/manifest b/manifest index 170e6538ad..df636785e9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\sthe\sdocs\sin\stool/mkccode.tcl\sto\sreflect\sthat\sit's\smore\sgeneric\sthan\sit\swas\swhen\sthe\sdocs\swere\swritten.\sChange\sthe\sshebang\sline\sto\suse\s/bin/env\stclsh\sinstead\sof\sa\shard-coded\stclsh\spath. -D 2025-03-18T10:28:56.725 +C General\supdates\sto\sautosetup/README.md. +D 2025-03-18T11:36:15.450 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -37,7 +37,7 @@ F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0 F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4 F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e -F autosetup/README.md b306314e8a87ccf873cb5b2a360c4a27bbf841df5b76f3acbd65322cff165476 +F autosetup/README.md f98cc827a162a1da4877e9656d749d414ba3f408d457d30e029afc66590c00c3 F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 1a5283d7dab210badb8a33eac29f44dc8c1c210ffb5ef84f43e348170aa406a6 -R a929af68b23ab89a4ef69e835299c074 +P 9300f7f42dfd143f77fd51aa9e080099540854d36b6997ab1a16be7d77f78d8e +R a74ff5093dd14720da044ecaa9143a8b U stephan -Z cc5c9a3f1559d25c8e48b1b5fb513517 +Z 7470894fe299edfa712004a6589105cc # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9ff19c6263..456e6406f4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9300f7f42dfd143f77fd51aa9e080099540854d36b6997ab1a16be7d77f78d8e +be8ad5cf579662c54b7e7bc492d8ca03b1f9032c5dad9a6b20590ca1ac00840b From ccda0f008a9817edc402671baf09ce2741440593 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 18 Mar 2025 12:31:09 +0000 Subject: [PATCH 14/26] Very slight simplification of the run-fuzzcheck rules. FossilOrigin-Name: c858a39fad30c46aec6a1f81b2d4e56c18ecf7f5cb6d2fe4a32c4b3bb1a6ed64 --- main.mk | 93 ++++++++++++++++++--------------------------------- manifest | 12 +++---- manifest.uuid | 2 +- 3 files changed, 39 insertions(+), 68 deletions(-) diff --git a/main.mk b/main.mk index 97a747566b..93cfe4b7c1 100644 --- a/main.mk +++ b/main.mk @@ -2203,126 +2203,97 @@ xbin: fuzzcheck-ubsan$(T.exe) # What follows is a decomposition of these rules in a way that allows make # to run things in parallel when using the -jN option. # -FUZZDB_CHECK = @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi +FUZZDB-check: + @if test "$(FUZZDB)" = ""; then echo 'ERROR: No FUZZDB specified. Rerun with FUZZDB=filename'; exit 1; fi run-fuzzcheck: run-fuzzcheck-n0 -run-fuzzcheck-n0: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n0: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n1 -run-fuzzcheck-n1: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n1: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n2 -run-fuzzcheck-n2: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n2: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n3 -run-fuzzcheck-n3: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n3: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n4 -run-fuzzcheck-n4: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n4: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n5 -run-fuzzcheck-n5: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n5: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n6 -run-fuzzcheck-n6: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n6: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n7 -run-fuzzcheck-n7: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n7: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n8 -run-fuzzcheck-n8: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n8: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-n9 -run-fuzzcheck-n9: fuzzcheck$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-n9: FUZZDB-check fuzzcheck$(T.exe) ./fuzzcheck$(T.exe) --slice 9 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a0 -run-fuzzcheck-a0: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a0: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a1 -run-fuzzcheck-a1: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a1: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a2 -run-fuzzcheck-a2: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a2: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a3 -run-fuzzcheck-a3: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a3: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a4 -run-fuzzcheck-a4: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a4: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a5 -run-fuzzcheck-a5: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a5: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a6 -run-fuzzcheck-a6: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a6: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a7 -run-fuzzcheck-a7: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a7: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a8 -run-fuzzcheck-a8: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a8: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-a9 -run-fuzzcheck-a9: fuzzcheck-asan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-a9: FUZZDB-check fuzzcheck-asan$(T.exe) ./fuzzcheck-asan$(T.exe) --slice 9 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u0 -run-fuzzcheck-u0: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u0: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 0 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u1 -run-fuzzcheck-u1: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u1: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 1 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u2 -run-fuzzcheck-u2: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u2: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 2 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u3 -run-fuzzcheck-u3: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u3: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 3 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u4 -run-fuzzcheck-u4: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u4: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 4 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u5 -run-fuzzcheck-u5: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u5: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 5 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u6 -run-fuzzcheck-u6: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u6: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 6 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u7 -run-fuzzcheck-u7: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u7: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 7 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u8 -run-fuzzcheck-u8: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u8: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 8 10 $(FUZZDB) run-fuzzcheck: run-fuzzcheck-u9 -run-fuzzcheck-u9: fuzzcheck-ubsan$(T.exe) - $(FUZZDB_CHECK) +run-fuzzcheck-u9: FUZZDB-check fuzzcheck-ubsan$(T.exe) ./fuzzcheck-ubsan$(T.exe) --slice 9 10 $(FUZZDB) diff --git a/manifest b/manifest index df636785e9..c88b7cd65c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C General\supdates\sto\sautosetup/README.md. -D 2025-03-18T11:36:15.450 +C Very\sslight\ssimplification\sof\sthe\srun-fuzzcheck\srules. +D 2025-03-18T12:31:09.432 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -707,7 +707,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 11b4da311dedf3bf0301999b307c117fe1b5e4fdc260cb35105d235db0fec13b +F main.mk 7006135b902177f7c8bca2733a6820b72a0c6f5a47412b2a7c86668f0398f1fd F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 9300f7f42dfd143f77fd51aa9e080099540854d36b6997ab1a16be7d77f78d8e -R a74ff5093dd14720da044ecaa9143a8b +P be8ad5cf579662c54b7e7bc492d8ca03b1f9032c5dad9a6b20590ca1ac00840b +R a4bbfb3e7a3979ba53919b4ea1630c0c U stephan -Z 7470894fe299edfa712004a6589105cc +Z 147fd9bb2dc3e368a79a71e178280d71 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 456e6406f4..73ba648652 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -be8ad5cf579662c54b7e7bc492d8ca03b1f9032c5dad9a6b20590ca1ac00840b +c858a39fad30c46aec6a1f81b2d4e56c18ecf7f5cb6d2fe4a32c4b3bb1a6ed64 From e435547beb9ffc3f88670e218248801f96956ccc Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 18 Mar 2025 13:52:53 +0000 Subject: [PATCH 15/26] Internal doc touchups in ext/wasm/mkwasmbuilds.c. No functional changes. FossilOrigin-Name: 47d34260e74912eeae704bff7c4314b893af86ee66dd96a1bc6f450d3e290702 --- ext/wasm/mkwasmbuilds.c | 7 ++++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ext/wasm/mkwasmbuilds.c b/ext/wasm/mkwasmbuilds.c index e3cd34b00d..d13302769e 100644 --- a/ext/wasm/mkwasmbuilds.c +++ b/ext/wasm/mkwasmbuilds.c @@ -45,6 +45,7 @@ ** "sqlite3-wasmfs" build, only "esm" (ES6 Module) is legal. */ #define JS_BUILD_MODES vanilla esm bundler-friendly node +/* Separator to help eyeballs find the different sections */ static const char * zBanner = "\n########################################################################\n"; @@ -140,8 +141,8 @@ static void mk_prologue(void){ ** mk_lib_mode(). ** ** Maintenance reminder: do not combine flags within this enum, -** e.g. LIBMODE_BUNDLER_FRIEND=0x02|LIBMODE_ESM, as that will lead to -** breakage in some of the flag checks. +** e.g. LIBMODE_BUNDLER_FRIENDLY=0x02|LIBMODE_ESM, as that will lead +** to breakage in some of the flag checks. */ enum LibModeFlags { /* Indicates an ESM module build. */ @@ -208,7 +209,7 @@ static void mk_pre_post(const char *zName /* build name */, pf("$(eval $(call SQLITE.CALL.C-PP.FILTER,$(extern-post-js.js.in),$(extern-post-js.js.%s-%s)," "$(c-pp.D.%s-%s)))\n", zNM, zNM); - /* Combine flags for use with emcc... */ + /* Combined flags for use with emcc... */ pf("pre-post-common.flags.%s-%s := " "$(pre-post-common.flags) " "--post-js=$(post-js.js.%s-%s) " diff --git a/manifest b/manifest index c88b7cd65c..83f99df4a9 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Very\sslight\ssimplification\sof\sthe\srun-fuzzcheck\srules. -D 2025-03-18T12:31:09.432 +C Internal\sdoc\stouchups\sin\sext/wasm/mkwasmbuilds.c.\sNo\sfunctional\schanges. +D 2025-03-18T13:52:53.910 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -680,7 +680,7 @@ F ext/wasm/index-dist.html 56132399702b15d70c474c3f1952541e25cb0922942868f70daf1 F ext/wasm/index.html bcaa00eca521b372a6a62c7e7b17a870b0fcdf3e418a5921df1fd61e5344080d F ext/wasm/jaccwabyt/jaccwabyt.js 6e4f26d0edb5c2e7d381b7eff1924832a040a12274afab2d1e1789027e9f6c5c F ext/wasm/jaccwabyt/jaccwabyt.md 1128e3563e7eff90b5a373395251fc76cb32386fad1fea6075b0f34a8f1b9bdf -F ext/wasm/mkwasmbuilds.c 082b7372db68c2d4cd9f55e7cde8eb1b83e9569e520984e6b08cb62606f3bf38 +F ext/wasm/mkwasmbuilds.c 6e0b22002bc520b7af053681571a96d30049a51f7f1389e81c524e8d420f5d40 F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337 F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96 F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P be8ad5cf579662c54b7e7bc492d8ca03b1f9032c5dad9a6b20590ca1ac00840b -R a4bbfb3e7a3979ba53919b4ea1630c0c +P c858a39fad30c46aec6a1f81b2d4e56c18ecf7f5cb6d2fe4a32c4b3bb1a6ed64 +R ea53eb835c0e9a65950d5e9bbfcf794b U stephan -Z 147fd9bb2dc3e368a79a71e178280d71 +Z 336f18ce7773ad9574acc5a45857cc6c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 73ba648652..4147b282f9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c858a39fad30c46aec6a1f81b2d4e56c18ecf7f5cb6d2fe4a32c4b3bb1a6ed64 +47d34260e74912eeae704bff7c4314b893af86ee66dd96a1bc6f450d3e290702 From 31fd886576455c071efd9d7b939fa7225ec9a6ec Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 18 Mar 2025 19:21:04 +0000 Subject: [PATCH 16/26] Fix a problem that could occur when the RHS of an IN operator was a compound SELECT featuring an ORDER BY on a subquery that was flattened into one of the component SELECTs introduced by [baa83b460c677c21]. Forum post [/forumpost/1e17219c88]. FossilOrigin-Name: 7101ccd5331e36fd1a539f540e79ce0ce159be76ec422e1d9436eec6f3908c6e --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/select.c | 1 + test/bloom1.test | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 83f99df4a9..7345476bdf 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Internal\sdoc\stouchups\sin\sext/wasm/mkwasmbuilds.c.\sNo\sfunctional\schanges. -D 2025-03-18T13:52:53.910 +C Fix\sa\sproblem\sthat\scould\soccur\swhen\sthe\sRHS\sof\san\sIN\soperator\swas\sa\scompound\sSELECT\sfeaturing\san\sORDER\sBY\son\sa\ssubquery\sthat\swas\sflattened\sinto\sone\sof\sthe\scomponent\sSELECTs\sintroduced\sby\s[baa83b460c677c21].\sForum\spost\s[/forumpost/1e17219c88]. +D 2025-03-18T19:21:04.551 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -783,7 +783,7 @@ F src/printf.c 33fc0d7643c848a098afdcb6e1db6de12379d47084b1cd0912cfce1d09345e44 F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 -F src/select.c 8c273248e38a8a7286abe3f41c1931cc65eff602fef128acc0cc0484e1b7abb3 +F src/select.c bfe14cdfceba54744b1c6c29099313f5173a0793dfaff0cd484774e9d05dbeab F src/shell.c.in 248050551cad788f8bb4b4728e00d8e36a10130d2d101e55cd51cfee03df91ff F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 @@ -975,7 +975,7 @@ F test/bind2.test 918bc35135f4141809ead7585909cde57d44db90a7a62aef540127148f91aa F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0 F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142 F test/blob.test e7ac6c7d3a985cc4678c64f325292529a69ae252 -F test/bloom1.test cf613a27054bbaf61c5bfc440a5cfd3ff76798d0695f3fc5e5d1bbc819b8dab1 +F test/bloom1.test 04f3a17df8912bfdc292c41b59d79f93893fe69799f3089a64451f9112f9658f F test/boundary1.tcl 6421b2d920d8b09539503a8673339d32f7609eb1 F test/boundary1.test 66d7f4706ccdb42d58eafdb081de07b0eb42d77b F test/boundary2.tcl e34ef4e930cf1083150d4d2c603e146bd3b76bcb @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c858a39fad30c46aec6a1f81b2d4e56c18ecf7f5cb6d2fe4a32c4b3bb1a6ed64 -R ea53eb835c0e9a65950d5e9bbfcf794b -U stephan -Z 336f18ce7773ad9574acc5a45857cc6c +P 47d34260e74912eeae704bff7c4314b893af86ee66dd96a1bc6f450d3e290702 +R 4ad094e1728498f359eaedd7a6999953 +U dan +Z 7c0745034fb8db0f32cdbdfb739169c4 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4147b282f9..14b3bf9e1c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -47d34260e74912eeae704bff7c4314b893af86ee66dd96a1bc6f450d3e290702 +7101ccd5331e36fd1a539f540e79ce0ce159be76ec422e1d9436eec6f3908c6e diff --git a/src/select.c b/src/select.c index eedbd82818..b2f2cc7fb8 100644 --- a/src/select.c +++ b/src/select.c @@ -3247,6 +3247,7 @@ static int multiSelect( multi_select_end: pDest->iSdst = dest.iSdst; pDest->nSdst = dest.nSdst; + pDest->iSDParm2 = dest.iSDParm2; if( pDelete ){ sqlite3ParserAddCleanup(pParse, sqlite3SelectDeleteGeneric, pDelete); } diff --git a/test/bloom1.test b/test/bloom1.test index 151f364ae0..f8efcc1846 100644 --- a/test/bloom1.test +++ b/test/bloom1.test @@ -183,6 +183,47 @@ do_execsql_test 4.3 { do_execsql_test 4.4 { SELECT * FROM t0 LEFT JOIN t1 LEFT JOIN t2 ON (b NOTNULL)==(c IN ()) WHERE c; } {xyz {} 7.0} + +reset_db +do_execsql_test 5.0 { + CREATE TABLE t1 (c1); + INSERT INTO t1 VALUES (101); + CREATE TABLE t2 ( x ); + INSERT INTO t2 VALUES(404); +} + +do_execsql_test 5.1 { + SELECT 'val' in ( + select 'val' from ( select 'valueB' from t1 order by 1 ) + union all + select 'val' + ); +} {1} + +do_execsql_test 5.2 { + select * from t2 + where 'val' in ( + select 'val' from ( select 'valueB' from t1 order by 1 ) + union all + select 'val' + ); +} {404} + +do_execsql_test 5.3 { + SELECT subq_1.c_0 as c_0 + FROM ( SELECT 0 as c_0) as subq_1 + WHERE (subq_1.c_0) IN ( + SELECT subq_2.c_0 as c_0 + FROM ( + SELECT 0 as c_0 + FROM t1 as ref_1 + WHERE (ref_1.c1) = (2) + ORDER BY c_0 desc + ) as subq_2 + UNION ALL + SELECT 0 as c_0 + ); +} {0} finish_test From 8db881d0550f664fb4f32a088818553d5fef27e8 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 18 Mar 2025 20:15:16 +0000 Subject: [PATCH 17/26] Change the generate_series() table-valued function so that its rowid is just an alias for its value. This allows it to be used as the RHS operand of a RIGHT JOIN. This fixes the issue raised by [forum:/forumpost/1e17219c88|forum post 1e17219c88]. FossilOrigin-Name: 77db4d85e70fbf358ae2321c2601966666bdb4d971d7c113ce30a3e541458ee8 --- ext/misc/series.c | 15 ++++++++------- manifest | 18 +++++++++--------- manifest.uuid | 2 +- test/shell2.test | 12 ++++++------ test/tabfunc01.test | 17 ++++++++++++++--- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/ext/misc/series.c b/ext/misc/series.c index 04644dd603..e8188f1c97 100644 --- a/ext/misc/series.c +++ b/ext/misc/series.c @@ -60,8 +60,7 @@ ** step HIDDEN ** ); ** -** The virtual table also has a rowid, logically equivalent to n+1 where -** "n" is the ascending integer in the aforesaid production definition. +** The virtual table also has a rowid which is an alias for the value. ** ** Function arguments in queries against this virtual table are translated ** into equality constraints against successive hidden columns. In other @@ -276,6 +275,7 @@ static int seriesConnect( int rc; /* Column numbers */ +#define SERIES_COLUMN_ROWID (-1) #define SERIES_COLUMN_VALUE 0 #define SERIES_COLUMN_START 1 #define SERIES_COLUMN_STOP 2 @@ -363,13 +363,11 @@ static int seriesColumn( #endif /* -** Return the rowid for the current row, logically equivalent to n+1 where -** "n" is the ascending integer in the aforesaid production definition. +** The rowid is the same as the value. */ static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){ series_cursor *pCur = (series_cursor*)cur; - sqlite3_uint64 n = pCur->ss.uSeqIndexNow; - *pRowid = (sqlite3_int64)((nss.iValueNow; return SQLITE_OK; } @@ -657,7 +655,10 @@ static int seriesBestIndex( continue; } if( pConstraint->iColumniColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){ + if( (pConstraint->iColumn==SERIES_COLUMN_VALUE || + pConstraint->iColumn==SERIES_COLUMN_ROWID) + && pConstraint->usable + ){ switch( op ){ case SQLITE_INDEX_CONSTRAINT_EQ: case SQLITE_INDEX_CONSTRAINT_IS: { diff --git a/manifest b/manifest index 7345476bdf..59199b7f83 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\sthat\scould\soccur\swhen\sthe\sRHS\sof\san\sIN\soperator\swas\sa\scompound\sSELECT\sfeaturing\san\sORDER\sBY\son\sa\ssubquery\sthat\swas\sflattened\sinto\sone\sof\sthe\scomponent\sSELECTs\sintroduced\sby\s[baa83b460c677c21].\sForum\spost\s[/forumpost/1e17219c88]. -D 2025-03-18T19:21:04.551 +C Change\sthe\sgenerate_series()\stable-valued\sfunction\sso\sthat\sits\srowid\sis\sjust\san\nalias\sfor\sits\svalue.\s\sThis\sallows\sit\sto\sbe\sused\sas\sthe\sRHS\soperand\sof\sa\nRIGHT\sJOIN.\s\sThis\sfixes\sthe\sissue\sraised\sby\n[forum:/forumpost/1e17219c88|forum\spost\s1e17219c88]. +D 2025-03-18T20:15:16.250 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -436,7 +436,7 @@ F ext/misc/regexp.c 388e7f237307c7dfbfb8dde44e097946f6c437801d63f0d7ad63f3320d4e F ext/misc/remember.c add730f0f7e7436cd15ea3fd6a90fd83c3f706ab44169f7f048438b7d6baa69c F ext/misc/rot13.c 51ac5f51e9d5fd811db58a9c23c628ad5f333c173f1fc53c8491a3603d38556c F ext/misc/scrub.c 2a44b0d44c69584c0580ad2553f6290a307a49df4668941d2812135bfb96a946 -F ext/misc/series.c 69e0d2b5d193c67bdfee5baf79c10ec24a61a40212c7ca9c219edf7afa24305f +F ext/misc/series.c 076a4c85dde2ae543d040f1080cdab74ebf3da7f3febfe38e0cd45a2217498bf F ext/misc/sha1.c cb5002148c2661b5946f34561701e9105e9d339b713ec8ac057fd888b196dcb9 F ext/misc/shathree.c fd22d70620f86a0467acfdd3acd8435d5cb54eb1e2d9ff36ae44e389826993df F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52 @@ -1641,7 +1641,7 @@ F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8e F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939 F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304 F test/shell1.test 573942b8d0e444956445993d5a5275c6912bc49b654441eec0b5e1e735f2e5b7 -F test/shell2.test 01a01f76ed98088ce598794fbf5b359e148271541a8ddbf79d21cc353cc67a24 +F test/shell2.test ac102ebc0a9ec166257600c4ee8bdefec242163afced295f10b004f4af3fc9dd F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8 F test/shell4.test 522fdc628c55eff697b061504fb0a9e4e6dfc5d9087a633ab0f3dd11bcc4f807 F test/shell5.test 0e5f8ce08206b9998a778cfe1989e20e47839153c05af2da29198150172e22fc @@ -1719,7 +1719,7 @@ F test/sync.test 89539f4973c010eda5638407e71ca7fddbcd8e0594f4c9980229f804d433309 F test/sync2.test 8f9f7d4f6d5be8ca8941a8dadcc4299e558cb6a1ff653a9469146c7a76ef2039 F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37 F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04 -F test/tabfunc01.test 66d1ea27289c19317bf111744a4d5fda901759945d22ddb5bc964641fc38c185 +F test/tabfunc01.test 76da0509b01b9d12f4e71f8af28ee702d38166a5306bd77a955fb1a370dcd8b5 F test/table.test 7862a00b58b5541511a26757ea9c5c7c3f8298766e98aa099deec703d9c0a8e0 F test/tableapi.test e37c33e6be2276e3a96bb54b00eea7f321277115d10e5b30fdb52a112b432750 F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 47d34260e74912eeae704bff7c4314b893af86ee66dd96a1bc6f450d3e290702 -R 4ad094e1728498f359eaedd7a6999953 -U dan -Z 7c0745034fb8db0f32cdbdfb739169c4 +P 7101ccd5331e36fd1a539f540e79ce0ce159be76ec422e1d9436eec6f3908c6e +R db7ca198487b77ea1364073bfe0ca044 +U drh +Z c0d28f545eced4435e36308f7af9950b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 14b3bf9e1c..b6decbb386 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7101ccd5331e36fd1a539f540e79ce0ce159be76ec422e1d9436eec6f3908c6e +77db4d85e70fbf358ae2321c2601966666bdb4d971d7c113ce30a3e541458ee8 diff --git a/test/shell2.test b/test/shell2.test index ee5ae4bdd9..3f9fec9efa 100644 --- a/test/shell2.test +++ b/test/shell2.test @@ -224,24 +224,24 @@ do_test shell2-1.4.10 { set res [catchcmd :memory: [string trim { SELECT * FROM generate_series(9223372036854775807,9223372036854775807,1); SELECT * FROM generate_series(9223372036854775807,9223372036854775807,-1); - SELECT avg(rowid),min(value),max(value) FROM generate_series( + SELECT avg(value),min(value),max(value) FROM generate_series( -9223372036854775808,9223372036854775807,1085102592571150095); SELECT * FROM generate_series(-9223372036854775808,9223372036854775807, 9223372036854775807); - SELECT value,rowid FROM generate_series(-4611686018427387904, + SELECT value FROM generate_series(-4611686018427387904, 4611686018427387904, 4611686018427387904) ORDER BY value DESC; SELECT * FROM generate_series(0,-2,-1); SELECT * FROM generate_series(0,-2); SELECT * FROM generate_series(0,2) LIMIT 3;}]] } {0 {9223372036854775807 9223372036854775807 -9.5|-9223372036854775808|9223372036854775807 +-0.5|-9223372036854775808|9223372036854775807 -9223372036854775808 -1 9223372036854775806 -4611686018427387904|3 -0|2 --4611686018427387904|1 +4611686018427387904 +0 +-4611686018427387904 0 -1 -2 diff --git a/test/tabfunc01.test b/test/tabfunc01.test index cbf9865eda..c16fb9bec2 100644 --- a/test/tabfunc01.test +++ b/test/tabfunc01.test @@ -61,10 +61,10 @@ do_execsql_test tabfunc01-1.8 { } {30 25 20 15 10 5 0} do_execsql_test tabfunc01-1.9 { SELECT rowid, * FROM generate_series(0,32,5) ORDER BY value DESC; -} {7 30 6 25 5 20 4 15 3 10 2 5 1 0} +} {30 30 25 25 20 20 15 15 10 10 5 5 0 0} do_execsql_test tabfunc01-1.10 { SELECT rowid, * FROM generate_series(0,32,5) ORDER BY +value DESC; -} {7 30 6 25 5 20 4 15 3 10 2 5 1 0} +} {30 30 25 25 20 20 15 15 10 10 5 5 0 0} do_execsql_test tabfunc01-1.20 { CREATE VIEW v1(a,b) AS VALUES(1,2),(3,4); @@ -383,7 +383,18 @@ do_execsql_test 1100 { where (ref_3.value) in (select 1); } {1} - +# 2025-03-18 /forumpost/1e17219c88 +# The generate_series() table-valued function is modified so that its +# rowid is always its value. That way it can be used on the RHS of a +# RIGHT JOIN. +# +do_execsql_test 1200 { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(value INT); + INSERT INTO t1 VALUES (1),(2),(3); + SELECT t1.value, t2.value + FROM t1 RIGHT JOIN generate_series(1,3,1) AS t2 USING(value); +} {1 1 2 2 3 3} # Free up memory allocations intarray_addr From 4c13878ac2e3dfc782ed398254c8e28caec372a9 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 20 Mar 2025 11:47:39 +0000 Subject: [PATCH 18/26] Fix a problem in the sqlite_dbpage() table-valued function when it is trying to truncate a file in locking-mode=EXCLUSIVE and the file was obtained via sqlite3_deserialize(). Problem found by dbsqlfuzz. FossilOrigin-Name: 346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3 --- manifest | 17 ++++++++--------- manifest.uuid | 2 +- src/dbpage.c | 4 ++-- test/fuzzdata8.db | Bin 4248576 -> 4249600 bytes 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index bcf3f4ed37..fc02250932 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\srunning\stest\scases\sinvolving\sANSI\scontrol\scharacters\sor\sUnicode\son\sWindows\sin\sa\sslave\sinterpreter,\sas\sthat\scombination\sdoes\snot\swork. -D 2025-03-19T11:53:46.152 +C Fix\sa\sproblem\sin\sthe\ssqlite_dbpage()\stable-valued\sfunction\swhen\sit\sis\ntrying\sto\struncate\sa\sfile\sin\slocking-mode=EXCLUSIVE\sand\sthe\sfile\swas\nobtained\svia\ssqlite3_deserialize().\s\sProblem\sfound\sby\sdbsqlfuzz. +D 2025-03-20T11:47:39.061 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -731,7 +731,7 @@ F src/build.c 3fe9b9d0f411cc2139a2d5ffa1c9b555417f89332f4dbf7f8e311c2e69e40c81 F src/callback.c acae8c8dddda41ee85cfdf19b926eefe830f371069f8aadca3aa39adf5b1c859 F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/date.c 9db4d604e699a73e10b8e85a44db074a1f04c0591a77e2abfd77703f50dce1e9 -F src/dbpage.c 2e677acb658a29965e55398bbc61161cb7819da538057c8032adac7ab8e4a8c0 +F src/dbpage.c fcb1aafe00872a8aff9a7aa0ef7ff1b01e5817ec7bbd521f8f3e1e674ac8d609 F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42 F src/expr.c 61c3baab38f1b50eb4696e1f37c8f7ae1d1ecbfc1a35d446cfd1886624784131 @@ -1288,7 +1288,7 @@ F test/fuzzdata4.db b502c7d5498261715812dd8b3c2005bad08b3a26e6489414bd13926cd3e4 F test/fuzzdata5.db e35f64af17ec48926481cfaf3b3855e436bd40d1cfe2d59a9474cb4b748a52a5 F test/fuzzdata6.db b8725a5f5cf7a3b7241a9038e57ca7e7cc8c3f4d86b44bd770617bda245ab2b0 F test/fuzzdata7.db 0166b56fd7a6b9636a1d60ef0a060f86ddaecf99400a666bb6e5bbd7199ad1f2 -F test/fuzzdata8.db c6f9cb7d2b808fb10894afe53ef00f51e73e43baa7aabdba7e9af4713fc5b186 +F test/fuzzdata8.db 8f34ae00d8d5d4747dd80983cf46161065e4f78324dcff3c893506ff8db3a4a6 F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8 F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14 F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc @@ -2215,9 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 77db4d85e70fbf358ae2321c2601966666bdb4d971d7c113ce30a3e541458ee8 f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d -R a46056f95f3aa69f0dfc1aefc7391930 -T +closed f6745a7355c62ee64c08e23b795f437dd74add903b55e1255c1d03f9a811170d Closed\sby\sintegrate-merge. -U stephan -Z b755d7eda21c9f2918bebcee085f28b7 +P c7fd71c77f1716c9c85d0f41a07ebd7c96f2e9d5e4c1392fefa1fb53f3cbb746 +R 4634b7df48b729bfd4bde6753f06dc09 +U drh +Z 6107a05db82cfd1bf03b9f66e2d05b45 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2846cf474a..0a3688252d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c7fd71c77f1716c9c85d0f41a07ebd7c96f2e9d5e4c1392fefa1fb53f3cbb746 +346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3 diff --git a/src/dbpage.c b/src/dbpage.c index eb5ab33fe1..f9fdcc5a37 100644 --- a/src/dbpage.c +++ b/src/dbpage.c @@ -395,8 +395,8 @@ static int dbpageUpdate( /* "INSERT INTO dbpage($PGNO,NULL)" causes page number $PGNO and ** all subsequent pages to be deleted. */ pTab->iDbTrunc = iDb; - pgno--; - pTab->pgnoTrunc = pgno; + pTab->pgnoTrunc = pgno-1; + pgno = 1; }else{ zErr = "bad page value"; goto update_fail; diff --git a/test/fuzzdata8.db b/test/fuzzdata8.db index 469df2c681a13064074d0a6e2fac0cf5939dbbcc..bfa3e3ecd09c7ef66a63cc958568e341dbdbd4a0 100644 GIT binary patch delta 3168 zcmZvedsGzH9mn_1?6SMC%4}Fc5q1_>z(qioHxXtAZCWX)a3pP_pbK0d5j>G58hg^y zK=rnbNqhw5XCf-7HR2AlewUMm906sfi*cRioA30i#=B&iVfSxcAQ7 z&;8Et_nWEMx|pkISj?>$X-?2+gk;T=%Wq|Lf-XT5yHu#e1S5huf_Z|q1nUU)B3Mtb zfnX!S-URy)Y$A9F!9xl5C0HQXOz=|#`w?s*co@O{1P2g2oZt}z2NFDz;2?s73APd} z5^N(lgy2wu!w9w$98Pcq!I1=yYQm1%+lE(=iD3!JaA?i&L{RQH_Huj<{ppTlG>4)f z;+|tvfe=l~*pg6E%HnV`m&Kvv1s1hrjz;7A6PeB8zsM{WFA>b*8B)UHF;dLpVN%56 zKH_3=2bsZQEh%JiEt$sRJAc`B&%qSMG@2=zDTXPQX$(^wlanc)DS;`GDTyhWDTOJO zDUIoArm;-vblbg*f*iv+4fjXn)|{*ATzE|XCol56R;G_M(Y8s?=Hxh{N5w}k zii~uO^&UTY;>4`{vEJ03C5isc>E@%H;q7QLRjb)tP}MlgM%iW-)a;UywYq6q%?2+v zID+P5X*;ibmz{ncWUdOAA!eqd^*#Oti8rn0!O-@LKhL-Rk$i6$=1VJmp1L>qP zsfkA$z#T66K|`#so?7QiiUAeU8H=RboT0AHObWD`55c@H!vep1ReDQT!#3CmD@*OA z&^6f}L~XhDKO=}*CJ|V1G2KMBR7+D4)ZQ>?wQS`ksGM(qj=I)J>)GG}lR$^QEA=37 z-Rhg)40X%xGoWLvJrb7HNEaw3(gqIwjk+f}LPz`Cu{T;0x{1!Ouk)l0WH-Fxg9?}NK$r~_I#`6XJrLn`6XF32m^PockU zkaqB>f!19~8;$6gCh07P8lm!-Uk=UPEA7#vJs|wj?^iUtRocs=4`BW)d;pjnmOp^_ zw*QxOL7TLULrqY$epmn<*)Cn>xn>(6F(aUAy49b?pO89vADWVwmYA4S66cJA%wK4u zpuUzbtuD6KP`Oh&%Avhfdsdof^m1u6cU?(f?o`G>S4BWJ?A+*ozxuNDP`8^M;Q%da zNgaZy*)8>O=pd9AK7EbexFT72)B>5;q{C40mUR})|6WR^Mc+yrIdll>z77h6uHe)h zb-0jz@}0C(?_H$TT$-EokX=yzjnPSW{UGJ?y8Ud6BT&Qz$I!U@*29Q)-X%X@fzay;v4zHO_` zT1@8{6QJgx@(y(wT~_f%SzAlkK64nWOTTM<&t>4NfV_Ny_tg`@WM+RezhrdZ zg7ZcB_?`+2dBk09wXIgM{|(NE*3)pfNt~^|_K$l_z6M9GWMo4{q+9{Y7Wp*G#^TpEb%(4s}D`SK>mb9U+$i%h`Nbep<9pWf;ra z=DjknMLmON#;pOF@k9Rv{;|LR{~6r>+n)a4dF;P|{`#!Ek4JZ(_}|p7r1op0={9(ksx__jHAo+vlF0BzFxhEicW_(p7e(M8H-e93 zB`t&l>dDAdt2vaTvzID02t|NMW}5+&n_{r~%u!G|MvR2qI60rbwn|yTBer&je2HFcRYYE05k>PF1AMSEi|b`ImOW!lYE9(y^T`m6KSkV z-j3+5HYJ}!>|elb351{7S`g(vRkV7qdCcdvc3>Z(bu@09asq*^(dbpxV5wA}5%WJ% C35gQ` delta 3074 zcmZvedsI}%9mjX>-DP)S(YvyOBJ5pYSzHiY5D=rxy_lRf79()voVEs(g;A-*Q>l;k zw6?;Dlbkg1N#f5aD)>kuih>BEMtr0u(P|V;Ont1Cnny_bdM!>k^iPRh_deFm)MDlmt@}LWzZvP)Y_+GLRC95-TNxC<&v)M#*4G!YPTMWC$fgDT$r(F$&3=qzp{=x?|UrRCg;bf!)>@GhOf?LX;sZoi;q+@7JO+#aP~ zZV%8BZuih>+-{>&x!pjExLxyV!#y`wB3BaE2(DzV6t0n690B9HnOvi} zvbe@@J;ODYYaDC1mt8c`v_&WU1^IMaYECZz)5;O_*LvONqMGIz4tVrDmLa4Jf6sgq zupHh-aHifcMX%cs#D|Bn!g9P#G`!8xY9Z&%cmp7U0GR1aaQK2ENE(v zkAmF0Lo5)rJU)_5nuA+Kv>tr%I1HLn1{#@t9#&1Lh)r9FZwscndMkZVuloS3>#}X| zyG3}3VJ+XF9#&L1E1)ya8O0p=&Q}m5uEZ3UUmRy)@2tU75Y*i;>Ggc(MyQ_S{1q#y z#q0UY`4)){SdY6Al-%ka-vsr`oYSCVtTO?Y*5M0`yoNUjXfyLoa?1#$ho%F}w*#otTNV0T+oN9g%qB-FUl*cCz{_W0DXXxfg#XpeCq37B-RP@5e1hvIG= z)B;%3h3at)6a&|<`RC_o}>%gbQkhan3 zW75+z$~>ta$azkm2wUsKidCidTBe-EM+C%}{v4id4w|Od-7U!g>sfU?bXG;=LgU8p z`>QVFM}}s8gni80o)wCi^(yWb(ECtX{LDA(#x-mc(SFFefe%8}68j98a}#GV@3(lP zfZCz{a#SRAMrTdbUKg{EyKtj1xJ0kJG%Mo~f1vWJIhF0agY!khUcSX4@Cwn%%yZv< z5V5WYI7~o?!FydSXTKe;tPqW*nPd2@55NnN(NNN$>|`B!Wt52iR&zQp4pP$OIQD`^ zX%UT?X_P2)Ms%?%5;ONed)u`SS(Ft~Vm#iSB z8kBZH%h^wAa^hT1aN0z45^ipl{{;L*&qM7Y^=(!Xs%#R_DSxJpK1`?mnN+3Q6jW-^ zRj(e$4p%B;1vBA09pm~8nq4N(Q>TUYFr4j!`8jaR^XyWg;u6t60uj&kK`hn~&-)`@ z@JA$?+b;SemMgbRsEqBeRGt+KpK`JalC7gI#)T~Qe~r$!B^QGZ)x2BhSW#)Q*f|Vo~gzCqaH8+2M%A!&V{NZ zr3%yr<&>6>r9C6xfK;P)L2{bx)N=A#&&&TpOo$Q#i3ios!IQ24)Vbv8>~^DK5zx0_ z&9#k$j)!6}%rUcYqr`_MfIq$8`6#qDN2YLR<4xp1i_O;YNoT ze&AQSp+6`o$REn4@~SrmKuIP)sP7bB_2&Meg8iXF0--GaP+CQ?_e0fZg&>LNpfs>w zHmMJrHIQvkAX`}fY&L(k!B5#(UcTnBaDTWFD)-m`PBru=UE8bjt{vH@YfHoYyLP$C zyLME+U0aIo?b>rx-nH%iJn~bX-T*rMaTcmwrl46`NvpjLGK7py=X683;#hN6^oKoH ziX=e3OH9zb=>*iBoud_VtiWb2RcjH72Vasbueu;lg0I@uF0sR){a^%$CJ z)XAbN)eQy5O|iX~4Rlx?CQxt6(b}R3P(4ykfc$i&kS$uRE*8;nC}>hHv5QAkS=45@ zS;1~)HewaW)MZ*%kP>^3A$@8{V7Z&s@n%%PmNu%Df+3cVCbQ=IcKjpzp&iN&?VA+H z85m-F+(kQE)i?o-WX*b|t%r7k_WyeGwV3DtLZ|j=D%3x~^MJ#(vy8*)Ndcv?6iGQF zYVJ+cW{hGfMA?Se&SPq!fYQP0vqi#>c Date: Thu, 20 Mar 2025 13:41:08 +0000 Subject: [PATCH 19/26] Teach the configure script to be able find a default installation of libreadline on Haiku OS. FossilOrigin-Name: 260e9884118172ef76457a34042ace301f20abab4ced172f6b6135010c446a68 --- autosetup/sqlite-config.tcl | 24 ++++++++++++++++++++++-- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 42b4382cfa..9461e7f89d 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -928,6 +928,11 @@ proc sqlite-handle-emsdk {} { ######################################################################## # Internal helper for [sqlite-check-line-editing]. Returns a list of # potential locations under which readline.h might be found. +# +# On some environments this function may perform extra work to help +# sqlite-check-line-editing figure out how to find libreadline and +# friends. It will communicate those results via means other than the +# result value, e.g. by modifying configure --flags. proc sqlite-get-readline-dir-list {} { # Historical note: the dirs list, except for the inclusion of # $prefix and some platform-specific dirs, originates from the @@ -944,6 +949,17 @@ proc sqlite-get-readline-dir-list {} { *-mingw64 { lappend dirs /mingw64 /mingw } + *-haiku { + lappend dirs /boot/system/develop/headers + if {[opt-val with-readline-ldflags] in {auto ""}} { + # If the user did not supply their own --with-readline-ldflags + # value, hijack that flag to inject options which are known to + # work on a default Haiku installation. + if {"" ne [glob -nocomplain /boot/system/lib/libreadline*]} { + proj-opt-set with-readline-ldflags {-L/boot/system/lib -lreadline} + } + } + } } lappend dirs /usr /usr/local /usr/local/readline /usr/contrib set rv {} @@ -1091,7 +1107,9 @@ proc sqlite-check-line-editing {} { proj-warn "Skipping check for readline.h because we're cross-compiling." } else { set dirs [sqlite-get-readline-dir-list] - set subdirs "include/$editLibName" + set subdirs [list \ + include/$editLibName \ + readline] if {"editline" eq $editLibName} { lappend subdirs include/readline # ^^^ editline, on some systems, does not have its own header, @@ -1099,7 +1117,8 @@ proc sqlite-check-line-editing {} { } lappend subdirs include set rlInc [proj-search-for-header-dir readline.h \ - -dirs $dirs -subdirs $subdirs] + -dirs $dirs -subdirs $subdirs] + #msg-debug "rlInc=$rlInc" if {"" ne $rlInc} { if {[string match */readline $rlInc]} { set rlInc [file dirname $rlInc]; # CLI shell: #include @@ -1124,6 +1143,7 @@ proc sqlite-check-line-editing {} { set rlLib "" if {"" ne $rlInc} { set rlLib [opt-val with-readline-ldflags] + #msg-debug "rlLib=$rlLib" if {$rlLib eq "auto" || $rlLib eq ""} { set rlLib "" set libTerm "" diff --git a/manifest b/manifest index fc02250932..07acc0acad 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\sin\sthe\ssqlite_dbpage()\stable-valued\sfunction\swhen\sit\sis\ntrying\sto\struncate\sa\sfile\sin\slocking-mode=EXCLUSIVE\sand\sthe\sfile\swas\nobtained\svia\ssqlite3_deserialize().\s\sProblem\sfound\sby\sdbsqlfuzz. -D 2025-03-20T11:47:39.061 +C Teach\sthe\sconfigure\sscript\sto\sbe\sable\sfind\sa\sdefault\sinstallation\sof\slibreadline\son\sHaiku\sOS. +D 2025-03-20T13:41:08.243 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -50,7 +50,7 @@ F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba F autosetup/proj.tcl bdf0489d4ce8110fc1d4a09b1e2e274e50dd51711637b55c7c63a6a7ecec2aa5 -F autosetup/sqlite-config.tcl a2eb8234de355233787ad7bc926d8a622ef9f97594749374c4360b63c37fc223 +F autosetup/sqlite-config.tcl 4f4f666382c68a01617a4b75cb7cfc2690f49760d683836332bbee9c5bd6d47b F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c7fd71c77f1716c9c85d0f41a07ebd7c96f2e9d5e4c1392fefa1fb53f3cbb746 -R 4634b7df48b729bfd4bde6753f06dc09 -U drh -Z 6107a05db82cfd1bf03b9f66e2d05b45 +P 346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3 +R a0ddd543c9b9478028e92dd9961c6514 +U stephan +Z 2ec32e826afbcab9328d3272b3136b96 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0a3688252d..cdf4059c1b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3 +260e9884118172ef76457a34042ace301f20abab4ced172f6b6135010c446a68 From eb6997fbac02e942ac19d2baa77571df2414b942 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 21 Mar 2025 16:06:16 +0000 Subject: [PATCH 20/26] Proxy configure's msg-debug with proc-debug, which works the same except that it prepends the name of the calling proc to the debug message. No functional changes. FossilOrigin-Name: f0298c773d3490ad3a5b53d2ceeff1bd90e1a7bb5deeba2d24f681ec1bc10510 --- autosetup/proj.tcl | 9 +++++++++ autosetup/sqlite-config.tcl | 23 +++++++++++++++-------- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index ba5427b6a5..3698c8c1f4 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1365,3 +1365,12 @@ proc proj-env-file {flag {dflt ""}} { proc proj-get-env {var {dflt ""}} { return [get-env $var [proj-env-file $var $dflt]] } + +######################################################################## +# @proj-current-proc-name +# +# Returns the name of the _calling_ proc from $lvl levels up the call +# stack. Derived from: https://stackoverflow.com/questions/10012851 +proc proj-current-proc-name {{lvl 1}} { + uplevel $lvl {lindex [info level 0] 0} +} diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 9461e7f89d..48155af496 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -481,6 +481,13 @@ proc msg-debug {msg} { puts stderr [proj-bold "** DEBUG: $msg"] } } +######################################################################## +# A [msg-debug] proxy which prepends the name of the current proc to +# the debug message. It is not legal to call this from the global +# scope. +proc proc-debug {msg} { + msg-debug "\[[proj-current-proc-name 2]\]: $msg" +} ######################################################################## # Sets up the SQLITE_AUTORECONFIG define. @@ -797,7 +804,7 @@ proc sqlite-handle-soname {} { } } } - msg-debug "soname=$soname" + proc-debug "soname=$soname" if {[proj-check-soname $soname]} { define LDFLAGS_LIBSQLITE3_SONAME [get-define LDFLAGS_SONAME_PREFIX]$soname msg-result "Setting SONAME using: [get-define LDFLAGS_LIBSQLITE3_SONAME]" @@ -966,7 +973,7 @@ proc sqlite-get-readline-dir-list {} { foreach d $dirs { if {[file isdir $d]} {lappend rv $d} } - #msg-debug "sqlite-get-readline-dir-list dirs=$rv" + #proc-debug "dirs=$rv" return $rv } @@ -1118,7 +1125,7 @@ proc sqlite-check-line-editing {} { lappend subdirs include set rlInc [proj-search-for-header-dir readline.h \ -dirs $dirs -subdirs $subdirs] - #msg-debug "rlInc=$rlInc" + #proc-debug "rlInc=$rlInc" if {"" ne $rlInc} { if {[string match */readline $rlInc]} { set rlInc [file dirname $rlInc]; # CLI shell: #include @@ -1143,7 +1150,7 @@ proc sqlite-check-line-editing {} { set rlLib "" if {"" ne $rlInc} { set rlLib [opt-val with-readline-ldflags] - #msg-debug "rlLib=$rlLib" + #proc-debug "rlLib=$rlLib" if {$rlLib eq "auto" || $rlLib eq ""} { set rlLib "" set libTerm "" @@ -1780,14 +1787,14 @@ proc sqlite-check-tcl {} { if {"prefix" eq $with_tcl} { set with_tcl [get-define prefix] } - msg-debug "sqlite-check-tcl: use_tcl ${use_tcl}" - msg-debug "sqlite-check-tcl: with_tclsh=${with_tclsh}" - msg-debug "sqlite-check-tcl: with_tcl=$with_tcl" + proc-debug "use_tcl ${use_tcl}" + proc-debug "with_tclsh=${with_tclsh}" + proc-debug "with_tcl=$with_tcl" if {"" eq $with_tclsh && "" eq $with_tcl} { # If neither --with-tclsh nor --with-tcl are provided, try to find # a workable tclsh. set with_tclsh [proj-first-bin-of tclsh9.0 tclsh8.6 tclsh] - msg-debug "sqlite-check-tcl: with_tclsh=${with_tclsh}" + proc-debug "with_tclsh=${with_tclsh}" } set doConfigLookup 1 ; # set to 0 to test the tclConfig.sh-not-found cases diff --git a/manifest b/manifest index 07acc0acad..b02a1c56e5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Teach\sthe\sconfigure\sscript\sto\sbe\sable\sfind\sa\sdefault\sinstallation\sof\slibreadline\son\sHaiku\sOS. -D 2025-03-20T13:41:08.243 +C Proxy\sconfigure's\smsg-debug\swith\sproc-debug,\swhich\sworks\sthe\ssame\sexcept\sthat\sit\sprepends\sthe\sname\sof\sthe\scalling\sproc\sto\sthe\sdebug\smessage.\sNo\sfunctional\schanges. +D 2025-03-21T16:06:16.983 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl bdf0489d4ce8110fc1d4a09b1e2e274e50dd51711637b55c7c63a6a7ecec2aa5 -F autosetup/sqlite-config.tcl 4f4f666382c68a01617a4b75cb7cfc2690f49760d683836332bbee9c5bd6d47b +F autosetup/proj.tcl 2753b2ca95d3f91d4facc447b61a3090a0aea86a41c33ef8ad9db8d0bb0d464d +F autosetup/sqlite-config.tcl 27ac8b7634a4d54e93a61bc13d56985b890e58e24c77c4bab93b53a5d1843973 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 346cf9794c6ce82ac32f7ccabc67240309306626709951593720abd198b103e3 -R a0ddd543c9b9478028e92dd9961c6514 +P 260e9884118172ef76457a34042ace301f20abab4ced172f6b6135010c446a68 +R e20098aa98dd2dc6f5c975996659e451 U stephan -Z 2ec32e826afbcab9328d3272b3136b96 +Z eacd552cb3abab15f251e0a9034bd2ad # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index cdf4059c1b..c77f3fbe4b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -260e9884118172ef76457a34042ace301f20abab4ced172f6b6135010c446a68 +f0298c773d3490ad3a5b53d2ceeff1bd90e1a7bb5deeba2d24f681ec1bc10510 From 11d5bea2108f51f5aefd2fc2748e6916cce362ca Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 21 Mar 2025 16:49:32 +0000 Subject: [PATCH 21/26] Flesh out the new proc-debug and its infrastructure a bit. FossilOrigin-Name: ba7f1ff0d7d1d3fb79fc298d99fd27b65f639fb1691a1a9cdc9c006b8ff41212 --- autosetup/proj.tcl | 9 +++++---- autosetup/sqlite-config.tcl | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 3698c8c1f4..d6d42678eb 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1369,8 +1369,9 @@ proc proj-get-env {var {dflt ""}} { ######################################################################## # @proj-current-proc-name # -# Returns the name of the _calling_ proc from $lvl levels up the call -# stack. Derived from: https://stackoverflow.com/questions/10012851 -proc proj-current-proc-name {{lvl 1}} { - uplevel $lvl {lindex [info level 0] 0} +# Returns the name of the _calling_ proc from ($lvl + 1) levels up the +# call stack (where the caller's level will be 1 below _this_ +# call). It is not legal to call this from the top scope. +proc proj-current-proc-name {{lvl 0}} { + uplevel [expr $lvl + 1] {lindex [info level 0] 0} } diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 48155af496..5bf9e34c4b 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -486,7 +486,7 @@ proc msg-debug {msg} { # the debug message. It is not legal to call this from the global # scope. proc proc-debug {msg} { - msg-debug "\[[proj-current-proc-name 2]\]: $msg" + msg-debug "\[[proj-current-proc-name 1]\]: $msg" } ######################################################################## diff --git a/manifest b/manifest index b02a1c56e5..aa6df8a09f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Proxy\sconfigure's\smsg-debug\swith\sproc-debug,\swhich\sworks\sthe\ssame\sexcept\sthat\sit\sprepends\sthe\sname\sof\sthe\scalling\sproc\sto\sthe\sdebug\smessage.\sNo\sfunctional\schanges. -D 2025-03-21T16:06:16.983 +C Flesh\sout\sthe\snew\sproc-debug\sand\sits\sinfrastructure\sa\sbit. +D 2025-03-21T16:49:32.629 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 2753b2ca95d3f91d4facc447b61a3090a0aea86a41c33ef8ad9db8d0bb0d464d -F autosetup/sqlite-config.tcl 27ac8b7634a4d54e93a61bc13d56985b890e58e24c77c4bab93b53a5d1843973 +F autosetup/proj.tcl 8282fd8f14fa94be79a2f832a1c36d919ce4465216ce209d96820c6eb9a864e4 +F autosetup/sqlite-config.tcl ff39112eddc68e9505562c6aefc0b505190fe1fe93b2273e0b50ce5c7bbf6e64 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -2215,8 +2215,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 260e9884118172ef76457a34042ace301f20abab4ced172f6b6135010c446a68 -R e20098aa98dd2dc6f5c975996659e451 +P f0298c773d3490ad3a5b53d2ceeff1bd90e1a7bb5deeba2d24f681ec1bc10510 +R 3cc891ff71296fb59fcd1fa5eb66bbd2 U stephan -Z eacd552cb3abab15f251e0a9034bd2ad +Z 05c9795d3fb61aee80553fe96bed0bc9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c77f3fbe4b..8597b0b793 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f0298c773d3490ad3a5b53d2ceeff1bd90e1a7bb5deeba2d24f681ec1bc10510 +ba7f1ff0d7d1d3fb79fc298d99fd27b65f639fb1691a1a9cdc9c006b8ff41212 From 7f4efdcb65524c1983350ae2cca80934906a21aa Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 21 Mar 2025 18:15:13 +0000 Subject: [PATCH 22/26] Teach the CLI that VT100-escape codes that do things like change font colors have zero-width for the purpose of laying out the columns of a table. FossilOrigin-Name: 2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda --- manifest | 15 ++++++++------- manifest.uuid | 2 +- src/shell.c.in | 43 ++++++++++++++++++++++++++++++++++++++----- test/vt100-a.sql | 19 +++++++++++++++++++ 4 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 test/vt100-a.sql diff --git a/manifest b/manifest index aa6df8a09f..6b242f7484 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Flesh\sout\sthe\snew\sproc-debug\sand\sits\sinfrastructure\sa\sbit. -D 2025-03-21T16:49:32.629 +C Teach\sthe\sCLI\sthat\sVT100-escape\scodes\sthat\sdo\sthings\slike\schange\sfont\ncolors\shave\szero-width\sfor\sthe\spurpose\sof\slaying\sout\sthe\scolumns\sof\sa\ntable. +D 2025-03-21T18:15:13.290 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -784,7 +784,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 20e1fbe8f840ffc0cd835e33f68a802a22e34faa918d7a269f3de242fda02f99 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c bfe14cdfceba54744b1c6c29099313f5173a0793dfaff0cd484774e9d05dbeab -F src/shell.c.in 248050551cad788f8bb4b4728e00d8e36a10130d2d101e55cd51cfee03df91ff +F src/shell.c.in 9d1b46e09c1b933b0c7afaf4ae27030dc356ee19ae4f95ce8bf3647035b9635b F src/sqlite.h.in fd70afd92948cf7cc93f687ac960bad1b0b6fbc436752419eff2fd65a1809380 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54 @@ -1972,6 +1972,7 @@ F test/view.test 3c23d7a068e9e4a0c4e6907498042772adea725f0630c3d9638ffd4e5a08b92 F test/view2.test db32c8138b5b556f610b35dfddd38c5a58a292f07fda5281eedb0851b2672679 F test/view3.test ad8a8290ee2b55ff6ce66c9ef1ce3f1e47926273a3814e1c425293e128a95456 F test/vt02.c 5b44ac67b1a283fedecf2d6e2ceda61e7a157f01d44dcb4490dcb1e87d057060 +F test/vt100-a.sql 631eeab18c5adb531bab79aecf64eee3934b42c75a309ee395c814717a6a7651 F test/vtab1.test 09a72330d0f31eda2ffaa828b06a6b917fb86250ee72de0301570af725774c07 F test/vtab2.test 14d4ab26cee13ba6cf5c5601b158e4f57552d3b055cdd9406cf7f711e9c84082 F test/vtab3.test b45f47d20f225ccc9c28dc915d92740c2dee311e @@ -2215,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P f0298c773d3490ad3a5b53d2ceeff1bd90e1a7bb5deeba2d24f681ec1bc10510 -R 3cc891ff71296fb59fcd1fa5eb66bbd2 -U stephan -Z 05c9795d3fb61aee80553fe96bed0bc9 +P ba7f1ff0d7d1d3fb79fc298d99fd27b65f639fb1691a1a9cdc9c006b8ff41212 +R 8af62bb2e2dc8ccdf26ae7c0bc939029 +U drh +Z cfacc14c0921c2b298dd0d24d3eebca7 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 8597b0b793..0b4b998c42 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ba7f1ff0d7d1d3fb79fc298d99fd27b65f639fb1691a1a9cdc9c006b8ff41212 +2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda diff --git a/src/shell.c.in b/src/shell.c.in index 93d73e6ac7..8272956ebd 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -784,6 +784,23 @@ int cli_wcswidth(const char *z){ } #endif +/* +** Check to see if z[] is a valid VT100 escape. If it is, then +** return the number of bytes in the escape sequence. Return 0 if +** z[] is not a VT100 escape. +** +** This routine assumes that z[0] is \033 (ESC). +*/ +static int isVt100(const unsigned char *z){ + int i; + if( z[1]!='[' ) return 0; + i = 2; + while( z[i]>=0x30 && z[i]<=0x3f ){ i++; } + while( z[i]>=0x20 && z[i]<=0x2f ){ i++; } + if( z[i]<0x40 || z[i]>0x7e ) return 0; + return i+1; +} + /* ** Output string zUtf to stdout as w characters. If w is negative, ** then right-justify the text. W is the width in UTF-8 characters, not @@ -799,6 +816,7 @@ static void utf8_width_print(FILE *out, int w, const char *zUtf){ unsigned char c; int i = 0; int n = 0; + int k; int aw = w<0 ? -w : w; if( zUtf==0 ) zUtf = ""; while( (c = a[i])!=0 ){ @@ -811,6 +829,8 @@ static void utf8_width_print(FILE *out, int w, const char *zUtf){ } i += len; n += x; + }else if( c==0x1b && (k = isVt100(&a[i]))>0 ){ + i += k; }else if( n>=aw ){ break; }else{ @@ -3998,9 +4018,14 @@ static char *translateForDisplayAndDup( i++; continue; } - n++; - j += 3; - i++; + if( c==0x1b && p->eEscMode==SHELL_ESC_OFF && (k = isVt100(&z[i]))>0 ){ + i += k; + j += k; + }else{ + n++; + j += 3; + i++; + } } if( n>=mxWidth && bWordWrap ){ /* Perhaps try to back up to a better place to break the line */ @@ -4066,9 +4091,17 @@ static char *translateForDisplayAndDup( zOut[j++] = '^'; zOut[j++] = 0x40 + c; break; - case SHELL_ESC_OFF: - zOut[j++] = c; + case SHELL_ESC_OFF: { + int nn; + if( c==0x1b && (nn = isVt100(&z[i]))>0 ){ + memcpy(&zOut[j], &z[i], nn); + j += nn; + i += nn - 1; + }else{ + zOut[j++] = c; + } break; + } } i++; } diff --git a/test/vt100-a.sql b/test/vt100-a.sql new file mode 100644 index 0000000000..a0d3f46be7 --- /dev/null +++ b/test/vt100-a.sql @@ -0,0 +1,19 @@ +/* +** Run this script using the "sqlite3" command-line shell +** test test formatting of output text that contains +** vt100 escape sequences. +*/ +.mode box -escape off +CREATE TEMP TABLE t1(a,b,c); +INSERT INTO t1 VALUES + ('one','twotwotwo','thirty-three'), + (unistr('\u001b[91mRED\u001b[0m'),'fourfour','fifty-five'), + ('six','seven','eighty-eight'); +.print With -escape off +SELECT * FROM t1; +.mode box -escape ascii +.print With -escape ascii +SELECT * FROM t1; +.mode box -escape symbol +.print With -escape symbol +SELECT * FROM t1; From e02fade10bd2f8eea7259c16f49bdebe0893c4c4 Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 21 Mar 2025 21:13:44 +0000 Subject: [PATCH 23/26] Fix a multi-arg expr call in proj-current-proc-name (must be single-arg for portability). FossilOrigin-Name: 914768f3f5d63a891e1cd578afc676960376fc28ee0fa452fcd32cec0ea5cdaf --- autosetup/proj.tcl | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index d6d42678eb..68498fb301 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1373,5 +1373,5 @@ proc proj-get-env {var {dflt ""}} { # call stack (where the caller's level will be 1 below _this_ # call). It is not legal to call this from the top scope. proc proj-current-proc-name {{lvl 0}} { - uplevel [expr $lvl + 1] {lindex [info level 0] 0} + uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} } diff --git a/manifest b/manifest index 6b242f7484..26c8b3bb88 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Teach\sthe\sCLI\sthat\sVT100-escape\scodes\sthat\sdo\sthings\slike\schange\sfont\ncolors\shave\szero-width\sfor\sthe\spurpose\sof\slaying\sout\sthe\scolumns\sof\sa\ntable. -D 2025-03-21T18:15:13.290 +C Fix\sa\smulti-arg\sexpr\scall\sin\sproj-current-proc-name\s(must\sbe\ssingle-arg\sfor\sportability). +D 2025-03-21T21:13:44.763 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -49,7 +49,7 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 8282fd8f14fa94be79a2f832a1c36d919ce4465216ce209d96820c6eb9a864e4 +F autosetup/proj.tcl 60e46519d8fa5da2c8b0226195923543e91b20657c27d33227af2d843f1b3a2a F autosetup/sqlite-config.tcl ff39112eddc68e9505562c6aefc0b505190fe1fe93b2273e0b50ce5c7bbf6e64 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P ba7f1ff0d7d1d3fb79fc298d99fd27b65f639fb1691a1a9cdc9c006b8ff41212 -R 8af62bb2e2dc8ccdf26ae7c0bc939029 -U drh -Z cfacc14c0921c2b298dd0d24d3eebca7 +P 2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda +R 8c92fc288e7af142732c8fe3f14cf5ee +U stephan +Z 96ac08c8317a7dd73f053a8770e6d9bf # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0b4b998c42..857aa289ca 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda +914768f3f5d63a891e1cd578afc676960376fc28ee0fa452fcd32cec0ea5cdaf From 28b7bfc30fa3b46e16078a908a782780f767826a Mon Sep 17 00:00:00 2001 From: stephan Date: Fri, 21 Mar 2025 22:14:30 +0000 Subject: [PATCH 24/26] Slightly simplify proj-current-proc-name. FossilOrigin-Name: 6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775 --- autosetup/proj.tcl | 5 +++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 68498fb301..46e845bb8a 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -1370,8 +1370,9 @@ proc proj-get-env {var {dflt ""}} { # @proj-current-proc-name # # Returns the name of the _calling_ proc from ($lvl + 1) levels up the -# call stack (where the caller's level will be 1 below _this_ +# call stack (where the caller's level will be 1 up from _this_ # call). It is not legal to call this from the top scope. proc proj-current-proc-name {{lvl 0}} { - uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} + #uplevel [expr {$lvl + 1}] {lindex [info level 0] 0} + lindex [info level [expr {-$lvl - 1}]] 0 } diff --git a/manifest b/manifest index 26c8b3bb88..3a9273ef0f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\smulti-arg\sexpr\scall\sin\sproj-current-proc-name\s(must\sbe\ssingle-arg\sfor\sportability). -D 2025-03-21T21:13:44.763 +C Slightly\ssimplify\sproj-current-proc-name. +D 2025-03-21T22:14:30.044 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -49,7 +49,7 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 60e46519d8fa5da2c8b0226195923543e91b20657c27d33227af2d843f1b3a2a +F autosetup/proj.tcl 8bb4158e71b5d60070b86af3f7b1edf960c60b77f102ea5d688d89c7d57d8a32 F autosetup/sqlite-config.tcl ff39112eddc68e9505562c6aefc0b505190fe1fe93b2273e0b50ce5c7bbf6e64 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2d0a8a6c38981552748ff5fc2eeba86590e0f116abac260a7fc9318de0a0dbda -R 8c92fc288e7af142732c8fe3f14cf5ee +P 914768f3f5d63a891e1cd578afc676960376fc28ee0fa452fcd32cec0ea5cdaf +R 5ebc42a335e940672eaf8de2b02c74fc U stephan -Z 96ac08c8317a7dd73f053a8770e6d9bf +Z 11db84ad0c2b37daef67514310a5b653 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 857aa289ca..9ac41ff81c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -914768f3f5d63a891e1cd578afc676960376fc28ee0fa452fcd32cec0ea5cdaf +6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775 From 51aef0e4daece52af0ae44ae1aada1e76f739c7c Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 12:15:13 +0000 Subject: [PATCH 25/26] In the autoconf bundle, do not strip binaries during installation, for parity with the canonical build and the legacy build. Discussed in [forum:9a67df63eda9925c|forum post 9a67df63eda9925c]. A potential TODO here is to add a configure flag which either enables or disables stripping. FossilOrigin-Name: 6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46 --- autoconf/Makefile.in | 9 +++------ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 0fa9065be8..009398617c 100644 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -72,11 +72,8 @@ LDFLAGS.rt = @LDFLAGS_RT@ LDFLAGS.icu = @LDFLAGS_ICU@ CFLAGS.icu = @CFLAGS_ICU@ -# When cross-compiling, we need to avoid the -s flag because it only -# works on the build host's platform. -INSTALL.strip.1 = $(INSTALL) -INSTALL.strip.0 = $(INSTALL) -s -INSTALL.strip = $(INSTALL.strip.@IS_CROSS_COMPILING@) +# INSTALL reminder: we specifically do not strip binaries, +# as discussed in https://sqlite.org/forum/forumpost/9a67df63eda9925c. INSTALL.noexec = $(INSTALL) -m 0644 install-dir.bin = $(DESTDIR)$(bindir) @@ -242,7 +239,7 @@ sqlite3$(T.exe)-0: sqlite3$(T.exe) all: sqlite3$(T.exe)-$(HAVE_WASI_SDK) install-shell-0: sqlite3$(T.exe) $(install-dir.bin) - $(INSTALL.strip) sqlite3$(T.exe) "$(install-dir.bin)" + $(INSTALL) sqlite3$(T.exe) "$(install-dir.bin)" install-shell-1: install: install-shell-$(HAVE_WASI_SDK) diff --git a/manifest b/manifest index 3a9273ef0f..e53dc8b04f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Slightly\ssimplify\sproj-current-proc-name. -D 2025-03-21T22:14:30.044 +C In\sthe\sautoconf\sbundle,\sdo\snot\sstrip\sbinaries\sduring\sinstallation,\sfor\sparity\swith\sthe\scanonical\sbuild\sand\sthe\slegacy\sbuild.\sDiscussed\sin\s[forum:9a67df63eda9925c|forum\spost\s9a67df63eda9925c].\sA\spotential\sTODO\shere\sis\sto\sadd\sa\sconfigure\sflag\swhich\seither\senables\sor\sdisables\sstripping. +D 2025-03-22T12:15:13.411 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -16,7 +16,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.in b499f790938d5334a5e22fa9a91af603661e714dea40cd5fb60d03f500b3ae4f +F autoconf/Makefile.in 1fe497c0df20102f7824ec8a3423cc13c26505655456ecd06a7a8ab02f606586 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 914768f3f5d63a891e1cd578afc676960376fc28ee0fa452fcd32cec0ea5cdaf -R 5ebc42a335e940672eaf8de2b02c74fc +P 6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775 +R d1ffac2a55e3dd0a47e636cf53422326 U stephan -Z 11db84ad0c2b37daef67514310a5b653 +Z 5228f6e80ecc00f8456564524a3b87e2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9ac41ff81c..1e0f91aeb5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775 +6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46 From d877b56688c01e7a0a2f393fbe62ac60a04fd615 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 22 Mar 2025 12:43:22 +0000 Subject: [PATCH 26/26] Configure script internal cleanups and re-orgs. No functional changes. FossilOrigin-Name: f619e40fb05d3e09dca2ad9d9bbf38c66b4b93dd3d4e7c2071db28e671ee6a9c --- Makefile.in | 1 - auto.def | 1 - autoconf/auto.def | 9 ++ autosetup/proj.tcl | 19 ++-- autosetup/sqlite-config.tcl | 194 ++++++++++++++++-------------------- main.mk | 3 + manifest | 22 ++-- manifest.uuid | 2 +- 8 files changed, 122 insertions(+), 129 deletions(-) diff --git a/Makefile.in b/Makefile.in index 6a2ba323a0..3bb66f13ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -340,5 +340,4 @@ distclean: distclean-autosetup version-info$(T.exe): $(TOP)/tool/version-info.c Makefile sqlite3.h $(T.link) $(ST_OPT) -o $@ $(TOP)/tool/version-info.c -IS_CROSS_COMPILING = @IS_CROSS_COMPILING@ include $(TOP)/main.mk diff --git a/auto.def b/auto.def index ee852dddf5..a1191cdd1e 100644 --- a/auto.def +++ b/auto.def @@ -12,7 +12,6 @@ # # JimTCL: https://jim.tcl.tk # - use sqlite-config sqlite-configure canonical { proj-if-opt-truthy dev { diff --git a/autoconf/auto.def b/autoconf/auto.def index 5d7ff83913..85fa7d93ed 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -8,4 +8,13 @@ sqlite-configure autoconf { sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk] sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment sqlite-check-common-system-deps + proj-define-for-opt static-shell ENABLE_STATIC_SHELL \ + "Link library statically into the CLI shell?" + if {![opt-bool shared] && ![opt-bool static-shell]} { + proj-opt-set shared 1 + proj-indented-notice { + NOTICE: ignoring --disable-shared because --disable-static-shell + was specified. + } + } } diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 46e845bb8a..3e703d007a 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -75,22 +75,22 @@ proc proj-fatal {msg} { } ######################################################################## -# @proj-assert script +# @proj-assert script ?message? # # Kind of like a C assert: if uplevel (eval) of [expr {$script}] is # false, a fatal error is triggered. The error message, by default, -# includes the body of the failed assertion, but if $descr is set then +# includes the body of the failed assertion, but if $msg is set then # that is used instead. -proc proj-assert {script {descr ""}} { +proc proj-assert {script {msg ""}} { if {1 == [get-env proj-assert 0]} { msg-result [proj-bold "asserting: $script"] } set x "expr \{ $script \}" if {![uplevel 1 $x]} { - if {"" eq $descr} { - set descr $script + if {"" eq $msg} { + set msg $script } - proj-fatal "Assertion failed: $descr" + proj-fatal "Assertion failed: $msg" } } @@ -188,7 +188,8 @@ proc proj-lshift_ {listVar {count 1}} { # Expects to receive string input, which it splits on newlines, strips # out any lines which begin with any number of whitespace followed by # a '#', and returns a value containing the [append]ed results of each -# remaining line with a \n between each. +# remaining line with a \n between each. It does not strip out +# comments which appear after the first non-whitespace character. proc proj-strip-hash-comments {val} { set x {} foreach line [split $val \n] { @@ -223,8 +224,8 @@ proc proj-cflags-without-werror {{var CFLAGS}} { # # - Does not make any global changes to the LIBS define. # -# - Strips out -W... warning flags from CFLAGS before running the -# test, as these feature tests will often fail if -Werror is used. +# - Strips out the -Werror flag from CFLAGS before running the test, +# as these feature tests will often fail if -Werror is used. # # Returns the result of cc-check-function-in-lib (i.e. true or false). # The resulting linker flags are stored in the [define] named diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index 5bf9e34c4b..15c0995500 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -13,9 +13,11 @@ if {[string first " " $autosetup(builddir)] != -1} { } use proj -# We want this version info to be emitted up front, but we have to -# 'use system' for --prefix=... to work. Ergo, this bit is up here -# instead of in [sqlite-configure]. +# +# We want the package version info to be emitted early on, but doing +# so requires a bit of juggling. We have to [use system] for +# --prefix=... to work and to emit the Host/Build system info, but we +# don't want those to interfere with --help output. define PACKAGE_VERSION [proj-file-content -trim $::autosetup(srcdir)/VERSION] if {"--help" ni $::argv} { msg-result "Configuring SQLite version [get-define PACKAGE_VERSION]" @@ -28,15 +30,23 @@ if {"--help" ni $::argv} { } # -# Object for communicating config-time state across various +# Object for communicating certain config-time state across various # auto.def-related pieces. -# -array set sqliteConfig [proj-strip-hash-comments { +array set sqliteConfig [subst [proj-strip-hash-comments { + # + # Gets set by [sqlite-configure] (the main configure script driver). + build-mode unknown # # Gets set to 1 when using jimsh for code generation. May affect # later decisions. use-jim-for-codegen 0 # + # Set to 1 when cross-compiling This value may be changed by certain + # build options, so it's important that config code which checks for + # cross-compilation uses this var instead of + # [proj-is-cross-compiling]. + is-cross-compiling [proj-is-cross-compiling] + # # Pass msg-debug=1 to configure to enable obnoxiously loud output # from [msg-debug]. msg-debug-enabled 0 @@ -49,15 +59,7 @@ array set sqliteConfig [proj-strip-hash-comments { # (dump-defines-txt) but also a JSON file named after this option's # value. dump-defines-json "" -}] - -# -# Set to 1 when cross-compiling This value may be changed by certain -# build options, so it's important that config code which checks for -# cross-compilation uses this var instead of -# [proj-is-cross-compiling]. -# -set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling] +}]] ######################################################################## # Processes all configure --flags for this build, run build-specific @@ -69,13 +71,18 @@ set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling] # $buildMode, with the caveat that _some_ build-specific code is # encapsulated in the configuration finalization step. # -# The intent is that all build-mode-specific configuration goes inside -# the $configScript argument to this function, and that an auto.def file -# contains only two commands: +# The intent is that all (or almost all) build-mode-specific +# configuration goes inside the $configScript argument to this +# function, and that an auto.def file contains only two commands: # # use sqlite-config # sqlite-configure BUILD_NAME { build-specific configure script } +# +# There are snippets of build-mode-specific decision-making in +# [sqlite-configure-finalize] proc sqlite-configure {buildMode configScript} { + proj-assert {$::sqliteConfig(build-mode) eq "unknown"} \ + "sqlite-configure must not be called more than once" set allBuildModes {canonical autoconf} if {$buildMode ni $allBuildModes} { user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes" @@ -172,11 +179,6 @@ proc sqlite-configure {buildMode configScript} { {*} { threadsafe=1 => {Disable mutexing} with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always} - largefile=1 - => {This legacy flag has no effect on the library but may influence - the contents of the generated sqlite_cfg.h} - # ^^^ It's not clear that LFS support actually does anything, - # as HAVE_LFS is not checked anywhere in the .c/.h/.in files. load-extension=1 => {Disable loading of external extensions} math=1 => {Disable math functions} json=1 => {Disable JSON functions} @@ -190,6 +192,9 @@ proc sqlite-configure {buildMode configScript} { rtree => {Enable the RTREE extension} session => {Enable the SESSION extension} all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions} + largefile=1 + => {This legacy flag has no effect on the library but may influence + the generated sqlite_cfg.h by adding #define HAVE_LFS} } } @@ -370,84 +375,16 @@ proc sqlite-configure {buildMode configScript} { dict incr xopts -level return {*}$xopts $msg } - sqlite-post-options-init + sqlite-configure-phase1 $buildMode uplevel 1 $configScript sqlite-configure-finalize }; # sqlite-configure ######################################################################## -# Performs late-stage config steps common to all supported -# $::sqliteConfig(build-mode) values. -proc sqlite-configure-finalize {} { - set buildMode $::sqliteConfig(build-mode) - set isCanonical [expr {$buildMode eq "canonical"}] - set isAutoconf [expr {$buildMode eq "autoconf"}] - proj-assert {$isCanonical || $isAutoconf} "Unknown build mode: $buildMode" - - define HAVE_LFS 0 - if {[opt-bool largefile]} { - # - # Insofar as we can determine HAVE_LFS has no effect on the - # library. Perhaps it did back in the early 2000's. The - # --enable/disable-largefile flag is retained because it's - # harmless, but it doesn't do anything useful. It does have - # visible side-effects, though: the generated sqlite_cfg.h may (or - # may not) define HAVE_LFS. - # - cc-check-lfs - } - - if {$isCanonical} { - if {![opt-bool static]} { - proj-indented-notice { - NOTICE: static lib build may be implicitly re-activated by - other components, e.g. some test apps. - } - } - } else { - proj-assert { $isAutoconf } "Invalid build mode" - proj-define-for-opt static-shell ENABLE_STATIC_SHELL \ - "Link library statically into the CLI shell?" - if {![opt-bool shared] && ![opt-bool static-shell]} { - proj-opt-set shared 1 - proj-indented-notice { - NOTICE: ignoring --disable-shared because --disable-static-shell - was specified. - } - } - } - proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?" - proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?" - - sqlite-handle-debug - sqlite-handle-rpath - sqlite-handle-soname - sqlite-handle-threadsafe - sqlite-handle-tempstore - sqlite-handle-line-editing - sqlite-handle-load-extension - sqlite-handle-math - sqlite-handle-icu - sqlite-handle-env-quirks - sqlite-handle-common-feature-flags - sqlite-finalize-feature-flags - ######################################################################## - # When cross-compiling, we have to avoid using the -s flag to - # /usr/bin/install: - # https://sqlite.org/forum/forumpost/9a67df63eda9925c - define IS_CROSS_COMPILING $::sqliteConfig(is-cross-compiling) - sqlite-process-dot-in-files - sqlite-post-config-validation - sqlite-dump-defines -}; # sqlite-configure-finalize - -######################################################################## -# Runs some common initialization which must happen immediately after -# autosetup's [options] function is called. This is also a convenient -# place to put some generic pieces common to both the canonical -# top-level build and the "autoconf" build, but it's not intended to -# be a catch-all dumping ground for such. -proc sqlite-post-options-init {} { +# Runs "phase 1" of the configure process: after initial --flags +# handling but before the build-specific parts are run. $buildMode +# must be the mode which was passed to [sqlite-configure]. +proc sqlite-configure-phase1 {buildMode} { define PACKAGE_NAME sqlite define PACKAGE_URL {https://sqlite.org} define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum @@ -460,6 +397,8 @@ proc sqlite-post-options-init {} { with-readline-lib => with-readline-ldflags with-debug => debug } + set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]] + proc-debug "msg-debug is enabled" sqlite-autoreconfig proj-file-extensions if {".exe" eq [get-define TARGET_EXEEXT]} { @@ -469,8 +408,49 @@ proc sqlite-post-options-init {} { define SQLITE_OS_UNIX 1 define SQLITE_OS_WIN 0 } - set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]] sqlite-setup-default-cflags + sqlite-handle-debug + define HAVE_LFS 0 + if {[opt-bool largefile]} { + # + # Insofar as we can determine HAVE_LFS has no effect on the + # library. Perhaps it did back in the early 2000's. The + # --enable/disable-largefile flag is retained because it's + # harmless, but it doesn't do anything useful. It does have + # visible side-effects, though: the generated sqlite_cfg.h may (or + # may not) define HAVE_LFS. + cc-check-lfs + } +}; # sqlite-configure-phase1 + +######################################################################## +# Performs late-stage config steps common to all supported +# $::sqliteConfig(build-mode) values. +proc sqlite-configure-finalize {} { + sqlite-handle-rpath + sqlite-handle-soname + sqlite-handle-threadsafe + sqlite-handle-tempstore + sqlite-handle-load-extension + sqlite-handle-math + sqlite-handle-icu + sqlite-handle-line-editing + + proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?" + if {![proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"]} { + # This notice really only applies to the canonical build... + proj-indented-notice { + NOTICE: static lib build may be implicitly re-activated by + other components, e.g. some test apps. + } + } + + sqlite-handle-env-quirks + sqlite-handle-common-feature-flags + sqlite-finalize-feature-flags + sqlite-process-dot-in-files; # do not [define] anything after this + sqlite-post-config-validation + sqlite-dump-defines } ######################################################################## @@ -568,6 +548,10 @@ proc sqlite-check-common-bins {} { ######################################################################## # Run checks for system-level includes and libs which are common to # both the canonical build and the "autoconf" bundle. +# +# For the canonical build this must come after +# [sqlite-handle-wasi-sdk], as that function may change the +# environment in ways which affect this. proc sqlite-check-common-system-deps {} { # Check for needed/wanted data types cc-with {-includes stdint.h} \ @@ -678,7 +662,7 @@ proc sqlite-setup-default-cflags {} { } ######################################################################## -# Handle various SQLITE_ENABLE_... feature flags. +# Handle various SQLITE_ENABLE/OMIT_... feature flags. proc sqlite-handle-common-feature-flags {} { msg-result "Feature flags..." foreach {boolFlag featureFlag ifSetEvalThis} { @@ -738,7 +722,6 @@ proc sqlite-handle-common-feature-flags {} { msg-result " - $boolFlag" } } - } ######################################################################### @@ -762,13 +745,12 @@ proc sqlite-finalize-feature-flags {} { } ######################################################################## -# Checks for the --debug flag, defining SQLITE_DEBUG to 1 if it is -# true. TARGET_DEBUG gets defined either way, with content depending -# on whether --debug is true or false. +# Checks for the --debug flag and [define]s TARGET_DEBUG based on +# that. TARGET_DEBUG is unused in the autoconf build but that is +# arguably a bug. proc sqlite-handle-debug {} { msg-checking "SQLITE_DEBUG build? " proj-if-opt-truthy debug { - define SQLITE_DEBUG 1 define TARGET_DEBUG {-g -DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0 -Wall} proj-opt-set memsys5 msg-result yes @@ -1151,7 +1133,7 @@ proc sqlite-check-line-editing {} { if {"" ne $rlInc} { set rlLib [opt-val with-readline-ldflags] #proc-debug "rlLib=$rlLib" - if {$rlLib eq "auto" || $rlLib eq ""} { + if {$rlLib in {auto ""}} { set rlLib "" set libTerm "" if {[proj-check-function-in-lib tgetent "$editLibName ncurses curses termcap"]} { @@ -1261,7 +1243,7 @@ proc sqlite-handle-icu {} { msg-result "Checking for ICU support..." set icuConfigBin [opt-val with-icu-config] set tryIcuConfigBin 1; # set to 0 if we end up using pkg-config - if {"auto" eq $icuConfigBin || "pkg-config" eq $icuConfigBin} { + if {$icuConfigBin in {auto pkg-config}} { if {[pkg-config-init 0] && [pkg-config icu-io]} { # Maintenance reminder: historical docs say to use both of # (icu-io, icu-uc). icu-uc lacks a required lib and icu-io has @@ -1387,7 +1369,7 @@ proc sqlite-handle-math {} { define LDFLAGS_MATH [get-define lib_ceil] undefine lib_ceil sqlite-add-feature-flag {-DSQLITE_ENABLE_MATH_FUNCTIONS} - msg-result "Enabling math SQL functions [get-define LDFLAGS_MATH]" + msg-result "Enabling math SQL functions" } { define LDFLAGS_MATH "" msg-result "Disabling math SQL functions" diff --git a/main.mk b/main.mk index 93cfe4b7c1..bcdfbd8638 100644 --- a/main.mk +++ b/main.mk @@ -187,6 +187,9 @@ CFLAGS.readline ?= -I$(prefix)/include # during installation, which may break the build of targets which are # built after others are installed. # +# Maintenance reminder: we specifically do not strip binaries, as +# discussed in https://sqlite.org/forum/forumpost/9a67df63eda9925c. +# INSTALL ?= install # # $(ENABLE_LIB_SHARED) = diff --git a/manifest b/manifest index e53dc8b04f..45d50e3329 100644 --- a/manifest +++ b/manifest @@ -1,9 +1,9 @@ -C In\sthe\sautoconf\sbundle,\sdo\snot\sstrip\sbinaries\sduring\sinstallation,\sfor\sparity\swith\sthe\scanonical\sbuild\sand\sthe\slegacy\sbuild.\sDiscussed\sin\s[forum:9a67df63eda9925c|forum\spost\s9a67df63eda9925c].\sA\spotential\sTODO\shere\sis\sto\sadd\sa\sconfigure\sflag\swhich\seither\senables\sor\sdisables\sstripping. -D 2025-03-22T12:15:13.411 +C Configure\sscript\sinternal\scleanups\sand\sre-orgs.\sNo\sfunctional\schanges. +D 2025-03-22T12:43:22.020 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d -F Makefile.in 2c4d3c20e42ddd7596432c8d45feeaf709f93b37279e274ea413034912a4f840 +F Makefile.in 86cc5297495fd5ce632cd7ec298c562900f874eef42c44d5890bd22397bb3820 F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0 F Makefile.msc ef04498c7e227a0f459b105bb4952f26cc985d1d6340a367e62d5a79c4689dfb F README.md a953c0cffd6e4f2501a306c00ee2b6e1e6630c25031e094629307fe99dd003d1 @@ -14,13 +14,13 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 23f0e7eb5eff4cf922963e667ed630793ed60300df59ef9d93c87a23e31c7232 +F auto.def f769bf3111089ee9471a2a872c47651c4e29e81d104a52867ab544fde5ef6bad F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in 1fe497c0df20102f7824ec8a3423cc13c26505655456ecd06a7a8ab02f606586 F autoconf/Makefile.msc 5bc67d3912444c40c6f96d003e5c90663e51abb83d204a520110b1b2038dcd8b F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 1a32296d8bbdd67110c79d224c92c05545a0b5bd0c272950025fe3c7c7b49580 -F autoconf/auto.def 42d239bda4feffe1cf8a431dae35f83d100f2c17ed4b189edeb12f067bd4fa90 +F autoconf/auto.def 4cb3c39042039bb852034dc1a9d42717d42eef759a687a664ad283db8e6b816e F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 6c396709b45eb2b3be0ae6dc7e40a140d231962e3a2354da6c4dd48b1d9999bc F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 8bb4158e71b5d60070b86af3f7b1edf960c60b77f102ea5d688d89c7d57d8a32 -F autosetup/sqlite-config.tcl ff39112eddc68e9505562c6aefc0b505190fe1fe93b2273e0b50ce5c7bbf6e64 +F autosetup/proj.tcl 49faf960df88a374686234105def663dbfc297ab79c87686df0a0b973dd77018 +F autosetup/sqlite-config.tcl 6e1dce27dfb69910bc28c3d3d4e33470fffc3c68f1d6a87799d34a2cc27f79dd F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl eb4c6578e08dd353263958da0dc620f8400b869a50d06e271ab0be85a51a08d3 @@ -707,7 +707,7 @@ F ext/wasm/tests/opfs/sahpool/sahpool-pausing.js f264925cfc82155de38cecb3d204c36 F ext/wasm/tests/opfs/sahpool/sahpool-worker.js bd25a43fc2ab2d1bafd8f2854ad3943ef673f7c3be03e95ecf1612ff6e8e2a61 F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702 F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0 -F main.mk 7006135b902177f7c8bca2733a6820b72a0c6f5a47412b2a7c86668f0398f1fd +F main.mk a8930b3338afa3065f89735c6e5f9a9d64d90bd3154fe4580696502a7c2a99ad F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421 @@ -2216,8 +2216,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 6a0ca9f2360d29272d7be97fe9f516c3ac88864f3e729ba65da1ef6211908775 -R d1ffac2a55e3dd0a47e636cf53422326 +P 6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46 +R 62beb2007ca701c04bb0d952df27e3be U stephan -Z 5228f6e80ecc00f8456564524a3b87e2 +Z 0c3e870740ca71059ff9bfd7fd177692 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1e0f91aeb5..3b86c2d55b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6d2e57bd34c562a9cd618c178c3f92b869bf5420907057b8d2438b16a7f91d46 +f619e40fb05d3e09dca2ad9d9bbf38c66b4b93dd3d4e7c2071db28e671ee6a9c