Skip to content

Fix ci with latest mdbx code - #25

Merged
skinkie merged 6 commits into
masterfrom
fix_ci_lts
Jul 26, 2026
Merged

Fix ci with latest mdbx code#25
skinkie merged 6 commits into
masterfrom
fix_ci_lts

Conversation

@wtdcode

@wtdcode wtdcode commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Surpass #23.

This also adds a test for sdist.

skinkie and others added 6 commits July 25, 2026 22:08
Every job on this branch fails, all with the same cause:

    version.c:7:2: error: "API version mismatch! Had `git fetch --tags` done?"

and on Linux, where `make dist` runs first:

    fatal: No tags can describe 'a729d19e7d67a375b802d1becf6624220b696c3d'.
    mdbx.c:37661:28: error: operator '!=' has no right operand

libmdbx-devel is the non-amalgamated tree and carries no VERSION.json, so
GNUmakefile derives MDBX_GIT_* from `git describe --tags` and substitutes
them into src/version.c.in. actions/checkout clones submodules with
--depth=1, which brings no tags, so those expansions come out empty and
`#if MDBX_VERSION_MAJOR != ` fails to parse.

Setting fetch-depth: 0 drops the --depth from the submodule clone, so the
tags come along. Doing it at checkout rather than re-adding a `git fetch`
to CIBW_BEFORE_BUILD keeps the build itself offline. The full clone is only
14 MiB. Verified locally: with tags, `make dist` ends in
"VERIFY amalgamated sources... Ok" and emits VERSION.json with semver
0.13.12.15.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
With the devel tree, msbuild builds every target in libmdbx.sln, which now
includes libmdbx's test suite. That does not compile with MSVC:

    test\extra\rename_dbi.c(28,1): error C1083: Cannot open include file:
    'unistd.h': No such file or directory

The amalgamated tarball never carried test/, which is why this only shows
up after moving to libmdbx-devel. We only ever consume the library, so turn
the tests off: -DMDBX_ENABLE_TESTS=OFF drops all 18 test targets while
keeping mdbx and mdbx-static, and it is accepted (and irrelevant) on the
amalgamated tree too, so the sdist build path is unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Installing the sdist has been broken since #16 added platform_enums.c: the
file is at the project root, which poetry does not pick up, so the build
died right after libmdbx compiled with

    cc1: fatal error: platform_enums.c: No such file or directory

Adding it to include[] is not enough on its own, because it does
`#include "libmdbx/mdbx.h"`. That path only exists in a git checkout; the
sdist ships the amalgamated tree, where the header is at libmdbx/dist/mdbx.h:

    platform_enums.c:1:10: fatal error: libmdbx/mdbx.h: No such file or directory

So include "mdbx.h" and point the compiler at whichever tree build_mdbx.py
picked — libmdbx/ for a checkout, libmdbx/dist/ for an sdist.

Not a regression from the lts move; the published 0.3.1 sdist has the same
root file list, it just predates platform_enums.c and so still built. CI
never notices because make_sdist only builds the tarball, it never installs
from it.

Verified end to end: from a clean venv, `pip install libmdbx-0.3.1.tar.gz`
now succeeds and the repo test suite passes 23/23 against the installed
package. The checkout build path still works too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
make_sdist only built the tarball and uploaded it straight to the publish
job, so nothing ever exercised the sdist install path — every wheel job
builds from the git checkout instead. That is how the missing
platform_enums.c stayed invisible from #16 until now.

Install the freshly built tarball into a clean venv and run the test suite
against it. The tests run from /tmp rather than the workspace, because
./mdbx would otherwise shadow the installed package and we would just be
testing the checkout a second time.

Confirmed to be a real guard, not a no-op: against a tarball without the
preceding fix this step fails at
"cc1: fatal error: platform_enums.c: No such file or directory", and
against the fixed one it installs and passes 23/23.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@skinkie
skinkie merged commit d7eddf5 into master Jul 26, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants