Skip to content

fix(native): Use GCC14 in runtime image if cudf is enabled#26967

Merged
czentgr merged 1 commit intoprestodb:masterfrom
czentgr:cz_gcc14_cudf
Jan 15, 2026
Merged

fix(native): Use GCC14 in runtime image if cudf is enabled#26967
czentgr merged 1 commit intoprestodb:masterfrom
czentgr:cz_gcc14_cudf

Conversation

@czentgr
Copy link
Copy Markdown
Contributor

@czentgr czentgr commented Jan 14, 2026

Velox PR github.com/facebookincubator/velox/pull/15986 introduces a check on the compiler version.
The dependency image ships with gcc12, gcc14 and clang21 but only builds with gcc12.
If the GPU support is enabled (PRESTO_ENABLE_CUDF) the build will fail.

This PR adds a check if this config is used and switches to gcc14 if this is the case.

Description

Motivation and Context

Impact

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Jan 14, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Jan 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the prestissimo runtime Docker image build to automatically switch from GCC 12 to GCC 14 when GPU/cuDF support is enabled, ensuring compatibility with Velox’s new compiler version checks while preserving the existing behavior for non-GPU builds.

Flow diagram for conditional GCC14 enabling in prestissimo runtime build

flowchart TD
    A[Start Docker build stage
EXTRA_CMAKE_FLAGS, NUM_THREADS, BUILD_TYPE, BUILD_DIR, BUILD_BASE_DIR] --> B{EXTRA_CMAKE_FLAGS contains
-DPRESTO_ENABLE_CUDF=ON}
    B -- Yes --> C[Unset CC and CXX]
    C --> D[Source /opt/rh/gcc-toolset-14/enable
and activate GCC14]
    D --> E[Run make in /prestissimo/
cmake-and-build with
EXTRA_CMAKE_FLAGS,
NUM_THREADS,
BUILD_TYPE,
BUILD_DIR,
BUILD_BASE_DIR]
    B -- No --> E
    E --> F[Run ccache -sz -v]
    F --> G[End Docker build stage]
Loading

File-Level Changes

Change Details Files
Conditionally switch the compiler toolchain to GCC 14 during the prestissimo runtime image build when cuDF support is enabled.
  • Extend the main build RUN step in the runtime Dockerfile with a shell preamble that inspects EXTRA_CMAKE_FLAGS for the -DPRESTO_ENABLE_CUDF=ON flag.
  • If cuDF is enabled, unset CC and CXX environment variables to avoid forcing the old compiler selection.
  • Source /opt/rh/gcc-toolset-14/enable to activate the GCC 14 toolchain before invoking the cmake-and-build make target.
  • Leave the build behavior unchanged when cuDF is not enabled by only conditionally modifying the environment.
presto-native-execution/scripts/dockerfiles/prestissimo-runtime.dockerfile

Possibly linked issues

  • #: PR implements the issue’s request by using GCC14 in the native runtime image when cudf is enabled.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@czentgr
Copy link
Copy Markdown
Contributor Author

czentgr commented Jan 14, 2026

Test build with GCC14 was successful. https://github.com/prestodb/presto/actions/runs/21006928465/job/60391735818?pr=26967

We will bring in GCC14 to make sure there is no regression via the adapters job which is currently disabled.

@czentgr czentgr marked this pull request as ready for review January 14, 2026 21:28
@czentgr czentgr requested review from a team as code owners January 14, 2026 21:28
@prestodb-ci prestodb-ci requested review from a team, Dilli-Babu-Godari and Joe-Abraham and removed request for a team January 14, 2026 21:28
@czentgr czentgr requested a review from unidevel January 14, 2026 21:29
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new RUN step relies on Bash-specific features ([[ … ]], source), so either ensure the image uses Bash as the default shell via a SHELL directive or rewrite this snippet to be POSIX-compatible (e.g., [ and .) to avoid runtime failures on images where /bin/sh is not Bash.
  • The condition only matches the exact substring -DPRESTO_ENABLE_CUDF=ON in EXTRA_CMAKE_FLAGS; consider a more robust check (e.g., handling whitespace variations or case-insensitivity) if users may specify this CMake option in different forms.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new RUN step relies on Bash-specific features (`[[ … ]]`, `source`), so either ensure the image uses Bash as the default shell via a `SHELL` directive or rewrite this snippet to be POSIX-compatible (e.g., `[` and `.`) to avoid runtime failures on images where `/bin/sh` is not Bash.
- The condition only matches the exact substring `-DPRESTO_ENABLE_CUDF=ON` in `EXTRA_CMAKE_FLAGS`; consider a more robust check (e.g., handling whitespace variations or case-insensitivity) if users may specify this CMake option in different forms.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

majetideepak
majetideepak previously approved these changes Jan 14, 2026
@czentgr czentgr merged commit edc8724 into prestodb:master Jan 15, 2026
80 checks passed
@czentgr czentgr deleted the cz_gcc14_cudf branch January 15, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants