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.22.2 build failed: reloc-info.cc failed: (Exit 1): clang failed #21674

Closed
eoregua opened this issue Jun 13, 2022 · 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 Jun 13, 2022

Hi,

The build of envoy 1.22.2 is failing:

[2,985 / 6,923] Compiling src/torque/torque-parser.cc; 11s processwrapper-sandbox ... (4 actions running)
[4,394 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/frames-tq-csa.cc; 5s processwrapper-sandbox ... (4 actions running)
[4,453 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/promise-abstract-operations-tq-csa.cc; 9s processwrapper-sandbox ... (4 actions running)
[4,509 / 9,011] Compiling external/v8/noicu/torque-generated/src/builtins/base-tq-csa.cc; 17s processwrapper-sandbox ... (4 actions running)
ERROR: /root/.cache/bazel/_bazel_root/221703495c2e97a5482194eda3ea2f8b/external/v8/BUILD.bazel:3364:11: Compiling src/codegen/reloc-info.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 78 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:109:38: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
  static int input_offset() { return offsetof(Deoptimizer, input_); }
                                     ^                     ~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:111:12: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
    return offsetof(Deoptimizer, output_count_);
           ^                     ~~~~~~~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:113:39: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
  static int output_offset() { return offsetof(Deoptimizer, output_); }
                                      ^                     ~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
In file included from external/v8/src/codegen/reloc-info.cc:12:
external/v8/src/deoptimizer/deoptimizer.h:116:12: error: offset of on non-standard-layout type 'v8::internal::Deoptimizer' [-Werror,-Winvalid-offsetof]
    return offsetof(Deoptimizer, caller_frame_top_);
           ^                     ~~~~~~~~~~~~~~~~~
/usr/lib/clang/12.0.0/include/stddef.h:104:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^                     ~
4 errors generated.
Target //source/exe:envoy-static failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 538.529s, Critical Path: 49.13s
INFO: 4522 processes: 2673 internal, 1 local, 1847 processwrapper-sandbox, 1 worker.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
Removing intermediate container e0887d1ca55f
The command '/bin/sh -c git checkout ${ENVOY_VERSION} &&        sed -i 's/"-Wno-maybe-uninitialized"/"-Wno-uninitialized"/' bazel/envoy_internal.bzl &&        CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --fission=no -c opt //source/exe:envoy-static &&	strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy' returned a non-zero code: 1

DockerFile used for the build:

RUN wget -q -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.7.4/bazelisk-linux-amd64 && \
--
  | chmod 755 /usr/local/bin/bazel && \
  | zypper addrepo --no-check --no-gpgcheck --refresh http://download.opensuse.org/distribution/leap/15.3/repo/oss/ offical-sles \
  | && zypper install --auto-agree-with-licenses --no-confirm \
  | gcc9 \
  | gcc9-c++ \
  | lbzip2 \
  | && zypper clean --all \
  | && ln -s /usr/bin/gcc-9 /usr/bin/gcc \
  | && ln -s /usr/bin/g++-9 /usr/bin/g++ \
  | && ln -s /usr/bin/g++-9 /usr/bin/c++ \
  | && ln -s /usr/bin/gcc-9 /usr/bin/cc \
  | && ln -s /usr/bin/cpp-9 /usr/bin/cpp \
  | && wget -q  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
  |  
  | WORKDIR /clang+llvm-12.0.0-x86_64-linux-sles12.4
  | RUN 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
  | WORKDIR /
  | RUN git clone https://github.com/llvm/llvm-project.git
  | WORKDIR /llvm-project/
  | RUN git checkout llvmorg-12.0.0
  |  
  | WORKDIR /llvm-project/build/
  | RUN 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/
  |  
  | # Seems, libncurses needs to be installed after installing parts of llvm-project
  | #
  | 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} &&\
  | sed -i 's/"-Wno-maybe-uninitialized"/"-Wno-uninitialized"/' bazel/envoy_internal.bzl &&\
  | CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --fission=no -c opt //source/exe:envoy-static &&\
  | strip bazel-bin/source/exe/envoy-static -o bazel-bin/source/exe/envoy

Any change required for the build with envoy 1.22.2?
The build was working using the same dockerfile with envoy 1.22.0.

@eoregua eoregua added the triage Issue requires triage label Jun 13, 2022
@eoregua
Copy link
Author

eoregua commented Jun 13, 2022

I was able to build with envoy 1.22.0 for the moment as WA disabling the build of wasm:

CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --define=wasm=disabled --fission=no -c opt //source/exe:envoy-static

@alyssawilk
I see that you pushed the following fix for a similar issue:
#19514

But I'm not able to find the below script in envoy 1.22.2 source code and try a similar patch:

bazel/external/wee8.genrule_cmd

If possible, could you please help me to identify the fix?
I want to build envoy 1.22.2 without to disable the build of wasm.

Thanks a lot!

@alyssawilk
Copy link
Contributor

honestly after my 3rd local-but-not-CI wasm build failure I gave up on figuring out how my env differed from upstream and put
test --config=libc++ --define wasm=disabled
in my user.bazelrc :-(
you'll have to work with @mathetake and @PiotrSikora on what's going on.

@PiotrSikora
Copy link
Contributor

Since you're building with clang, you might want to add --config=clang or --config=libc++ to the bazel build args.

@wbpcode wbpcode added question Questions that are neither investigations, bugs, nor enhancements area/build and removed triage Issue requires triage labels Jun 14, 2022
@eoregua
Copy link
Author

eoregua commented Jun 14, 2022

Ok, adding --config=clang the build is working but requires much more disk space for the build, so pratically for the moment I'm going ahead with these build options:

CC=clang CXX=clang++ bazel build --define tcmalloc=gperftools --define wasm=disabled --fission=no -c opt //source/exe:envoy-static

@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 Jul 14, 2022
@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

4 participants