Fix ci with latest mdbx code - #25
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surpass #23.
This also adds a test for sdist.