Skip to content

Commit cfb565d

Browse files
committed
Update SQLite to 3.50.3 for binary releases.
1 parent a852c7b commit cfb565d

6 files changed

Lines changed: 32 additions & 17 deletions

File tree

Android/android.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def unpack_deps(host, prefix_dir):
187187
os.chdir(prefix_dir)
188188
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
189189
for name_ver in ["bzip2-1.0.8-3", "libffi-3.4.4-3", "openssl-3.0.15-4",
190-
"sqlite-3.49.1-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
190+
"sqlite-3.50.3-0", "xz-5.4.6-1", "zstd-1.5.7-1"]:
191191
filename = f"{name_ver}-{host}.tar.gz"
192192
download(f"{deps_url}/{name_ver}/{filename}")
193193
shutil.unpack_archive(filename)

Mac/BuildScript/build-installer.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
Usage: see USAGE variable in the script.
3838
"""
3939
import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
40+
import hashlib
4041
try:
4142
import urllib2 as urllib_request
4243
except ImportError:
@@ -359,9 +360,9 @@ def library_recipes():
359360
),
360361
),
361362
dict(
362-
name="SQLite 3.49.1",
363-
url="https://sqlite.org/2025/sqlite-autoconf-3490100.tar.gz",
364-
checksum="106642d8ccb36c5f7323b64e4152e9b719f7c0215acf5bfeac3d5e7f97b59254",
363+
name="SQLite 3.50.3",
364+
url="https://www.sqlite.org/2025/sqlite-autoconf-3500300.tar.gz",
365+
checksum="sha3-256:c3df1542703a666d3f41bb623e9bed7d6e1dc81c57f0c45e3122403f862c520d",
365366
extra_cflags=('-Os '
366367
'-DSQLITE_ENABLE_FTS5 '
367368
'-DSQLITE_ENABLE_FTS4 '
@@ -795,7 +796,7 @@ def downloadURL(url, fname):
795796
def verifyThirdPartyFile(url, checksum, fname):
796797
"""
797798
Download file from url to filename fname if it does not already exist.
798-
Abort if file contents does not match supplied md5 checksum.
799+
Abort if file contents does not match supplied hashlib checksum.
799800
"""
800801
name = os.path.basename(fname)
801802
if os.path.exists(fname):
@@ -805,16 +806,30 @@ def verifyThirdPartyFile(url, checksum, fname):
805806
print("Downloading %s"%(name,))
806807
downloadURL(url, fname)
807808
print("Archive for %s stored as %s"%(name, fname))
808-
if len(checksum) == 32:
809+
if ':' in checksum:
810+
algo, _, checksum = checksum.partition(':')
811+
assert algo in hashlib.algorithms_guaranteed, f"Unsupported {algo}, try sha3-256 or sha256 instead."
812+
if algo in ("md5", "sha1"):
813+
raise ValueError(f"Known insecure checksum algorithm {algo} for {fname}.")
814+
if algo.startswith(("shake", "blake")):
815+
raise ValueError(f"Please stick to sha2 or sha3 standard checksum algorithms, not {algo}")
816+
# TODO remove length based logic AND legacy md5s after updating the ones we already list.
817+
elif len(checksum) == 32:
809818
algo = 'md5'
819+
print("WARNING: insecure md5 used for {fname}", file=sys.stderr)
810820
elif len(checksum) == 64:
811821
algo = 'sha256'
812822
else:
813823
raise ValueError(checksum)
814-
if os.system(
815-
'CHECKSUM=$(openssl %s %s) ; test "${CHECKSUM##*= }" = "%s"'
816-
% (algo, shellQuote(fname), checksum) ):
817-
fatal('%s checksum mismatch for file %s' % (algo, fname))
824+
with open(fname, 'rb') as downloaded_file:
825+
if hasattr(hashlib, 'file_digest'):
826+
hasher = hashlib.file_digest(downloaded_file, algo) # 3.11+
827+
else:
828+
hasher = hashlib.new(algo, downloaded_file.read())
829+
computed_checksum = hasher.hexdigest()
830+
if computed_checksum != checksum:
831+
fatal(f"{algo} hashlib checksum mismatch for file {fname}")
832+
818833

819834
def build_universal_openssl(basedir, archList):
820835
"""

Misc/externals.spdx.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@
9494
"checksumValue": "e335aeb44fa36cde60ecbb6a9f8be6f5d449d645ce9b0199ee53a7e6728d19d2"
9595
}
9696
],
97-
"downloadLocation": "https://github.com/python/cpython-source-deps/archive/refs/tags/sqlite-3.49.1.0.tar.gz",
97+
"downloadLocation": "https://github.com/python/cpython-source-deps/archive/refs/tags/sqlite-3.50.3.0.tar.gz",
9898
"externalRefs": [
9999
{
100100
"referenceCategory": "SECURITY",
101-
"referenceLocator": "cpe:2.3:a:sqlite:sqlite:3.49.1.0:*:*:*:*:*:*:*",
101+
"referenceLocator": "cpe:2.3:a:sqlite:sqlite:3.50.3.0:*:*:*:*:*:*:*",
102102
"referenceType": "cpe23Type"
103103
}
104104
],
105105
"licenseConcluded": "NOASSERTION",
106106
"name": "sqlite",
107107
"primaryPackagePurpose": "SOURCE",
108-
"versionInfo": "3.49.1.0"
108+
"versionInfo": "3.50.3.0"
109109
},
110110
{
111111
"SPDXID": "SPDXRef-PACKAGE-tcl-core",
@@ -214,4 +214,4 @@
214214
}
215215
],
216216
"spdxVersion": "SPDX-2.3"
217-
}
217+
}

PCbuild/get_externals.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ set libraries=%libraries% bzip2-1.0.8
5656
if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.4
5757
if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-3.0.16
5858
set libraries=%libraries% mpdecimal-4.0.0
59-
set libraries=%libraries% sqlite-3.49.1.0
59+
set libraries=%libraries% sqlite-3.50.3.0
6060
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.15.0
6161
if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.15.0
6262
set libraries=%libraries% xz-5.2.5

PCbuild/python.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Import Project="$(ExternalProps)" Condition="$(ExternalProps) != '' and Exists('$(ExternalProps)')" />
7575

7676
<PropertyGroup>
77-
<sqlite3Dir Condition="$(sqlite3Dir) == ''">$(ExternalsDir)sqlite-3.49.1.0\</sqlite3Dir>
77+
<sqlite3Dir Condition="$(sqlite3Dir) == ''">$(ExternalsDir)sqlite-3.50.3.0\</sqlite3Dir>
7878
<bz2Dir Condition="$(bz2Dir) == ''">$(ExternalsDir)bzip2-1.0.8\</bz2Dir>
7979
<lzmaDir Condition="$(lzmaDir) == ''">$(ExternalsDir)xz-5.2.5\</lzmaDir>
8080
<libffiDir Condition="$(libffiDir) == ''">$(ExternalsDir)libffi-3.4.4\</libffiDir>

PCbuild/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ _ssl
237237
again when building.
238238

239239
_sqlite3
240-
Wraps SQLite 3.49.1, which is itself built by sqlite3.vcxproj
240+
Wraps SQLite 3.50.3, which is itself built by sqlite3.vcxproj
241241
Homepage:
242242
https://www.sqlite.org/
243243

0 commit comments

Comments
 (0)