Skip to content

Fixes #34840: remove compilers from ingestion-base, keep DB2 clidriverVersion working [Backport #34839 - 2.0] - #35257

Merged
harshsoni2024 merged 2 commits into
2.0from
backport/34839-remove-compilers-2.0
Oct 13, 2026
Merged

harshsoni2024 merged 2 commits into
2.0from
backport/34839-remove-compilers-2.0

Conversation

@harshsoni2024

Copy link
Copy Markdown
Contributor

Describe your changes:

Backport of #34839 (d6265fe) to 2.0. Fixes #34840 on 2.0.

This removes the C/C++ toolchain from ingestion-base, which clears CVE-2026-95619 and CVE-2026-102010 (libstdc++) from every src:gcc-14 binary except the 4 runtime libraries that must stay. DB2 clidriverVersion now swaps in the requested driver instead of rebuilding ibm_db at connection time, so it no longer needs a compiler. For the design and the manual tests, see #34839.

Differences from the main commit

Four files conflicted. Each was resolved as follows:

  • Dockerfile, Dockerfile.ci: 2.0 has a pip install --upgrade "setuptools>=83" layer after the root stage. It lifts the setuptools<81 pin that cx_Oracle needs; main does that upgrade earlier instead. Both layers are kept, with the setuptools upgrade first and the import check second, so the check also runs after the upgrade. The setuptools upgrade installs a wheel and needs no compiler.
  • The import check also covers cx_Oracle: 2.0 still compiles cx_Oracle from source before the purge, so it belongs in the check. Importing it doesn't need the Oracle client, which is loaded when a connection is opened.
  • db2/utils.py: uses main's version. The only 2.0-specific lines were # noqa: PLC0415 markers on local imports that the rewrite removes. The marker on the sqlalchemy_ibmi import is kept.
  • basedpyright baseline: uses 2.0's file, minus the same 4 db2/utils.py entries that main removed (32 lines).

The apt layers in main and 2.0 are identical, and both pin the same ibm-db, so the purge removes the same packages that #34839 verified.

Rollout

Dockerfile installs openmetadata-ingestion~=${RI_VERSION} from PyPI. The image change and the DB2 change therefore have to ship in the same 2.0 release, as noted on #34839.

Tests

  • pytest tests/unit/source/database/db2/ on this branch: 37 passed, 5 skipped. The skipped tests are the sqlalchemy_ibmi tests in test_connection.py, because that package isn't installed locally. Every test_clidriver.py test ran.
  • ruff check and ruff format --check on the changed Python files: clean.
  • basedpyright on db2/utils.py: reports exactly what pristine 2.0 reports, with nothing new. The 4 removed baseline entries no longer fire.
  • Not run: a Docker image build of this branch.

Type of change:

  • Improvement

🤖 Generated with Claude Code

CVE-2026-95619 and CVE-2026-102010 (libstdc++) are reported on all 21
src:gcc-14 binaries in ingestion-base, and the compilers are build-only.

- Dockerfile, Dockerfile.ci: purge build-essential and gcc in the final
  root stage, after the last compiling pip install; autoremove drops the
  rest (39 packages on amd64, 38 on arm64). Keep libstdc++6, libgcc-s1,
  gcc-14-base, libgomp1, xz-utils and bzip2. Fail the build if a compiler
  survives or MySQLdb, psycopg2, kerberos, _mysql_connector or ibm_db stop
  importing. Upgrade the remaining gcc runtime libs so Debian's fix ships
  on the next build.
- DB2: clidriverVersion rebuilt ibm_db from source at connection time,
  which needs gcc. Download the requested clidriver (IBM, then its GitHub
  mirror) and swap it in under the prebuilt ibm_db instead. A failed
  download or swap keeps the bundled driver.

2.0: the import check runs after 2.0's setuptools>=83 layer and also
covers cx_Oracle, which 2.0 still compiles before the purge.

(cherry picked from commit d6265fe)
@harshsoni2024
harshsoni2024 requested a review from a team as a code owner October 12, 2026 12:09
@harshsoni2024
harshsoni2024 requested review from akashverma0786 and removed request for a team October 12, 2026 12:09
@harshsoni2024 harshsoni2024 added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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.

@gitar-bot

gitar-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Purging compilers and swapping DB2 driver archives could leave ingestion images unable to load native connectors or the requested driver.

Removes the C/C++ toolchain from the ingestion-base image and swaps in the requested DB2 clidriverVersion driver instead of rebuilding ibm_db at connection time. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

Copy link
Copy Markdown

@harshsoni2024
harshsoni2024 merged commit e321bbd into 2.0 Oct 13, 2026
58 of 59 checks passed
@harshsoni2024
harshsoni2024 deleted the backport/34839-remove-compilers-2.0 branch October 13, 2026 06:13

This branch was previously deployed

1 inactive deployment
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.

2 participants