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

envoy 1.20 build fails due to unknown warning option '-Wno-maybe-uninitialized #18986

Closed
eoregua opened this issue Nov 12, 2021 · 6 comments
Closed
Labels
area/build question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently

Comments

@eoregua
Copy link

eoregua commented Nov 12, 2021

Title: envoy 1.20 build fails using clang due to unknown warning option '-Wno-maybe-uninitialized'

Description:

We are trying to build new envoy binary based envoy 1.20 source code but we are facing some issues:

error: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Werror,-Wunknown-warning-option]
Target //source/exe:envoy-static failed to build

We are compiling using CLANG. Below is a section of our Dockerfile used for the build:


WORKDIR /tmp
--
  | RUN	git clone https://"${GERRIT_USERNAME}:${GERRIT_PASSWORD}"@gerrit.ericsson.se/a/3pp/foss/github.com/envoyproxy/envoy
  | #RUN git clone https://github.com/envoyproxy/envoy.git
  | WORKDIR /tmp/envoy
  | RUN	git checkout ${ENVOY_VERSION}
  | RUN	CC=clang CXX=clang++ bazel build --fission=no -c opt //source/exe:envoy-static
  | RUN	strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy

Compiling exactly in the same way with envoy 1.18.4 source code we didn't have any issue.

Can you please suggest how to fix it?

Thanks!

@eoregua eoregua added the triage Issue requires triage label Nov 12, 2021
@lambdai
Copy link
Contributor

lambdai commented Nov 12, 2021

The clang version matters. What's your clang version?

main branch is well tested using clang-12

I think istio CI is building envoy 1.20 using llvm-11 and I don't see this error there

@eoregua
Copy link
Author

eoregua commented Nov 13, 2021

Hi,

We also tried with clang-12 and llvm-11 and we have the same issue:

ERROR: /tmp/envoy/source/extensions/clusters/redis/BUILD:20:17: Compiling source/extensions/clusters/redis/redis_cluster_lb.cc failed: (Exit 1): clang failed: error executing command /usr/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 196 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
error: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Werror,-Wunknown-warning-option]
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.

This is a section of the our Dockerfile used for the build:

RUN wget https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz \
 && tar -xf clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz \
 && cd clang+llvm-12.0.0-x86_64-linux-sles12.4 \
 && cp -rf bin/* /usr/bin/ \
 && cp -rf lib/* /usr/lib/ \
 && cp -rf share/* /usr/share/ \
 && rm /clang+llvm-12.0.0-x86_64-linux-sles12.4.tar.xz \
 && rm -rf /clang+llvm-12.0.0-x86_64-linux-sles12.4
RUN git clone https://github.com/llvm/llvm-project.git \
 && cd llvm-project \
 && git checkout llvmorg-11.0.0 \
 && mkdir build/ \
 && cd build/ \
 && cmake -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi"  -Wno-error=deprecated -G "Unix Makefiles" ../llvm \
 && make cxx \
 && make install-cxx install-cxxabi \
 && cp -rf /usr/local/lib/* /usr/lib/ \
 && cp -rf /usr/local/include/* /usr/include/

RUN zypper install --auto-agree-with-licenses --no-confirm libncurses5 \
        && zypper clean --all
WORKDIR /tmp
RUN     git clone https://"${GERRIT_USERNAME}:${GERRIT_PASSWORD}"@gerrit.ericsson.se/a/3pp/foss/github.com/envoyproxy/envoy
#RUN git clone https://github.com/envoyproxy/envoy.git
WORKDIR /tmp/envoy
RUN     git checkout ${ENVOY_VERSION}
RUN     CC=clang CXX=clang++ bazel build  --fission=no -c opt //source/exe:envoy-static
RUN     strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy


@rojkov rojkov added area/build question Questions that are neither investigations, bugs, nor enhancements and removed triage Issue requires triage labels Nov 15, 2021
@rojkov
Copy link
Member

rojkov commented Nov 15, 2021

-Wno-maybe-uninitialized is a gcc specific option added in case of bazel detecting gcc. You can try to modify your build command as bazel build --config=clang ... (no need to set CC/CXX).

@eoregua
Copy link
Author

eoregua commented Nov 15, 2021

The build was modified:

RUN	 bazel build --config=clang  --fission=no -c opt //source/exe:envoy-static

Failed with the following reason:

ERROR: /root/.cache/bazel/_bazel_root/221703495c2e97a5482194eda3ea2f8b/external/com_google_absl/absl/debugging/BUILD.bazel:31:11: Compiling absl/debugging/stacktrace.cc [for host] failed: (Exit 1): gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 55 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox

Building instead in the following way:


RUN	CC=clang CXX=clang++ bazel build --config=clang --fission=no -c opt //source/exe:envoy-static

Requires too much space on disk and it's failing:

Use --sandbox_debug to see verbose messages from the sandbox
ld.lld: error: failed to open bazel-out/k8-opt/bin/source/exe/envoy-static: No space left on device
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.

The build instead is working fine replacing -Wno-maybe-uninitialized with -Wno-uninitialized in / bazel/envoy_internal.bzl but I don't know if it's right way to overcome this building issue:


RUN     git checkout ${ENVOY_VERSION}
RUN     sed -i s/""/ bazel/envoy_internal.bzl
RUN     CC=clang CXX=clang++ bazel build --fission=no -c opt //source/exe:envoy-static
RUN     strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy

@github-actions
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 Dec 15, 2021
@github-actions
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build question Questions that are neither investigations, bugs, nor enhancements stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

No branches or pull requests

3 participants