Skip to content

Fixes 37240: Rebuild bundled ADBC FlightSQL Go driver with newer Go modules - #37241

Merged
ulixius9 merged 3 commits into
mainfrom
ulixius9/aws-inspector-vulns-evaluate
Nov 20, 2026
Merged

ulixius9 merged 3 commits into
mainfrom
ulixius9/aws-inspector-vulns-evaluate

Conversation

@ulixius9

@ulixius9 ulixius9 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #37240

The iomete extra pulls in adbc-driver-flightsql, whose wheel bundles a Go c-shared library built with klauspost/compress v1.20.0 and golang.org/x/net v0.61.0. pip can't change modules compiled into the wheel, and 1.13.0 is the newest release. This PR rebuilds that library from ADBC's go/adbc/v1.13.0 source with klauspost/compress v1.20.3 and golang.org/x/net v0.62.0, and swaps it into all four ingestion images (ingestion/Dockerfile, ingestion/Dockerfile.ci, ingestion/operators/docker/Dockerfile, ingestion/operators/docker/Dockerfile.ci).

Type of change:

  • Improvement

High-level design:

  • ingestion/scripts/rebuild_adbc_flightsql.sh build runs in a new golang:1.26.10-bookworm stage (--platform=$BUILDPLATFORM). It cross-compiles for $TARGETARCH with crossbuild-essential-*, taking about 45s per architecture with no QEMU.
    • Build flags: copied from upstream's c/cmake_modules/GoUtils.cmake: -tags=driverlib, -buildmode=c-shared, the c/symbols.map version script and soname libadbc_driver_flightsql.so.113. The rebuilt library's Go build info differs from the wheel's only in the two upgraded modules.
    • Why bookworm: the Airflow base image is Debian 12, and building on bookworm keeps the library loadable there.
    • Guards: the build fails if the pinned ADBC source already requires the target module versions (go get would silently downgrade). It also fails if the built library doesn't embed exactly the target versions.
  • ... install runs after the final pip install in each Dockerfile, through bind mounts (no extra layer).
    • Version match: it replaces the wheel's library only when the installed wrapper is 1.13.0. Any other version is left untouched with a warning, so a future ADBC release can't break release builds.
    • Load check: it then loads the new library in a fresh process and runs a query against a closed port. The build fails unless the error comes from the Go FlightSQL driver itself.
  • Alternatives:
    • dropping iomete from slim — removes a connector;
    • waiting for the next ADBC release — upstream main still pins the old versions.
  • Removal: delete the script and the Dockerfile stages once an ADBC release embeds the newer versions. The build's guard fails once the pinned source catches up.

Tests:

Use cases covered

  • Image build for linux/amd64 and linux/arm64 compiles the driver and swaps it in. The library loads and connects through adbc_driver_flightsql.dbapi.
  • A corrupt replacement library fails the image build.
  • A different installed ADBC version (1.12.0) keeps the wheel's library, warns, and the build passes.
  • An image without adbc-driver-flightsql is a no-op.
  • The build fails when a targeted module version is not newer than what the ADBC source already requires.

Unit tests

  • Not applicable — Docker build script only; the script checks itself at build time (embedded module versions, then load + driver round trip).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion source changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. docker buildx build --platform linux/amd64,linux/arm64 of a harness: the real build stage on python:3.12-slim-bookworm, plus pip install adbc-driver-flightsql==1.13.0 pyarrow, plus the install step.
    • Both architectures logged embeds github.com/klauspost/compress v1.20.3, embeds golang.org/x/net v0.62.0, replaced … and rebuilt FlightSQL driver loads and runs.
  2. Full build of ingestion/operators/docker/Dockerfile.ci with INGESTION_DEPENDENCY=slim (linux/arm64): passed.
    • In the image, the library embeds the new versions and no .orig backup is left.
    • metadata.ingestion.source.database.iomete.connection imports.
  3. Negative paths in the built image:
    • A corrupt .so fails the step (exit 1, dlopen() failed: file too short).
    • ADBC 1.12.0 installed: warning, exit 0.
    • Package uninstalled: no-op, exit 0.
    • Targeting klauspost/[email protected]: the build stage fails with ADBC 1.13.0 already requires … delete this workaround.
  4. Not run locally: full builds of ingestion/Dockerfile and ingestion/Dockerfile.ci (Airflow base) and an amd64 build of the full operator image. They use the identical stage and step. py-operator-build-test covers the amd64 operator build on this PR.

UI screen recording:

Not applicable — Docker build change with no UI impact.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. — N/A
  • For a UI feature or feature task: … — N/A
  • I have added tests (unit / integration / Playwright as applicable) and listed them above. — build-time self-checks; manual runs listed above
  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.
    • Reviewed d214849: no 🔴. The one 🟡 was that the build didn't assert the module versions it changes. Fixed in cda2937 by checking the versions before and after the build.
  • Decision check: N/A — same pattern as the existing strip_* image scripts; the removal condition is enforced by the build itself.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

Rebuilds the bundled FlightSQL library with newer Go modules and installs it in all four ingestion images.

  • Ingestion images now use rebuilt FlightSQL libraries with newer Go modules.

Reviews (3) · Last reviewed commit: "Build the FlightSQL driver with Go 1.26...." · Reviewed by Greptile

…estion images

adbc-driver-flightsql 1.13.0 (newest on PyPI, pulled in by the iomete extra)
bundles a Go c-shared library built with klauspost/compress v1.20.0 and
golang.org/x/net v0.61.0. Upstream main still pins the same versions and pip
cannot change modules compiled into the wheel.

Add a bookworm golang build stage to all four ingestion Dockerfiles that
compiles the driver from the go/adbc/v1.13.0 tag with upstream's flags and
klauspost/compress v1.20.3 / golang.org/x/net v0.62.0, and swap it in after
the final pip install. The build asserts the embedded module versions and
fails once the pinned ADBC source already requires them; the swap applies
only to wrapper 1.13.0 and fails the build unless the new library loads and
runs.
@ulixius9
ulixius9 requested a review from a team as a code owner November 6, 2026 07:19
@ulixius9
ulixius9 requested review from Khairajani and a balanced review from Copilot November 6, 2026 07:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Nov 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@mohittilala mohittilala added skip-pr-checks Bypass PR metadata validation check and removed skip-pr-checks Bypass PR metadata validation check labels Nov 12, 2026
@ulixius9
ulixius9 marked this pull request as draft November 17, 2026 14:24
@ulixius9
ulixius9 marked this pull request as ready for review November 20, 2026 10:59
Copilot AI balanced review requested due to automatic review settings November 20, 2026 11:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Match the 2.0 backport, which already builds with golang:1.26.11-bookworm.
Copilot AI balanced review requested due to automatic review settings November 20, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Upgrading embedded Go modules and replacing the FlightSQL library in four ingestion images could introduce incompatibilities that disrupt FlightSQL ingestion.

Rebuilds the bundled ADBC FlightSQL Go driver with klauspost/compress v1.20.3 and golang.org/x/net v0.62.0 and swaps it into all four ingestion images, addressing the outdated vulnerable modules in the wheel. No open issues found.

✅ 1 closed
Closed: Bug: Native builds fail: crossbuild-essential-<arch> isn't installable on same-arch host

📄 ingestion/scripts/rebuild_adbc_flightsql.sh:40-47 📄 ingestion/Dockerfile:7-10 🔗 link 🔗 link
The stage runs on $BUILDPLATFORM, and build() always runs apt-get install crossbuild-essential-${TARGETARCH}. That package depends on gcc-x86-64-linux-gnu (or gcc-aarch64-linux-gnu). On bookworm, gcc-x86-64-linux-gnu is published only for arm64, i386 and ppc64el, and gcc-aarch64-linux-gnu only for amd64, i386 and ppc64el. So when the host and target architectures match, apt has no installable package and the install fails. That is the usual case: a linux/amd64 image built on an amd64 runner, or arm64 on an arm64 runner or Apple Silicon. Under set -e the adbc-flightsql stage then fails, and all four ingestion images fail to build. Only true cross builds (amd64→arm64, arm64→amd64) work. Fix: install the cross toolchain only when the host architecture differs from the target. On a native build, use the gcc and libc headers that the golang:bookworm image already ships.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@ulixius9
ulixius9 enabled auto-merge (squash) November 20, 2026 13:14
@ulixius9
ulixius9 merged commit 401b36c into main Nov 20, 2026
53 of 55 checks passed
@ulixius9
ulixius9 deleted the ulixius9/aws-inspector-vulns-evaluate branch November 20, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ingestion images ship the ADBC FlightSQL Go driver built with outdated Go modules

4 participants