You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "kevinwilfong (via GitHub)" <gi...@apache.org> on 2026/07/01 17:07:55 UTC
[PR] [VL] Fix arrow build with Clang 21 [gluten]
kevinwilfong opened a new pull request, #12421:
URL: https://github.com/apache/gluten/pull/12421
## What changes are proposed in this pull request?
Clang 21 introduced a new warning -Wcharacter-conversion https://releases.llvm.org/21.1.0/tools/clang/docs/ReleaseNotes.html#improvements-to-clang-s-diagnostics
It's triggered when implicitly converting between char8_t, char16_t, char32_t.
This is causing `./dev/builddeps-veloxbe.sh build_arrow` to fail, as it builds gtest as a dependency and it has an implicit conversion in one of its headers.
```
FAILED: [code=1] _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
/Users/kevinwilfong/incubator-gluten/ep/build-velox/build/velox_ep/deps-install/bin/ccache /Library/Developer/CommandLineTools/usr/bin/c++ -DARROW_WITH_TIMING_TESTS
-DGTEST_CREATE_SHARED_LIBRARY=1 -Dgtest_EXPORTS -I/Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include
-fPIC -Wall -Wshadow -Werror -Wconversion -DGTEST_HAS_PTHREAD=1 -fexceptions -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter
-Wcast-align -Wchar-subscripts -Winline -Wredundant-decls -MD -MT _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -MF
_deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o.d -o _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -c
/Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/src/gtest-all.cc
In file included from /Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/src/gtest-all.cc:38:
In file included from /Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include/gtest/gtest.h:64:
In file included from /Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include/gtest/gtest-death-test.h:41:
In file included from /Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include/gtest/internal/gtest-death-test-internal.h:39:
In file included from /Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include/gtest/gtest-matchers.h:44:
/Users/kevinwilfong/incubator-gluten/ep/_ep/arrow_ep/cpp/_build/_deps/googletest-src/googletest/include/gtest/gtest-printers.h:478:35: error: implicit conversion from
'char8_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion]
478 | PrintTo(ImplicitCast_<char32_t>(c), os);
| ~~~~~~~~~~~~~ ^
1 error generated.
```
This PR proposes not treating those warnings as errors when building Arrow.
## How was this patch tested?
Built Arrow successfully using Apple Clang 21.
## Was this patch authored or co-authored using generative AI tooling?
co-authored with Claude Opus 4.8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix arrow build with Clang 21 [gluten]
Posted by "zml1206 (via GitHub)" <gi...@apache.org>.
zml1206 commented on code in PR #12421:
URL: https://github.com/apache/gluten/pull/12421#discussion_r3509892491
##########
dev/build-arrow.sh:
##########
@@ -41,11 +41,18 @@ function build_arrow_cpp() {
ARROW_WITH_ZLIB=ON
# The zlib version bundled with arrow is not compatible with clang 17.
# It can be removed after upgrading the arrow version.
+ EXTRA_CMAKE_CXX_FLAGS=""
if [[ "$(uname)" == "Darwin" ]]; then
clang_major_version=$(echo | clang -dM -E - | grep __clang_major__ | awk '{print $3}')
if [ "${clang_major_version}" -ge 17 ]; then
ARROW_WITH_ZLIB=OFF
fi
+ # Apple clang 21+ promotes implicit char8_t -> char32_t conversions in
+ # Arrow's bundled googletest to errors under -Werror. Downgrade just that
+ # diagnostic. Can be removed once an Arrow upgrade ships a newer googletest.
+ if [ "${clang_major_version}" -ge 21 ]; then
+ EXTRA_CMAKE_CXX_FLAGS="-Wno-error=character-conversion"
+ fi
Review Comment:
Since -Wcharacter-conversion is introduced by Clang 21 generally, should we gate this by Clang major version instead of Darwin only? Linux builds using clang-21 may hit the same Arrow bundled googletest failure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [VL] Fix arrow build with Clang 21 [gluten]
Posted by "kevinwilfong (via GitHub)" <gi...@apache.org>.
kevinwilfong commented on PR #12421:
URL: https://github.com/apache/gluten/pull/12421#issuecomment-4859580137
The failure in Velox Backend (x86) / spark-test-spark40-slow does not appear to be related to my change, but a transient error attempting to download an epel dependency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org