build(plugin-mysql): vendor the MariaDB headers from the version the build pins - #2451
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
The vendored MariaDB Connector/C headers and the static library we ship are different versions, and nothing keeps them together.
Plugins/MySQLDriverPlugin/CMariaDB/include/mariadb_version.hdeclaresMARIADB_PACKAGE_VERSION "3.4.8".Libs/libmariadb_arm64.aanswersmysql_get_client_info()with3.4.4, measured by a probe compiled against it.scripts/build-mariadb.shpinsMARIADB_VERSION="3.4.4"and builds exactly that.So the binary is right and the headers are the wrong artifact. Their own provenance says where they came from: the vendored file carries
MARIADB_PLUGINDIR "/opt/homebrew/Cellar/mariadb-connector-c/3.4.8_1/lib/mariadb/plugin". They were copied out of a Homebrew keg rather than out of the source the build script downloads.What the skew actually contains
Diffed every vendored header against the pinned 3.4.4 source. Five differ, and two of those carry declarations the shipped binary does not export:
errmsg.hCR_ERR_MISSING_ERROR_INFO 5026and movesCR_MARIADB_LAST_ERRORonto it, so the client-error boundary sits one past what the linked library can producemariadb_com.hma_net_write_buffand theUDF_ARGS/UDF_INITstructsma_tls.hma_is_ip_addressmariadb_version.hma_pvio.h,mysql.hChecked the whole surface rather than just those: of 236 function declarations across the headers, exactly two are absent from
libmariadb_arm64.a,mariadb_dyncol_prepare_decimalandmariadb_load_defaults. Neither is referenced anywhere in the repo, and nor is anything else in the table above.That makes this latent rather than active. A call to a declaration the binary lacks fails at link time, which is loud. The quiet half is a macro or a struct that changed between the two versions: it compiles, and then it is wrong.
The change
The headers now come from the 3.4.4 source that
build-mariadb.shpins.mariadb_version.his generated by CMake rather than shipped, so it is rendered from a configure run of that same source instead of copied, which is also what drops the Homebrew path.scripts/check-mariadb-headers.shreads the pinned version out ofbuild-mariadb.sh, downloads that source, renders the generated header the same way, and diffs all fifteen. It is the shapecheck-duckdb-value-api.shandcheck-pluginkit-abi.shalready use: a fact the tree hard-codes gets a script that re-checks it, rather than a comment asking the next person to remember.Verification
verify.sh buildMySQLDriverschemescripts/check-mariadb-headers.shshellcheck --severity=warningNo library rebuild and no republish: the binary already is the pinned version, so
Libs/and its checksums are untouched.Found while investigating #2427.
https://claude.ai/code/session_01KsqHrFwJxUW6eWozYjT8JZ