Hi,

This seems to be a small regression from
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1140296 /
https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/172.

Thanks for the patch that fixes it!


On Thu, 3 Sept 2026 at 16:43, manul <[email protected]> wrote:
>
> Package: libmariadb-dev
> Version: 1:11.8.9+ds-1
> Severity: important
> Tags: patch
>
> Dear Maintainer,
>
> Since 1:11.8.9+ds-1, /usr/bin/mariadb_config no longer implements the
> --cc_version option:
>
>   $ mariadb_config --cc_version
>   /usr/bin/mariadb_config: unrecognized option '--cc_version'
>
> The predecessor, 1:11.8.8-1, shipped upstream MariaDB Connector/C's compiled
> mariadb_config, which does implement it (extracted from the cached .deb):
>
>   $ ./usr/bin/mariadb_config --help
>   Copyright 2011-2020 MariaDB Corporation AB
>   Get compiler flags for using the MariaDB Connector/C.
>   [...]
>     --version       [11.8.8]
>     --cc_version    [3.4.9]
>
> In 1:11.8.9+ds-1 that binary was replaced by an architecture-independent shell
> script, as part of making libmariadb-dev Multi-Arch: same co-installable
> (#1140296). The replacement implements ten of upstream's options but not
> --cc_version, which looks like an oversight rather than an intended removal.
> /usr/bin/mariadb-config is a symlink to the same script, so there is no
> unaffected alternative on the system.
>
> Impact: MariaDB Connector/Python (the "mariadb" distribution on PyPI, 
> MariaDB's
> officially supported Python driver, not packaged in Debian) calls exactly this
> option during its build to verify Connector/C >= 3.3.1. It now dies on the
> empty answer:
>
>   File ".../mariadb_posix.py", line 63, in get_config
>     if version.Version(cc_version[0]) < version.Version(required_version):
>   IndexError: list index out of range
>
> So `pip install mariadb` fails on a sid system with libmariadb-dev installed,
> where it succeeded under 1:11.8.8-1. Any other consumer that asks for the
> Connector/C version through this documented interface is affected the same 
> way.
>
> Nothing is actually missing from the package. The value the option should
> report is already in the shipped headers, and it is the very macro upstream's
> binary compiles its own answer from:
>
>   $ grep MARIADB_PACKAGE_VERSION /usr/include/mariadb/mariadb_version.h
>   #define MARIADB_PACKAGE_VERSION "3.4.10"
>   #define MARIADB_PACKAGE_VERSION_ID 30410
>
> The script already reads that same header for --version, so restoring the
> option is a two-line change:
>
> --- a/usr/bin/mariadb_config
> +++ b/usr/bin/mariadb_config
> @@
>  version=$(sed -n 's/.*MARIADB_CLIENT_VERSION_STR[^"]*"\([^"]*\)".*/\1/p' 
> "$vhdr" 2>/dev/null)
>  [ -n "$version" ] || version=unknown
> +cc_version=$(sed -n 's/.*MARIADB_PACKAGE_VERSION[^"]*"\([^"]*\)".*/\1/p' 
> "$vhdr" 2>/dev/null)
> +[ -n "$cc_version" ] || cc_version=unknown
> @@ usage()
> -  --version       --variable=VAR (pkglibdir|plugindir)
> +  --version       --cc_version   --variable=VAR (pkglibdir|plugindir)
> @@ case "$arg" in
>      --version)            printf '%s\n' "$version" ;;
> +    --cc_version)         printf '%s\n' "$cc_version" ;;
>
> I verified locally that supplying --cc_version from that macro, and delegating
> every other option to /usr/bin/mariadb_config unchanged, lets mariadb 1.1.14
> build and import against the installed Connector/C 3.4.10.
>
> Thanks for maintaining this package.
>
> manul

Reply via email to