Skip to content

Commit 6930134

Browse files
authored
Merge pull request #5892 from sysown/issue-569-generic-tarball
fix(tarball): v4.0 build — protobuf-devel (CRB) + plugin-link ordering (follow-up to #5881)
2 parents 2365a46 + 3a8cdd7 commit 6930134

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/CI-package-amd64-tarball.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
- uses: LouisBrunner/checks-action@v2.0.0
9898
id: checks
9999
if: always()
100+
continue-on-error: true
100101
with:
101102
token: ${{ secrets.GITHUB_TOKEN }}
102103
name: '${{ github.workflow }} / ${{ github.job }} ${{ env.MATRIX }}'
@@ -148,6 +149,7 @@ jobs:
148149
149150
- uses: LouisBrunner/checks-action@v2.0.0
150151
if: always()
152+
continue-on-error: true
151153
with:
152154
token: ${{ secrets.GITHUB_TOKEN }}
153155
check_id: ${{ steps.checks.outputs.check_id }}

.github/workflows/CI-package-arm64-tarball.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
- uses: LouisBrunner/checks-action@v2.0.0
9898
id: checks
9999
if: always()
100+
continue-on-error: true
100101
with:
101102
token: ${{ secrets.GITHUB_TOKEN }}
102103
name: '${{ github.workflow }} / ${{ github.job }} ${{ env.MATRIX }}'
@@ -148,6 +149,7 @@ jobs:
148149
149150
- uses: LouisBrunner/checks-action@v2.0.0
150151
if: always()
152+
continue-on-error: true
151153
with:
152154
token: ${{ secrets.GITHUB_TOKEN }}
153155
check_id: ${{ steps.checks.outputs.check_id }}

docker/images/proxysql/tarball-compliant/entrypoint/entrypoint.bash

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,26 @@ EXTRA=""
3232
# The v4.0 chassis tier builds plugins/mysqlx/ which dynamically links the
3333
# system libprotobuf (3.x). Some v4.0.0 packaging images predate the plugin
3434
# and do not ship protobuf-devel; install it on demand for RHEL-family.
35+
# protobuf-devel lives in the CRB repo on AlmaLinux/RHEL 9 (PowerTools on
36+
# EL8), which is disabled by default, so try enabling those before a plain
37+
# install.
3538
if [[ "${PROXYSQL40:-}" == "1" ]] && ! pkg-config --exists protobuf 2>/dev/null; then
3639
echo "==> Installing protobuf-devel (required for PROXYSQL40=1 mysqlx plugin build)"
3740
if command -v dnf >/dev/null 2>&1; then
38-
dnf install -y protobuf-devel
41+
dnf install -y --enablerepo=crb protobuf-devel \
42+
|| dnf install -y --enablerepo=powertools protobuf-devel \
43+
|| dnf install -y protobuf-devel
3944
elif command -v yum >/dev/null 2>&1; then
40-
yum install -y protobuf-devel
45+
yum install -y --enablerepo=powertools protobuf-devel \
46+
|| yum install -y protobuf-devel
4147
else
4248
echo "ERROR: cannot install protobuf-devel (neither dnf nor yum present)" >&2
4349
exit 1
4450
fi
51+
if ! pkg-config --exists protobuf 2>/dev/null; then
52+
echo "ERROR: protobuf-devel install did not provide a usable protobuf pkg-config" >&2
53+
exit 1
54+
fi
4555
fi
4656

4757
deps_target="build_deps_clickhouse"

plugins/mysqlx/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ CXXFLAGS += -fstack-protector-strong
9292

9393
.DEFAULT_GOAL := all
9494

95+
# Serialize this plugin's build. The vendored protobuf target (deps/Makefile)
96+
# is a recursive sub-make whose recipe first `rm -rf`s deps/protobuf and then
97+
# runs a slow cmake build+install. The plugin's .o, .pb.o and the final .so
98+
# all list $(PROTOBUF_LIB) as a prereq, but under the parent build's -j that
99+
# destructive rebuild has been observed to race the link -- the .so link
100+
# fires while protobuf is only partway rebuilt and libprotobuf.a is absent:
101+
# /usr/bin/ld: cannot find .../protobuf-3.21.12/install/lib/libprotobuf.a
102+
# .NOTPARALLEL forces protobuf to finish before any plugin object or link.
103+
# The plugin build is small, so the lost parallelism is negligible.
104+
.NOTPARALLEL:
105+
95106
SRCS := $(PLUGIN_DIR)/src/mysqlx_plugin.cpp \
96107
$(PLUGIN_DIR)/src/mysqlx_admin_schema.cpp \
97108
$(PLUGIN_DIR)/src/mysqlx_config_store.cpp \
@@ -111,6 +122,7 @@ $(ODIR):
111122

112123
$(PROTOBUF_LIB):
113124
$(MAKE) -C $(PROXYSQL_PATH)/deps PROXYSQL40=1 protobuf
125+
@test -f $@ || { echo "ERROR: deps protobuf build did not produce $@" >&2; exit 1; }
114126

115127
# Several plugin sources transitively include <google/protobuf/...> via
116128
# the .pb.h files under plugins/mysqlx/proto/ (e.g. mysqlx_protocol.cpp,

0 commit comments

Comments
 (0)