diff --git a/.github/workflows/build-native-action.yml b/.github/workflows/build-native-action.yml index 4a96ad4a..b0c70e0b 100644 --- a/.github/workflows/build-native-action.yml +++ b/.github/workflows/build-native-action.yml @@ -37,6 +37,11 @@ jobs: RELENV_DATA: ${{ github.workspace }} steps: + - name: "Throttle Builds" + shell: bash + run: | + t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" + - uses: actions/checkout@v3 - name: Set up Python 3.10 @@ -96,6 +101,11 @@ jobs: RELENV_DATA: ${{ github.workspace }} steps: + - name: "Throttle Builds" + shell: bash + run: | + t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" + - uses: actions/checkout@v3 - name: Patch /usr/local @@ -214,6 +224,11 @@ jobs: RELENV_DATA: ${{ github.workspace }} steps: + - name: "Throttle Builds" + shell: bash + run: | + t=$(python3 -c 'import random, sys; sys.stdout.write(str(random.randint(0, 600)))'); echo "Sleeping $t seconds"; sleep "$t" + - uses: actions/checkout@v3 - name: Set up Python 3.10 diff --git a/CHANGELOG.md b/CHANGELOG.md index bf54cb33..d7577c51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +0.20.5 +====== + +* Update gdbm from 1.25 to 1.26 +* Update libffi from 3.5.1 to 3.5.2 +* Update readline from 8.2.13 to 8.3 +* Update sqlite from 3.50.2 to 3.50.4 + + 0.20.4 ====== diff --git a/relenv/_scripts/install_vc_build.ps1 b/relenv/_scripts/install_vc_build.ps1 index 19fe28b9..5528ca7e 100644 --- a/relenv/_scripts/install_vc_build.ps1 +++ b/relenv/_scripts/install_vc_build.ps1 @@ -150,7 +150,7 @@ if ( Test-Path -Path $MSBUILD_BIN ) { "--add Microsoft.VisualStudio.Component.VC.140", ` "--lang en-US", ` "--includeRecommended", ` - "--quiet", ` + # "--quiet", ` "--wait" ` -Wait -WindowStyle Hidden if ( Test-Path -Path "$env:TEMP\build_tools\vs_buildtools.exe" ) { diff --git a/relenv/build/__init__.py b/relenv/build/__init__.py index 098510a5..6de0b692 100644 --- a/relenv/build/__init__.py +++ b/relenv/build/__init__.py @@ -13,7 +13,7 @@ from ..pyversions import python_versions, Version -from ..common import build_arch +from ..common import build_arch, DEFAULT_PYTHON def platform_module(): @@ -58,7 +58,7 @@ def setup_parser(subparsers): ) build_subparser.add_argument( "--python", - default="3.10.17", + default=DEFAULT_PYTHON, type=str, help="The python version [default: %(default)s]", ) diff --git a/relenv/build/darwin.py b/relenv/build/darwin.py index c53d7651..11964697 100644 --- a/relenv/build/darwin.py +++ b/relenv/build/darwin.py @@ -99,8 +99,8 @@ def build_python(env, dirs, logfp): download={ "url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz", "fallback_url": "https://woz.io/relenv/dependencies/sqlite-autoconf-{version}.tar.gz", - "version": "3500200", - "checksum": "f57c0e54fcddf91f73916987d5c52e743c8bfa76", + "version": "3500400", + "checksum": "145048005c777796dd8494aa1cfed304e8c34283", }, ) diff --git a/relenv/build/linux.py b/relenv/build/linux.py index 8b8d2afa..a0363487 100644 --- a/relenv/build/linux.py +++ b/relenv/build/linux.py @@ -500,8 +500,8 @@ def build_python(env, dirs, logfp): build_func=build_sqlite, download={ "url": "https://sqlite.org/2025/sqlite-autoconf-{version}.tar.gz", - "version": "3500200", - "checksum": "f57c0e54fcddf91f73916987d5c52e743c8bfa76", + "version": "3500400", + "checksum": "145048005c777796dd8494aa1cfed304e8c34283", "checkfunc": sqlite_version, "checkurl": "https://sqlite.org/", }, @@ -523,8 +523,8 @@ def build_python(env, dirs, logfp): build_func=build_gdbm, download={ "url": "https://ftp.gnu.org/gnu/gdbm/gdbm-{version}.tar.gz", - "version": "1.25", - "checksum": "d55bdf2bb5f92f80006166dd8a8323cb2a428bd1", + "version": "1.26", + "checksum": "6cee3657de948e691e8df26509157be950cef4d4", "checkfunc": tarball_version, }, ) @@ -548,8 +548,8 @@ def build_python(env, dirs, logfp): build_libffi, download={ "url": "https://github.com/libffi/libffi/releases/download/v{version}/libffi-{version}.tar.gz", - "version": "3.5.1", - "checksum": "5375e956b0d662e118e47758bd656861e43ba3ef", + "version": "3.5.2", + "checksum": "2bd35b135b0eeb5c631e02422c9dbe786ddb626a", "checkfunc": github_version, "checkurl": "https://github.com/libffi/libffi/releases/", }, @@ -595,8 +595,8 @@ def build_python(env, dirs, logfp): wait_on=["ncurses"], download={ "url": "https://ftp.gnu.org/gnu/readline/readline-{version}.tar.gz", - "version": "8.2.13", - "checksum": "5ffb6a334c2422acbe8f4d2cb11e345265c8d930", + "version": "8.3", + "checksum": "2c05ae9350b695f69d70b47f17f092611de2081f", "checkfunc": tarball_version, }, ) diff --git a/relenv/build/windows.py b/relenv/build/windows.py index 4bedaf9c..861a1337 100644 --- a/relenv/build/windows.py +++ b/relenv/build/windows.py @@ -36,6 +36,44 @@ def populate_env(env, dirs): env["MSBUILDDISABLENODEREUSE"] = "1" +def patch_file(path, old, new): + """ + Search a file line by line for a string to replace. + + :param path: Location of the file to search + :type path: str + :param old: The value that will be replaced + :type path: str + :param new: The value that will replace the 'old' value. + :type path: str + """ + import re + + with open(path, "r") as fp: + content = fp.read() + new_content = "" + for line in content.splitlines(): + re.sub(old, new, line) + new_content += line + os.linesep + with open(path, "w") as fp: + fp.write(new_content) + + +def override_dependency(source, old, new): + """ + Overwrite a dependency string for Windoes PCBuild. + + :param source: Python's source directory + :type path: str + :param old: Regular expression to search for + :type path: str + :param new: Replacement text + :type path: str + """ + patch_file(source / "PCbuild" / "python.props", old, new) + patch_file(source / "PCbuild" / "get_externals.bat", old, new) + + def build_python(env, dirs, logfp): """ Run the commands to build Python. @@ -47,6 +85,13 @@ def build_python(env, dirs, logfp): :param logfp: A handle for the log file :type logfp: file """ + # Override default versions + if env["RELENV_PY_MAJOR_VERSION"] in [ + "3.10", + "3.11", + ]: + override_dependency(dirs.source, r"sqlite-\d+.\d+.\d+.\d+", "sqlite-3.50.4.0") + arch_to_plat = { "amd64": "x64", "x86": "win32", diff --git a/relenv/common.py b/relenv/common.py index 6cb5bde8..7b5200f8 100644 --- a/relenv/common.py +++ b/relenv/common.py @@ -18,10 +18,12 @@ import time # relenv package version -__version__ = "0.20.4" +__version__ = "0.20.5" MODULE_DIR = pathlib.Path(__file__).resolve().parent +DEFAULT_PYTHON = "3.10.18" + LINUX = "linux" WIN32 = "win32" DARWIN = "darwin" diff --git a/relenv/fetch.py b/relenv/fetch.py index 31c084b4..403e0201 100644 --- a/relenv/fetch.py +++ b/relenv/fetch.py @@ -11,6 +11,7 @@ from .common import ( CHECK_HOSTS, DATA_DIR, + DEFAULT_PYTHON, __version__, build_arch, check_url, @@ -39,7 +40,7 @@ def setup_parser(subparsers): ) subparser.add_argument( "--python", - default="3.10.18", + default=DEFAULT_PYTHON, type=str, help="The python version [default: %(default)s]", )