Repository navigation
Fixes-34840: remove compilers from ingestion-base, keep DB2 clidriverVersion working - #34839
Conversation
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. Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
❌ PR checklist incompleteThis 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 |
Code Review ✅ Approved🟡 Medium risk · Removing compilers from ingestion-base and swapping DB2 driver archives at runtime could break downstream native-extension builds or DB2 connectivity if compatibility assumptions fail. Removes the C/C++ compiler toolchain from OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes ##34840
Removes the C/C++ toolchain from
ingestion-base(and images built on it). That clears CVE-2026-95619 / CVE-2026-102010 (libstdc++, no Debian fix yet) from every gcc package except the 4 runtime libraries that must stay. DB2clidriverVersionis reworked so it no longer needs a compiler at runtime.build-essential gccin the final root stage, after the last compilingpip install; autoremove drops the rest. Kept:libstdc++6,libgcc-s1,gcc-14-base,libgomp1(numba's OpenMP layer in downstream images),xz-utils,bzip2. The build fails if a compiler package survives or a compiled module (MySQLdb,psycopg2,kerberos,_mysql_connector,ibm_db) stops importing. The remaining gcc runtime libs are upgraded once Debian ships a fix.db2/utils.py:clidriverVersionranpip install ibm_db --no-binary :all:at connection time. It now downloads the requested clidriver (IBM, then GitHub mirror) and swaps it in under the prebuiltibm_db. No pip, no compiler.Type of change:
High-level design:
ibm_db3.3.0 extension loadslibdb2.so.1viaRUNPATH $ORIGIN/clidriver/lib. All 48 CLI functions it uses exist in clidriver 11.1.4 through 12.1.4.clidriverVersionbehaviour changes:ibm_dbstays 3.3.0 (it was downgraded to 3.2.x).ibm_dbwas left uninstalled, which broke every DB2 service in a long-lived container.shutil.move, because overlayfs refuses to rename a directory from a lower image layer (EXDEV).FROMingestion-base that compile C extensions must now installbuild-essentialthemselves.openmetadata-ingestionfrom PyPI, so both changes must ship in the same release. Backport to2.0for 2.0.5.Tests:
Use cases covered
clidriverVersion, and with 11.1.4, 11.5.9 (plus license) and 12.1.0. A plain DB2 service still works after a version switch in the same container.Unit tests
ingestion/tests/unit/source/database/db2/test_clidriver.pycovers: swap without pip, GitHub fallback, failed download, archive without a driver, rollback on a failed swap, overlayfs EXDEV, Windows zip, unsupported platform, noibm_db, and the platform-to-archive mapping. The once-per-process, retry, version-change and concurrency tests are kept.Ingestion integration tests
Manual testing performed
Dockerfile.ci: the purge and import gate ran. 4 gcc runtime libs remain, no compiler, and 305/305 connector modules import.ingestion-base:2.0.4(amd64 and arm64): 292/292 imports, andlddoutput is identical to the original image.Db2Connectionon the compiler-free amd64 image: default (v12.1.4), 11.5.9 with a license, 11.1.4 and 12.1.0 each load the requested driver (SQL30081Nagainst a closed port).ibm_dbstays 3.3.0.Not tested: a real DB2 server, and a full amd64 build.
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.