Skip to content

ci: Pass MySQL matrix flags to the custom actions via env - #597

Merged
krlmlr merged 5 commits into
mainfrom
claude/ci-matrix-mysql
Nov 29, 2026
Merged

krlmlr merged 5 commits into
mainfrom
claude/ci-matrix-mysql

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Closes #592.

The custom before-install and after-install actions gated their steps on matrix.config.*, which composite actions cannot read, so every Linux job installed MariaDB 11.8 with libmariadb. The "MySQL server" and "MySQL client" jobs never tested MySQL.

Changes:

  • .github/versions-matrix.R now passes the flags through the generic env field of the matrix. R-CMD-check.yaml already writes that field to $GITHUB_ENV before the custom actions run. The new variables are RMARIADB_CI_MYSQL_SERVER and RMARIADB_CI_MYSQL_CLIENT; RMARIADB_FORCE_MARIADBCONFIG and RMARIADB_FORCE_MYSQLCONFIG now also travel through env.

  • The composite actions test env.RMARIADB_CI_MYSQL_* == 'true' explicitly. The old conditions were also wrong because the string "false" is truthy.

  • The "Define client restrictons" step is removed. It only echoed the empty matrix.config values.

  • On macOS, the client paths come from brew --prefix instead of hard-coded Intel paths. The MySQL-client job puts mysql-client's bin first on $GITHUB_PATH after the server setup, and fails if mysql_config resolves anywhere else.

  • The Linux MySQL-client rows set RMARIADB_FORCE_MYSQLCONFIG=1, so configure fails instead of falling back to mariadb_config.

  • A new step checks SELECT VERSION() against RMARIADB_CI_MYSQL_SERVER, so a job can no longer silently test the wrong server.

  • R-CMD-check.yaml is unchanged; it is synced from a template.

  • On macOS, the server-side setup runs with the MariaDB CLI before the MySQL client is put first on PATH. MariaDB's root logs in only via unix_socket, which the MySQL client cannot use.

  • The macOS MySQL-client job adds Homebrew's lib and openssl@3 directories to LIBRARY_PATH, because mysql_config --libs lists -lzstd -lssl -lcrypto without a -L. It also creates a throwaway mysql_native_password user, and points the [rs-dbi] group of ~/.my.cnf at it over TCP.

Merge order: #628 first. The macOS mysql_config job builds against Homebrew's mysql-client 26.10. On main the build fails against it (#626), and #628 fixes that. Until #628 is merged, that one job stays red on this branch.

CI evidence, from full-matrix runs dispatched manually, because PRs from this repository run only the smoke test:

  • Run 46259927531: the "MySQL server" job runs against MySQL 8.4.13 (SELECT VERSION() = 8.4.13-0ubuntu0.26.04.2) and passes. "MariaDB server, MySQL client" builds with the MySQL 8.4 client (Using mysql_config (forced)) and passes. Before this PR, both silently used MariaDB.
  • Run 46265462619, on the temporary branch claude/ci-mysql-26-check (this PR merged with fix: Detect MariaDB Connector/C by its macros, not by version number #628, not for merging): the macOS mysql_config job passes R CMD check against MariaDB 11.8 through mysql-client 26.10, with 8625 tests passing and 0 failing.

Review: one clean-review round found a High (the Intel-only Homebrew path) and a Medium (MariaDB's mysql_config shadowing the MySQL one). Both are fixed. The second round found nothing above Low, and its Lows are fixed. The later commits fix what the real runs uncovered.

https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS


Generated by Claude Code

Composite actions cannot read the `matrix` context,
and the matrix from versions-matrix.R has flat keys,
so `matrix.config.mysql_server` and `matrix.config.mysql_client` were always empty.
versions-matrix.R now emits the flags through its `env` field,
which R-CMD-check.yaml writes to $GITHUB_ENV before the custom actions run:
`RMARIADB_CI_MYSQL_CLIENT`, `RMARIADB_CI_MYSQL_SERVER`,
`RMARIADB_FORCE_MARIADBCONFIG` and `RMARIADB_FORCE_MYSQLCONFIG`.
The custom actions compare against the string `'true'`,
since the strings "true" and "false" are both truthy.

Closes #592.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
Use `brew --prefix` for the macOS client paths,
so that they also work on arm64 runners.
Prepend the Homebrew mysql-client to $GITHUB_PATH after the server setup
and fail if mysql_config comes from elsewhere.
Force mysql_config on the Linux MySQL-client rows.
Check that the server flavor matches the matrix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
Move the Homebrew mysql-client step after the database setup and flavor check,
so that the MariaDB CLI is used against the MariaDB server:
root there uses unix_socket auth, which the MySQL 9 client cannot use.
Also harden the step (missing mysql_config, quoted GITHUB_PATH)
and avoid grep in a pipe under pipefail in the flavor check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Matrix run status for this PR (dispatched, since PRs from this repository run only the smoke test).

  • Run 46259927531 on 1b04308: the "MySQL server" job now really runs against MySQL 8.4.13 (SELECT VERSION() = 8.4.13-0ubuntu0.26.04.2) and passes. "MariaDB server, MySQL client" builds with the MySQL 8.4 client (Using mysql_config (forced)) against MariaDB 11.8.10 and passes. All other jobs are green. The macOS mysql_config job failed at database setup, because the MySQL CLI cannot log in to MariaDB's unix_socket root. cf61a7b fixes that by reordering the steps.
  • Run 46261200760 on cf61a7b: the macOS mysql_config job now gets past the setup and builds against Homebrew's mysql-client 26.10.0. The build then fails with my_bool undeclared and MYSQL_OPT_SSL_ENFORCE unknown. This is a pre-existing bug on main, which CI never caught because it never used the MySQL client: the MYSQL_VERSION_ID < 100000 check mistakes MySQL's calendar-versioned 26.x client for MariaDB Connector/C. It is filed as Build fails against MySQL client 26.x: version check mistakes it for MariaDB Connector/C #626, with a fix in progress in a separate PR. This job stays red until that fix is merged.

Generated by Claude Code

… on macOS

`mysql_config --libs` lists -lzstd -lssl -lcrypto
without any -L for them,
so linking RMariaDB.so failed with "library 'zstd' not found".
Apple's ld honors LIBRARY_PATH,
which the compiler driver reads from the environment.
Also add the keg-only openssl@3 lib directory.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
… macOS

MariaDB's root@localhost uses unix_socket auth,
which libmysqlclient does not support.
Create a mysql_native_password user
and point the [rs-dbi] group of ~/.my.cnf at it over TCP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS
@krlmlr
krlmlr marked this pull request as ready for review November 29, 2026 13:15
@krlmlr
krlmlr merged commit 0c1345b into main Nov 29, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/ci-matrix-mysql branch November 29, 2026 13:42
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.

CI: MySQL server and MySQL client matrix entries silently test MariaDB

2 participants