From c521826a10eeda1f22573c955de13359de6e77e7 Mon Sep 17 00:00:00 2001 From: lazymio Date: Sun, 26 Jul 2026 07:24:44 +0000 Subject: [PATCH 1/3] CI(full): Fix Windows MSVC C23 build and retired macos-13 runner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two things broke the release pipeline for v0.3.2: 1. Chocolatey now ships CMake 4.4.0, which advertises c_std_23 in CMAKE_C_COMPILE_FEATURES for MSVC. libmdbx therefore selects C_STANDARD 23 (/std:clatest), and MSVC then fails to parse the C23 attributes in mdbx.c: mdbx.c(31103,21): error C2143: syntax error: missing ';' before 'const' mdbx.c(31103,3): error C2416: attribute [[maybe_unused]] cannot be applied in this context Only build_wheels_all hit this because it is the job that runs `choco install cmake`; the fast job kept using the image's older CMake and got /std:c11. Pin CMAKE_C_STANDARD=11 for MSVC so the result no longer depends on which CMake happens to be on PATH — this also fixes sdist builds on Windows machines with CMake 4.x. 2. The macos-13 runner image was retired in December 2025, so those jobs sat queued forever and never let the publish job start. Move to macos-15-intel, the x86_64 replacement label (available until Aug 2027). Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/wheels.yaml | 4 ++-- build_mdbx.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 08016cd..67142eb 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -21,7 +21,7 @@ jobs: - os: windows-2022 cibw: "cp310*" cibw_skip: "*-win32" - - os: macos-13 + - os: macos-15-intel cibw: "cp310*" cibw_skip: "" - os: macos-latest @@ -94,7 +94,7 @@ jobs: - os: windows-2022 cibw: "{cp312*,cp313*}" cibw_skip: "*-win32" - - os: macos-13 + - os: macos-15-intel cibw: "{cp311*,cp312*,cp313*}" cibw_skip: "" - os: macos-latest diff --git a/build_mdbx.py b/build_mdbx.py index 5aae3b6..2c8a8e6 100644 --- a/build_mdbx.py +++ b/build_mdbx.py @@ -73,7 +73,10 @@ def build(setup_kws: dict): plat = 'Win32' if platform.architecture()[0] == '32bit' else 'x64' cmake_gen += [ "-G", "Visual Studio 17 2022", - "-A", plat + "-A", plat, + # CMake >= 4.4 reports c_std_23 for MSVC, so libmdbx would pick + # /std:clatest, where MSVC chokes on the C23 attributes in mdbx.c. + "-DCMAKE_C_STANDARD=11" ] cmake_gen += [ From 9a65f963abe676a52c4e750afde8c393140fc487 Mon Sep 17 00:00:00 2001 From: lazymio Date: Sun, 26 Jul 2026 07:31:59 +0000 Subject: [PATCH 2/3] CI(full): Stop fetching libmdbx tags from gitflic.ru The Linux wheel jobs fail intermittently in `git fetch --tags`, which recurses into the submodule and has to reach gitflic.ru: fatal: error processing acks: 4 Errors during submodule fetch: libmdbx ##[error]Command ['sh', '-c', 'pip install ninja && git fetch --tags'] failed with code 1. Nothing needs those tags any more. Since v0.13.x libmdbx resolves its version solely from the committed VERSION.json (cmake/utils.cmake fetch_version()), and its GNUmakefile never shells out to git either; configuring a checkout with .git removed still yields `MDBX_VERSION: 0.13.12`. Drop the fetch so a flaky third-party host is no longer in the path of every wheel build. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/wheels.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 67142eb..41e4240 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -59,9 +59,9 @@ jobs: CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries CIBW_BUILD: ${{ matrix.config.cibw }} CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS - CIBW_BEFORE_BUILD_LINUX: pip install ninja && git fetch --tags - CIBW_BEFORE_BUILD_WINDOWS: choco install ninja git && cd libmdbx && git fetch --tags - CIBW_BEFORE_BUILD_MACOS: brew install ninja git && cd libmdbx && git fetch --tags + CIBW_BEFORE_BUILD_LINUX: pip install ninja + CIBW_BEFORE_BUILD_WINDOWS: choco install ninja git + CIBW_BEFORE_BUILD_MACOS: brew install ninja git CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: pytest {package}/tests CIBW_SKIP: ${{ matrix.config.cibw_skip }} @@ -136,9 +136,9 @@ jobs: CIBW_BUILD_FRONTEND: build # pip backend doesn't seem including our dynamic libraries CIBW_BUILD: ${{ matrix.config.cibw }} CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=13.0 SYSTEM_VERSION_COMPAT=0 # Shitty arm macOS - CIBW_BEFORE_BUILD_LINUX: pip install ninja && git fetch --tags - CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git && cd libmdbx && git fetch --tags - CIBW_BEFORE_BUILD_MACOS: brew install ninja git && cd libmdbx && git fetch --tags + CIBW_BEFORE_BUILD_LINUX: pip install ninja + CIBW_BEFORE_BUILD_WINDOWS: choco install ninja cmake git + CIBW_BEFORE_BUILD_MACOS: brew install ninja git CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: pytest {package}/tests CIBW_SKIP: ${{ matrix.config.cibw_skip }} @@ -162,7 +162,7 @@ jobs: - name: Build SDist run: | sudo apt update && sudo apt install ninja-build git build-essential -y - cd libmdbx && git fetch --tags && make V=1 && cd .. + cd libmdbx && make V=1 && cd .. python3 -m pip install -U pip build python3 -m build --sdist From 88d1fdf020c9e1e60c34e931ebeeec89a2c0538f Mon Sep 17 00:00:00 2001 From: lazymio Date: Sun, 26 Jul 2026 07:37:58 +0000 Subject: [PATCH 3/3] CI(full): Fix flaky test_db_iter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_db_iter records its random pairs in a list and asserts every one of them afterwards, but id_generator() draws from 36^6 keys and the test makes 1024 draws per map across 15 maps — so a repeated key is a ~0.4% event per run. When it happens the second put overwrites the first and the assertion for the earlier pair fails: AssertionError: '6F8NK3' != '8XJ126' (tests/test_mdbx.py:101) That is roughly one red job in every few CI runs, which is enough to block a release tag at random. Keep the pairs in a dict and skip keys already drawn, which is what test_multi_write right below already does. Verified by shrinking id_generator to 3 characters so collisions are certain: the previous code reproduces the exact failure above, the new code passes. Co-Authored-By: Claude Opus 5 (1M context) --- tests/test_mdbx.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_mdbx.py b/tests/test_mdbx.py index 6682e0c..c37636b 100644 --- a/tests/test_mdbx.py +++ b/tests/test_mdbx.py @@ -76,17 +76,21 @@ def test_db_readitem_writeitem(self) -> None: def test_db_iter(self) -> None: MDBX_TEST_DB_DIR = "%s/%s" % (MDBX_TEST_DIR, inspect.stack()[0][3]) db = mdbx.Env(MDBX_TEST_DB_DIR, maxdbs=1024) - db_pairs: dict[str, list[tuple[str, str]]] = {} + db_pairs: dict[str, dict[str, str]] = {} txn = db.start_transaction() for i in range(15): name = id_generator() dbi = txn.create_map(name) - db_pairs[name] = [] + db_pairs[name] = {} + ref = db_pairs[name] for i in range(1024): - pair = (id_generator(), id_generator()) - db_pairs[name].append(pair) - dbi.put(txn, pair[0].encode("utf-8"), pair[1].encode("utf-8")) + key, val = id_generator(), id_generator() + # A repeated key overwrites the previous value, so only the + # last one can be asserted afterwards. + if key not in ref: + ref[key] = val + dbi.put(txn, key.encode("utf-8"), val.encode("utf-8")) txn.commit() del txn dbi.close() @@ -97,7 +101,7 @@ def test_db_iter(self) -> None: txn = db.start_transaction(flags=mdbx.MDBXTXNFlags.MDBX_TXN_RDONLY) for db_name, pairs in db_pairs.items(): dbi = txn.open_map(db_name) - for key, val in pairs: + for key, val in pairs.items(): self.assertEqual(dbi.get(txn, key.encode("utf-8")).decode("utf-8"), val) db.close()