ci(docker): install libprotobuf-dev on demand when PROXYSQLGENAI=1

CI-builds (ubuntu24,-tap-genai-gcov) was failing on PR #5651 because
the proxysql/packaging:build-ubuntu24-v4.0.0 image lacks libprotobuf-dev.
The plugin Makefile's pkg-config check at plugins/mysqlx/Makefile:47
fires correctly: protobuf 3.x is required for the vendored .pb.cc/.pb.h
that were generated with protoc 3.21.12. The v4.0.0 packaging images
were built in anticipation of this PR but never updated to include the
new dependency.

Two paths to resolve. (a) Update the image and republish
proxysql/packaging:build-ubuntu24-v4.0.0 + cousins. (b) Patch the
docker-compose entrypoint to install on demand. (a) is the cleaner
long-term fix but has a longer feedback loop (separate pipeline,
separate review). (b) unblocks CI immediately and keeps working even
if a future image rebuild forgets the package again.

This commit takes path (b) for all three image families:

- docker/images/proxysql/deb-compliant/entrypoint/entrypoint.bash
  → apt-get install -y libprotobuf-dev (Debian, Ubuntu)
- docker/images/proxysql/rhel-compliant/entrypoint/entrypoint.bash
  → dnf|yum install -y protobuf-devel (CentOS, RHEL)
- docker/images/proxysql/suse-compliant/entrypoint/entrypoint.bash
  → zypper install -y libprotobuf-c-devel || protobuf-devel (SUSE)

The install is gated on PROXYSQLGENAI=1 (otherwise the plugin path is
not exercised) AND on pkg-config --exists protobuf returning false
(image already has it → install is a no-op). Idempotent across
container restarts.

Once the v4.0.0 packaging images are republished with libprotobuf-dev
included, this on-demand install becomes a no-op pkg-config check on
every build and can be removed. Tracked in issue #5673.

Verified locally: the deb-compliant patch follows the existing entrypoint
control-flow exactly (set -eu safe, no early exit, runs before the
${MAKE} ${deps_target} call where the protobuf check would fire).
fix/test-mysqlx-plugin-load-phase-b
Rene Cannao 3 weeks ago
parent baeca0e3dc
commit 4bc7044710

@ -41,6 +41,22 @@ else
build_target="$PROXYSQL_BUILD_TYPE"
fi
# When PROXYSQLGENAI=1 is set, the build recurses into plugins/mysqlx/
# which dynamically links against the system libprotobuf (3.x). Some of
# the v4.0.0 packaging images were built before plugins/mysqlx existed
# and do not yet ship libprotobuf-dev. Install it on demand here so the
# plugin's pkg-config check at plugins/mysqlx/Makefile:47 succeeds. The
# install is idempotent — apt-get returns 0 if the package is already
# present. Skip silently for v3.x builds where PROXYSQLGENAI is unset
# and the plugin path is not exercised.
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then
if ! pkg-config --exists protobuf 2>/dev/null; then
echo "==> Installing libprotobuf-dev (required for PROXYSQLGENAI=1 mysqlx plugin build)"
apt-get update -qq
apt-get install -y --no-install-recommends libprotobuf-dev
fi
fi
# clean is expensive, do it before, outside of container
#${MAKE} cleanbuild
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then

@ -41,6 +41,25 @@ else
build_target="$PROXYSQL_BUILD_TYPE"
fi
# See deb-compliant entrypoint for the rationale: PROXYSQLGENAI=1
# triggers a build of plugins/mysqlx/ which dynamically links against
# the system libprotobuf (3.x). Some of the v4.0.0 packaging images
# were built before plugins/mysqlx existed and do not yet ship
# protobuf-devel. Install it on demand for RHEL-family images.
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then
if ! pkg-config --exists protobuf 2>/dev/null; then
echo "==> Installing protobuf-devel (required for PROXYSQLGENAI=1 mysqlx plugin build)"
if command -v dnf >/dev/null 2>&1; then
dnf install -y protobuf-devel
elif command -v yum >/dev/null 2>&1; then
yum install -y protobuf-devel
else
echo "ERROR: cannot install protobuf-devel (neither dnf nor yum present)" >&2
exit 1
fi
fi
fi
# clean is expensive, do it before, outside of container
#${MAKE} cleanbuild
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then

@ -41,6 +41,23 @@ else
build_target="$PROXYSQL_BUILD_TYPE"
fi
# See deb-compliant entrypoint for the rationale: PROXYSQLGENAI=1
# triggers a build of plugins/mysqlx/ which dynamically links against
# the system libprotobuf (3.x). Some of the v4.0.0 packaging images
# were built before plugins/mysqlx existed and do not yet ship
# protobuf-devel. Install it on demand for SUSE-family images.
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then
if ! pkg-config --exists protobuf 2>/dev/null; then
echo "==> Installing protobuf-devel (required for PROXYSQLGENAI=1 mysqlx plugin build)"
if command -v zypper >/dev/null 2>&1; then
zypper install -y libprotobuf-c-devel || zypper install -y protobuf-devel
else
echo "ERROR: cannot install protobuf-devel (zypper not present)" >&2
exit 1
fi
fi
fi
# clean is expensive, do it before, outside of container
#${MAKE} cleanbuild
if [[ "${PROXYSQLGENAI:-}" == "1" ]]; then

Loading…
Cancel
Save