Skip to content

build: support compiling with clang 19#458

Open
ZacBlanco wants to merge 6 commits intobytedance:mainfrom
ZacBlanco:clang-19-support
Open

build: support compiling with clang 19#458
ZacBlanco wants to merge 6 commits intobytedance:mainfrom
ZacBlanco:clang-19-support

Conversation

@ZacBlanco
Copy link
Copy Markdown
Collaborator

@ZacBlanco ZacBlanco commented Mar 31, 2026

What problem does this PR solve?

Brings our project's compatibility with later compilers up to more modern standards. Clang 19 was released in Septemer of 2024.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🚀 Performance improvement (optimization)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🔨 Refactoring (no logic changes)
  • 🔧 Build/CI or Infrastructure changes
  • 📝 Documentation only

Description

Updates project to bring compatibility with clang 19. This is important for a number of reasons

  1. Clang is much less resource-intensive than GCC, specifically 50% less memory usage compiling many of the units in this project. Allows more developers access to the project.
  2. Clang generally has better compile times than GCC
  3. More modern compilers mean we can slowly bump the cpp standard used, meaning access to new C++ language features from C++20 and beyond.

Specific changes are outlined here:

  1. duckdb fails to compile on clang 19 until the 1.1.X line. The duckdb dependency and related plan parsing code has been updated to support the duckdb API changes.
  2. Some template code was erroring on clang 19. The code has been fixed to prevent the errors.
  3. Added a new clang-based dev container + dockerfile to support developers in setting up an environment to build with clang
  4. Adds a necessary rt-lib=compiler-rt compilation argument when building on aarch64 with clang
  5. Upgrades libunwind to 1.8.3 across all build configurations to allow building on aarch64
  6. Forces arrow recipe to use rapidjson/cci.20250205 which fixes an issue with incorrectly-resolved rapidjson dependency compared to the previous version specified.
  7. Changes clang-tidy to only compile .c** files that are in the compilation DB to prevent header include errors. The line filters for headers are should still be propagated to users as long as the headers are used in a modified compilation unit.

Performance Impact

  • No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
  • Positive Impact: I have run benchmarks.
  • Negative Impact: Explained below (e.g., trade-off for correctness).

Release Note

Please describe the changes in this PR

Release Note:

Release Note:
- Add support for building with clang 19
- Upgrade DuckDB to 1.1.3
- Upgrade rapidjson to cci.20250205
- Upgrade libunwind to 1.8.3

Checklist (For Author)

  • I have added/updated unit tests (ctest).
  • I have verified the code with local build (Release/Debug).
  • I have run clang-format / linters.
  • (Optional) I have run Sanitizers (ASAN/TSAN) locally for complex C++ changes.
  • No need to test or manual test.

Breaking Changes

  • No
  • Yes (Description: ...)

@ZacBlanco ZacBlanco marked this pull request as ready for review March 31, 2026 21:55
@ZacBlanco ZacBlanco requested a review from kexianda March 31, 2026 21:55
Copy link
Copy Markdown
Collaborator

@NicolasDenoyelle NicolasDenoyelle left a comment

Choose a reason for hiding this comment

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

Hi Zack, I have a couple minor comments.

That looks great overall and a welcome improvement.

I am not well versed in the tests you changed so I would probably put another pair of eyes on it if we have someone who knows that code. I didn't see anything shocking there.

Comment thread bolt/duckdb/conversion/DuckParser.cpp Outdated
Comment thread bolt/duckdb/conversion/DuckParser.cpp Outdated
Comment thread conanfile.py Outdated
Copy link
Copy Markdown
Collaborator

@NicolasDenoyelle NicolasDenoyelle left a comment

Choose a reason for hiding this comment

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

LGTM on the latest changes.

@ZacBlanco ZacBlanco added this pull request to the merge queue Apr 15, 2026
@ZacBlanco ZacBlanco removed this pull request from the merge queue due to a manual request Apr 15, 2026
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.

2 participants