Skip to content

fix(build,ci): unblock clang packages + arm64 package verification (3.0.9)#5840

Merged
renecannao merged 2 commits into
v3.0from
fix/clang-parsersql-cxx-and-arm64-verify-file
Jun 4, 2026
Merged

fix(build,ci): unblock clang packages + arm64 package verification (3.0.9)#5840
renecannao merged 2 commits into
v3.0from
fix/clang-parsersql-cxx-and-arm64-verify-file

Conversation

@renecannao

@renecannao renecannao commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Two release-blocking bugs found while building the 3.0.9 / 3.1.9 packages (dispatched via the per-distro CI-package-* workflows). The binaries compile fine in both cases — the failures are a vendored-dep build flag and a CI verification step.

1. clang packages (16 distro variants) — exit 127 in deps build

Vendored ParserSQL's Makefile hardcoded CXX = g++, which a CC=.. CXX=.. make env prefix does not override. clang build containers ship only clang/clang++ (no g++), so src/sql_parser/*.o failed with g++: command not found (exit 127). 3.0.8 shipped clang packages, so this is a regression from the ParserSQL vendoring (#5736).

Fixed upstream in ParserSQL 1.0.9 (ProxySQL/ParserSQL#45: CXX ?= g++) and re-vendored here (tarball swap + symlink repoint). No change to deps/Makefile — the existing invocation already passes the right compiler; ?= now lets it win.

2. arm64 base packages (14 distros) — verify step aborts before upload

The Verify package installs on clean <distro> step (added in #5815) runs verify-package-install.bash, which used file (and which) — absent in slim base images (e.g. debian:bookworm-slim), so verification failed with file: command not found after a good build, blocking the upload. Replaced with a portable ELF-magic check (head -c4 | od) and command -v.

Why it matters for the release

arm64 base packages are required (served from repo.proxysql.com); clang packages shipped in 3.0.8. Both must build for 3.0.9/3.1.9.

Depends on

ProxySQL/ParserSQL#45 (vendored as 1.0.9 here; tarball is self-contained).

Summary by CodeRabbit

  • Chores

    • Updated vendored parser dependency to latest version.
  • Tests

    • Improved test portability by using alternative validation methods that work across different systems.

Two release-blocking bugs surfaced while building 3.0.9/3.1.9 packages:

1. clang builds (16 distro variants) failed at deps build with exit 127.
   Root cause: vendored ParserSQL's Makefile hardcoded `CXX = g++`, which the
   `CC=.. CXX=.. make` env prefix does not override, so clang containers
   (no g++) could not compile src/sql_parser/*.o. Fixed upstream in ParserSQL
   1.0.9 (CXX ?= g++); re-vendored the 1.0.9 tarball and repointed the symlink.
   No change needed to deps/Makefile.

2. arm64 base package builds (14 distros) failed in the new
   'Verify package installs' step: verify-package-install.bash used `file`
   (and `which`), absent in slim base images, so verification aborted after a
   good build and blocked the upload. Replaced with a portable ELF-magic check
   (head -c4 + od) and `command -v`.
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • deps/parsersql/parsersql-1.0.9.tar.gz is excluded by !**/*.gz

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f8e73b14-4b34-4bf6-b8c8-30303060e687

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR updates the vendored parsersql dependency from 1.0.8 to 1.0.9 and refactors the container test script to use portable ELF magic-byte validation instead of relying on the file command, improving test portability across different environments.

Changes

Dependency and test infrastructure updates

Layer / File(s) Summary
parsersql dependency version update
deps/parsersql/parsersql
parsersql dependency target is updated from 1.0.8 to 1.0.9.
ELF validation portability
test/infra/control/verify-package-install.bash
An is_elf helper function is added to check ELF magic bytes directly. Plugin .so validation and proxysql binary sanity checks are updated to use this helper instead of parsing file command output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

Packages, Compiling

Poem

A rabbit hops through tests so keen,
With ELF bytes checked clean and lean,
No file command shadows cast,
Portable checks run true and fast,
Dependencies bumped, all systems blessed! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: fixing build/CI issues by updating ParserSQL dependency and improving package verification for arm64 platforms.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clang-parsersql-cxx-and-arm64-verify-file

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request bumps the parsersql dependency version and replaces the use of the file and which commands in verify-package-install.bash with a custom, portable is_elf function and command -v. The review feedback suggests improving the robustness of the is_elf function by verifying that the file exists first, and safely handling command -v under set -e to prevent unexpected shell termination.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


# Portable ELF check — minimal base images (debian-slim, etc.) may not ship
# `file` or `which`, so validate the ELF magic bytes (7f 45 4c 46) directly.
is_elf() { [ "$(head -c4 "$1" 2>/dev/null | od -An -tx1 | tr -d ' \n')" = "7f454c46" ]; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If is_elf is called with an empty string or a non-existent file path, head will be executed with an empty argument or fail. It is safer and more robust to check if the file exists and is a regular file first using [ -f "${1:-}" ]. Additionally, using tr -d '[:space:]' is more standard and robust than tr -d ' \n' for stripping all whitespace.

Suggested change
is_elf() { [ "$(head -c4 "$1" 2>/dev/null | od -An -tx1 | tr -d ' \n')" = "7f454c46" ]; }
is_elf() { [ -f "${1:-}" ] && [ "$(head -c4 "$1" 2>/dev/null | od -An -tx1 | tr -d '[:space:]')" = "7f454c46" ]; }


# Binary sanity check
if file "$(which proxysql)" | grep -q 'ELF 64-bit'; then
if is_elf "$(command -v proxysql)"; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Running command -v inside a command substitution under set -e can sometimes lead to unexpected shell termination depending on the shell version if the command is not found. We can safely perform the assignment and check in the if condition itself, which prevents set -e from triggering on failure and avoids calling is_elf with an empty string.

Suggested change
if is_elf "$(command -v proxysql)"; then
if PROXYSQL_BIN="$(command -v proxysql 2>/dev/null)" && is_elf "$PROXYSQL_BIN"; then

Regenerated via git archive of the released v1.0.9 tag (ProxySQL/ParserSQL)
for provenance; tree is identical to the prior commit.
@sonarqubecloud

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

@renecannao renecannao merged commit 7ddb3dc into v3.0 Jun 4, 2026
59 checks passed
@renecannao renecannao deleted the fix/clang-parsersql-cxx-and-arm64-verify-file branch June 4, 2026 21:32
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.

1 participant