bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.19k stars 4.06k forks source link

Build error from scratch @bazel_tools//third_party/ijar:zipper #18822

Open seaurching opened 1 year ago

seaurching commented 1 year ago

Description of the bug:

root@ed7d09768525:~/dist# export BAZEL_LINKLIBS="-l%:libstdc++.a" && env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" BAZEL_JAVAC_OPTS="-J-Xms512m -J-Xmx65g" bash ./compile.sh
πŸƒ  Building Bazel from scratch......
πŸƒ  Building Bazel with Bazel.
DEBUG: /tmp/bazel_iT8dnKOf/out/external/build_bazel_rules_nodejs/index.bzl:122:10: WARNING: check_rules_nodejs_version has been removed. This is a no-op, please remove the call.
INFO: Analyzed target //src:bazel_nojdk (383 packages loaded, 10340 targets configured).
INFO: Found 1 target...
 checking cached actions
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.devtools.build.lib.unsafe.StringUnsafe (file:/tmp/bazel_iT8dnKOf/archive/libblaze.jar) to constructor java.lang.String(byte[],byte)
WARNING: Please consider reporting this to the maintainers of com.google.devtools.build.lib.unsafe.StringUnsafe
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
INFO: From Compiling src/google/protobuf/message_lite.cc [for tool]:
In file included from /usr/include/string.h:535,
                 from external/com_google_protobuf/src/google/protobuf/stubs/port.h:39,
                 from external/com_google_protobuf/src/google/protobuf/stubs/common.h:48,
                 from external/com_google_protobuf/src/google/protobuf/message_lite.h:45,
                 from external/com_google_protobuf/src/google/protobuf/message_lite.cc:36:
In function 'void* memcpy(void*, const void*, size_t)',
    inlined from 'uint8_t* google::protobuf::io::EpsCopyOutputStream::WriteRaw(const void*, int, uint8_t*)' at external/com_google_protobuf/src/google/protobuf/io/coded_stream.h:706:16,
    inlined from 'virtual uint8_t* google::protobuf::internal::ImplicitWeakMessage::_InternalSerialize(uint8_t*, google::protobuf::io::EpsCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/implicit_weak_message.h:84:28,
    inlined from 'bool google::protobuf::MessageLite::SerializePartialToZeroCopyStream(google::protobuf::io::ZeroCopyOutputStream*) const' at external/com_google_protobuf/src/google/protobuf/message_lite.cc:412:30:
/usr/include/mips64el-linux-gnuabi64/bits/string_fortified.h:29:33: warning: 'void* __builtin___memcpy_chk(void*, const void*, long unsigned int, long unsigned int)' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   29 |   return __builtin___memcpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   30 |                                  __glibc_objsize0 (__dest));
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: /tmp/bazel_iT8dnKOf/out/external/bazel_tools/third_party/ijar/BUILD:72:10: Linking external/bazel_tools/third_party/ijar/zipper [for tool] failed: (Exit 1): gcc failed: error executing command (from target @bazel_tools//third_party/ijar:zipper) 
  (cd /tmp/bazel_iT8dnKOf/out/execroot/io_bazel && \
  exec env - \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
    PWD=/proc/self/cwd \
  /usr/bin/gcc @bazel-out/mips64-opt-exec-EDC14992/bin/external/bazel_tools/third_party/ijar/zipper-2.params)
# Configuration: 40272a6ece154fb00ee7235b617530863841496c2bdeda0e6675b53f4fd6b9b6
# Execution platform: //:default_host_platform
collect2: fatal error: ld terminated with signal 10 [Bus error], core dumped
compilation terminated.
[424 / 2,963] checking cached actions
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 910.049s, Critical Path: 210.93s
INFO: 424 processes: 139 internal, 285 local.
FAILED: Build did NOT complete successfully

ERROR: Could not build Bazel

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

ERROR: /tmp/bazel_iT8dnKOf/out/external/bazel_tools/third_party/ijar/BUILD:72:10: Linking external/bazel_tools/third_party/ijar/zipper [for tool] failed: (Exit 1): gcc failed: error executing command (from target @bazel_tools//third_party/ijar:zipper) (cd /tmp/bazel_iT8dnKOf/out/execroot/io_bazel && \ exec env - \ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \ PWD=/proc/self/cwd \ /usr/bin/gcc @bazel-out/mips64-opt-exec-EDC14992/bin/external/bazel_tools/third_party/ijar/zipper-2.params)

Configuration: 40272a6ece154fb00ee7235b617530863841496c2bdeda0e6675b53f4fd6b9b6

Execution platform: //:default_host_platform

collect2: fatal error: ld terminated with signal 10 [Bus error], core dumped compilation terminated.

Which operating system are you running Bazel on?

Linux ed7d09768525 3.10.0-1160.83.1.el7.x86_64 #1 SMP Wed Jan 25 16:41:43 UTC 2023 mips64 GNU/Linux

What is the output of bazel info release?

6.2.1-dist

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

https://github.com/sub-mod/bazel-builds/issues/5 https://github.com/sub-mod/bazel-builds/issues/1

Any other information, logs, or outputs that you want to share?

No response

hvadehra commented 1 year ago

Considering the failure is in the linker, probably arch related.

@seaurching is there an easy way for me to try and repro this on a mips64 system?

github-actions[bot] commented 1 week ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.