prysmaticlabs / prysm

Go implementation of Ethereum proof of stake

Home Page:https://www.offchainlabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to build beacon-chain on MacOS: "Consider building on linux for a hermetic build"

mewoa opened this issue Β· comments

πŸ’Ž Issue

Failed to build beacon-chain on Intel Mac

Background

protoc --version : 3.14.0
All dependencies installed, and failed to run bazel build //cmd/beacon-chain with many errors

Description

Some of the errors:

DEBUG: ethereum/consensus/prysm/tools/cross-toolchain/darwin_cc_hack.bzl:47:14: Configuring local C++ toolchain for Darwin. This is non-hermetic and builds may not be reproducible. Consider building on linux for a hermetic build.

ERROR: /private/var/tmp/xxx/187fa42438d89d1aa5dfcbb86837c850/external/protobuf~3.19.6/BUILD:155:11: Compiling src/google/protobuf/any_lite.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@protobuf~3.19.6//:protobuf_lite) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 37 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/protobuf~3.19.6/src/google/protobuf/any_lite.cc:56:19: error: out-of-line definition of 'InternalPackFrom' does not match any declaration in 'google::protobuf::internal::AnyMetadata'
bool AnyMetadata::InternalPackFrom(Arena* arena, const MessageLite& message,

ERROR: /private/var/tmp/xxx/187fa42438d89d1aa5dfcbb86837c850/external/protobuf~3.19.6/BUILD:155:11: Compiling src/google/protobuf/arena.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@protobuf~3.19.6//:protobuf_lite) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 37 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/protobuf~3.19.6/src/google/protobuf/arena.cc:53:21: error: no type named 'Memory' in 'google::protobuf::internal::SerialArena'
static SerialArena::Memory AllocateMemory(const AllocationPolicy* policy_ptr,
       ~~~~~~~~~~~~~^
external/protobuf~3.19.6/src/google/protobuf/arena.cc:53:49: error: unknown type name 'AllocationPolicy'
static SerialArena::Memory AllocateMemory(const AllocationPolicy* policy_ptr,
                                                ^
external/protobuf~3.19.6/src/google/protobuf/arena.cc:55:3: error: unknown type name 'AllocationPolicy'
  AllocationPolicy policy;  // default policy
  ^
external/protobuf~3.19.6/src/google/protobuf/arena.cc:76:10: error: excess elements in scalar initializer
  return {mem, size};

try adding -//tools/... at the end, i think it's erroring on the build tool
I.e. bazel build -- //... -//tools/...

bazel build -- //... -//tools/... still not working.

Starting local Bazel server and connecting to it...
INFO: From BazelWorkspaceStatusAction stable-status.txt:
date: illegal option -- -
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
date: illegal option -- -
usage: date [-jnRu] [-I[date|hours|minutes|seconds]] [-f input_fmt]
            [-r filename|seconds] [-v[+|-]val[y|m|w|d|H|M|S]]
            [[[[mm]dd]HH]MM[[cc]yy][.SS] | new_date] [+output_fmt]
ERROR: /private/var/tmp/_bazel_/187fa42438d89d1aa5dfcbb86837c850/external/protobuf~/BUILD.bazel:27:11: Compiling src/google/protobuf/io/coded_stream.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@protobuf~//:protobuf_lite) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 36 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/protobuf~/src/google/protobuf/io/coded_stream.cc:943:29: error: out-of-line definition of 'WriteVarint32ToArrayOutOfLineHelper' does not match any declaration in 'google::protobuf::io::CodedOutputStream'
uint8_t* CodedOutputStream::WriteVarint32ToArrayOutOfLineHelper(uint32_t value,
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ERROR: /private/var/tmp/_bazel_zhao/187fa42438d89d1aa5dfcbb86837c850/external/protobuf~/BUILD.bazel:27:11: Compiling src/google/protobuf/any_lite.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@protobuf~//:protobuf_lite) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 36 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/protobuf~/src/google/protobuf/any_lite.cc:55:19: error: out-of-line definition of 'InternalPackFrom' does not match any declaration in 'google::protobuf::internal::AnyMetadata'
bool AnyMetadata::InternalPackFrom(Arena* arena, const MessageLite& message,
                  ^~~~~~~~~~~~~~~~
external/protobuf~/src/google/protobuf/any_lite.cc:58:14: error: no matching member function for call to 'Set'
  type_url_->Set(GetTypeUrl(type_name, type_url_prefix), arena);
  ~~~~~~~~~~~^~~
/usr/local/include/google/protobuf/arenastring.h:184:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(const std::string* default_value, ConstStringParam value,
       ^
/usr/local/include/google/protobuf/arenastring.h:186:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(const std::string* default_value, std::string&& value,
       ^
/usr/local/include/google/protobuf/arenastring.h:188:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(EmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena);
       ^
/usr/local/include/google/protobuf/arenastring.h:189:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(EmptyDefault, std::string&& value, ::google::protobuf::Arena* arena);
       ^
/usr/local/include/google/protobuf/arenastring.h:190:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(NonEmptyDefault, ConstStringParam value, ::google::protobuf::Arena* arena);
       ^
/usr/local/include/google/protobuf/arenastring.h:191:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
  void Set(NonEmptyDefault, std::string&& value, ::google::protobuf::Arena* arena);
       ^
external/protobuf~/src/google/protobuf/any_lite.cc:59:44: error: no matching member function for call to 'Mutable'
  return message.SerializeToString(value_->Mutable(arena));
                                   ~~~~~~~~^~~~~~~
/usr/local/include/google/protobuf/arenastring.h:204:16: note: candidate function not viable: requires 2 arguments, but 1 was provided
  std::string* Mutable(EmptyDefault, ::google::protobuf::Arena* arena);
               ^
/usr/local/include/google/protobuf/arenastring.h:206:16: note: candidate function not viable: requires 2 arguments, but 1 was provided
  std::string* Mutable(const LazyString& default_value, ::google::protobuf::Arena* arena);
               ^
3 errors generated.
ERROR: /private/var/tmp/_bazel_zhao/187fa42438d89d1aa5dfcbb86837c850/external/protobuf~/BUILD.bazel:27:11: Compiling src/google/protobuf/inlined_string_field.cc [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing CppCompile command (from target @@protobuf~//:protobuf_lite) external/local_config_cc/cc_wrapper.sh -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics ... (remaining 36 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/protobuf~/src/google/protobuf/inlined_string_field.cc:31:
external/protobuf~/src/google/protobuf/inlined_string_field.h:170:3: error: unknown type name 'PROTOBUF_NDEBUG_INLINE'
  PROTOBUF_NDEBUG_INLINE void SetNoArena(StringPiece value);
  ^
external/protobuf~/src/google/protobuf/inlined_string_field.h:171:3: error: unknown type name 'PROTOBUF_NDEBUG_INLINE'
  PROTOBUF_NDEBUG_INLINE void SetNoArena(std::string&& value);
  ^
external/protobuf~/src/google/protobuf/inlined_string_field.h:174:3: error: unknown type name 'PROTOBUF_NDEBUG_INLINE'
  PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); }
  ^
external/protobuf~/src/google/protobuf/inlined_string_field.h:174:37: error: non-friend class member 'string' cannot have a qualified name
  PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); }
                               ~~~~~^
external/protobuf~/src/google/protobuf/inlined_string_field.h:174:43: error: expected ';' at end of declaration list
  PROTOBUF_NDEBUG_INLINE const std::string& Get() const { return GetNoArena(); }
                                          ^
external/protobuf~/src/google/protobuf/inlined_string_field.h:210:3: error: unknown type name 'PROTOBUF_NODISCARD'
  PROTOBUF_NODISCARD std::string* Release(Arena* arena, bool donated);

Turns out i have another protoc installed with brew, for anyone in need:
protocolbuffers/protobuf#5376