Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CEL causes build failure with --config=clang #31943

Closed
zhxie opened this issue Jan 23, 2024 · 4 comments
Closed

CEL causes build failure with --config=clang #31943

zhxie opened this issue Jan 23, 2024 · 4 comments
Labels
area/build area/cel bug stale stalebot believes this issue/PR has not been touched recently

Comments

@zhxie
Copy link
Contributor

zhxie commented Jan 23, 2024

Title: CEL causes build failure with --config=clang

Description:

The issue is similar to the previous GCC one, bd1dca3 (#31456) causes CEL-related components and extensions fail to build with --config=clang. It also affects non-contrib Envoy build.

ERROR: /build/bazel_root/base/external/com_google_cel_cpp/runtime/internal/BUILD:104:11: Compiling runtime/internal/errors.cc failed: (Exit 1): clang-14 failed: error executing command (from target @com_google_cel_cpp//runtime/internal:errors) /opt/llvm/bin/clang-14 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' ... (remaining 32 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from external/com_google_cel_cpp/runtime/internal/errors.cc:14:
In file included from external/com_google_cel_cpp/runtime/internal/errors.h:22:
In file included from external/com_google_cel_cpp/base/values/map_value.h:34:
external/com_google_cel_cpp/base/memory.h:92:7: error: no matching function for call to 'operator delete'
      ::operator delete(static_cast<void*>(p), n * sizeof(T),
      ^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/new:155:6: note: candidate function not viable: no known conversion from 'unsigned long' to 'std::align_val_t' for 2nd argument
void operator delete(void*, std::align_val_t, const std::nothrow_t&)
     ^
/usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/new:153:6: note: candidate function not viable: requires 2 arguments, but 3 were provided
void operator delete(void*, std::align_val_t)
     ^
/usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/new:144:6: note: candidate function not viable: requires 2 arguments, but 3 were provided
void operator delete(void*, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
     ^
/usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/new:180:13: note: candidate function not viable: requires 2 arguments, but 3 were provided
inline void operator delete  (void*, void*) _GLIBCXX_USE_NOEXCEPT { }
            ^
/usr/lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/new:130:6: note: candidate function not viable: requires 1 argument, but 3 were provided
void operator delete(void*) _GLIBCXX_USE_NOEXCEPT
     ^
1 error generated.

The CI gives a green light since it only checks build against --config=libc++. Maybe we have to check --config=clang and --config=gcc build in the CI.

Repro steps:

Apply the following patch,

diff --git a/ci/do_ci.sh b/ci/do_ci.sh
index 1c04c42502..fb5b7dafa5 100755
--- a/ci/do_ci.sh
+++ b/ci/do_ci.sh
@@ -544,10 +544,10 @@ case $CI_TARGET in
         # This doesn't go into CI but is available for developer convenience.
         echo "bazel fastbuild build with tests..."
         echo "Building..."
-        bazel_envoy_binary_build fastbuild
-        echo "Testing ${TEST_TARGETS[*]}"
-        bazel test "${BAZEL_BUILD_OPTIONS[@]}" \
-              -c fastbuild "${TEST_TARGETS[@]}"
+        # We will pass the clang with libc++ build.
+        bazel build --config=libc++ -c fastbuild //source/extensions/filters/common/expr:evaluator_lib
+        # But we will fail in the following clang with libstdc++ build.
+        bazel build --config=clang -c fastbuild //source/extensions/filters/common/expr:evaluator_lib
         ;;
 
     dev.contrib)

and

./ci/run_envoy_docker.sh './ci/do_ci.sh dev'

Relevant Links:
#31760, #31856

CC @kyessenov @phlax

@zhxie zhxie added bug triage Issue requires triage labels Jan 23, 2024
@zhxie
Copy link
Contributor Author

zhxie commented Jan 23, 2024

Actually I think #31894 will solve the issue but the PR has been dropped.

@phlax
Copy link
Member

phlax commented Jan 23, 2024

cc @ravenblackx

@phlax phlax added area/build area/cel and removed triage Issue requires triage labels Jan 23, 2024
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Feb 22, 2024
Copy link

This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted" or "no stalebot". Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build area/cel bug stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

2 participants