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

DevContainer: build failing on main #31856

Closed
Pawan-Bishnoi opened this issue Jan 17, 2024 · 11 comments · Fixed by #31872
Closed

DevContainer: build failing on main #31856

Pawan-Bishnoi opened this issue Jan 17, 2024 · 11 comments · Fixed by #31872

Comments

@Pawan-Bishnoi
Copy link
Contributor

Title: Envoy build fails when using devcontainer mode on main branch

Description:

vscode@docker-desktop:/workspaces/envoy$ bazel build -c dbg //source/exe:envoy-static
Starting local Bazel server and connecting to it...
INFO: Analyzed target //source/exe:envoy-static (1035 packages loaded, 46500 targets configured).
INFO: Found 1 target...
INFO: From Action external/opencensus_proto/opencensus/proto/agent/trace/v1/trace_service.grpc.pb.h:
bazel-out/k8-dbg/bin/external/opencensus_proto/external/opencensus_proto: warning: directory does not exist.
INFO: From Action external/com_github_grpc_grpc/src/proto/grpc/reflection/v1alpha/reflection.grpc.pb.h:
bazel-out/k8-dbg/bin/external/com_github_grpc_grpc/external/com_github_grpc_grpc: warning: directory does not exist.
INFO: From Action external/com_google_googleapis/google/devtools/cloudtrace/v2/trace.grpc.pb.h:
bazel-out/k8-dbg/bin/external/com_google_googleapis/external/com_google_googleapis: warning: directory does not exist.
ERROR: /build/.cache/bazel/_bazel_vscode/2d35de14639eaad1ac7060a4dd7e3351/external/com_google_cel_cpp/eval/public/BUILD:662:11: Compiling eval/public/value_export_util.cc failed: (Exit 1): clang-14 failed: error executing command (from target @com_google_cel_cpp//eval/public:value_export_util) /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 -g ... (remaining 92 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/eval/public/value_export_util.cc:1:
In file included from external/com_google_cel_cpp/eval/public/value_export_util.h:7:
In file included from external/com_google_cel_cpp/eval/public/cel_value.h:37:
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.
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1037.427s, Critical Path: 145.00s
INFO: 2116 processes: 1088 internal, 1028 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
@Pawan-Bishnoi Pawan-Bishnoi added bug triage Issue requires triage labels Jan 17, 2024
@triplewy
Copy link

triplewy commented Jan 17, 2024

Probably has to do with the recent cel upgrades #31456 (I am also encountering the same issues)

@fabriziomello
Copy link
Contributor

Same here:

envoy on  main [$] via 🐹 v1.18.1 took 5s 
➜ bazel build //contrib/exe:envoy-static
WARNING: The following configs were expanded more than once: [clang]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
WARNING: The following configs were expanded more than once: [clang]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Analyzed target //contrib/exe:envoy-static (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /data/fabrizio/ongres/github.com/envoy/source/extensions/access_loggers/filters/cel/BUILD:11:19: Compiling source/extensions/access_loggers/filters/cel/cel.cc failed: (Exit 1): clang failed: error executing command (from target //source/extensions/access_loggers/filters/cel:cel_lib) /usr/lib/llvm-14/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer ... (remaining 245 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from source/extensions/access_loggers/filters/cel/cel.cc:1:
In file included from ./source/extensions/access_loggers/filters/cel/cel.h:12:
In file included from ./source/extensions/filters/common/expr/evaluator.h:7:
In file included from ./source/extensions/filters/common/expr/context.h:11:
In file included from external/com_google_cel_cpp/eval/public/cel_value.h:37:
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/12/../../../../include/c++/12/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/12/../../../../include/c++/12/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/12/../../../../include/c++/12/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/12/../../../../include/c++/12/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/12/../../../../include/c++/12/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.
Target //contrib/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 17.305s, Critical Path: 16.61s
INFO: 25 processes: 17 internal, 8 linux-sandbox.
FAILED: Build did NOT complete successfully

@phlax
Copy link
Member

phlax commented Jan 17, 2024

i dont use devcontainer so cant speak to that directly - but given this passes our CI im wondering what can be different

iirc you need to rebuild the container after updates - could this be the issue ?

@fabriziomello
Copy link
Contributor

@phlax just for clarification, I'm not using devcontainer... I'm building envoy on my local Linux machine... this is very strange because some weeks ago (probably before #31456) it was working (was investigating sobre Postgres filter issues)

@phlax
Copy link
Member

phlax commented Jan 17, 2024

I'm building envoy on my local Linux machine

k - i think this is a different (if related) issue

can you either use the official build container or ensure that your host has exactly the same versions of compilers and related utilities

@phlax
Copy link
Member

phlax commented Jan 17, 2024

in both cases im assuming that you have something in user.bazelrc that points to gcc as i think the default would build on llvm

@fabriziomello one thing i can spot that is different is the c++ version which i believe is tied to the gcc version

when testing a recent gcc update we were only able to build with gcc/g++11 so my guess is that this is related to the issues you are seeing

cc @kyessenov it would be good if these issues could be resolved upstream

@yanavlasov
Copy link
Contributor

I think this is related to using clang with libstdc++ headers. Can you try adding --config=libc++ to the bazel command line, please?

@ravenblackx ravenblackx added area/build and removed triage Issue requires triage labels Jan 17, 2024
fredyw added a commit to fredyw/envoy that referenced this issue Jan 17, 2024
@phlax
Copy link
Member

phlax commented Jan 17, 2024

@Pawan-Bishnoi could you test if #31872 resolves the issue with the dev container ?

@sitano
Copy link
Contributor

sitano commented Jan 18, 2024

either wait for google/cel-cpp#558 or enable -fsized-deallocation. envoy does not build for me locally without this patch.

@phlax
Copy link
Member

phlax commented Jan 18, 2024

patch pr here with your fix @sitano #31894

yanavlasov pushed a commit that referenced this issue Jan 18, 2024
@Pawan-Bishnoi
Copy link
Contributor Author

@Pawan-Bishnoi could you test if #31872 resolves the issue with the dev container ?

yes, it does.

phlax pushed a commit to phlax/envoy that referenced this issue Feb 6, 2024
phlax pushed a commit that referenced this issue Feb 6, 2024
Fixes #31856

Signed-off-by: Fredy Wijaya <[email protected]>
Signed-off-by: Ryan Northey <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants