google-deepmind / code_contests

Apache License 2.0
2.1k stars 208 forks source link

Bazel build stops with an error #40

Open DaddyWesker opened 1 month ago

DaddyWesker commented 1 month ago

Hello and thanks for your code.

I'm trying to build this code using bazel as stated in readme: bazel build -c opt :print_names_and_sources

Unfortunately I'm getting an error:

ERROR: /home/daddywesker/.cache/bazel/_bazel_daddywesker/373a4c879c72055678bdc4d59a0ec5b5/external/com_google_riegeli/python/riegeli/records/BUILD:8:13: Linking external/com_google_riegeli/python/riegeli/records/record_writer.so failed: (Exit 1): clang failed: error executing CppLink command (from target @@com_google_riegeli//python/riegeli/records:record_writer.so) /usr/lib/llvm-10/bin/clang @bazel-out/k8-opt/bin/external/com_google_riegeli/python/riegeli/records/record_writer.so-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadString(std::string*, int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadTagSlow()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::SkipFallback(int, int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadTagFallback(unsigned int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarint32Slow(unsigned int*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarint64Slow(unsigned long*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadStringFallback(std::string*, int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::SetTotalBytesLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarint32Fallback(unsigned int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarint64Fallback()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::GetDirectBufferPointer(void const**, int*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadLengthAndPushLimit()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarintSizeAsIntSlow()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::default_recursion_limit_'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::PrintTotalBytesLimitError()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadLittleEndian32Fallback(unsigned int*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadLittleEndian64Fallback(unsigned long*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadVarintSizeAsIntFallback()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::BackUpInputToCurrentPosition()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::DecrementRecursionDepthAndPopLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::IncrementRecursionDepthAndPushLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::CheckEntireMessageConsumedAndPopLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::ReadRaw(void*, int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::Refresh()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::PopLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::PushLimit(int)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::~CodedInputStream()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::~CodedInputStream()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedOutputStream::WriteVarint32ToArrayOutOfLineHelper(unsigned int, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedOutputStream::default_serialization_deterministic_'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedOutputStream::~CodedOutputStream()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedOutputStream::~CodedOutputStream()'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::EnableAliasing(bool)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::WriteAliasedRaw(void const*, int, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::WriteRawFallback(void const*, int, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::WriteStringOutline(unsigned int, std::string const&, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::EnsureSpaceFallback(unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::FlushAndResetBuffer(unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::GetDirectBufferPointer(void**, int*, unsigned char**)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::WriteStringMaybeAliasedOutline(unsigned int, std::string const&, unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::GetDirectBufferForNBytesAndAdvance(int, unsigned char**)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::Skip(int, unsigned char**)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::Trim(unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::Flush(unsigned char*)'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::BytesUntilLimit() const'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::CodedInputStream::BytesUntilTotalBytesLimit() const'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
/usr/bin/ld.gold: error: bazel-out/k8-opt/bin/external/com_google_protobuf/_objs/protobuf_lite/coded_stream.pic.o: multiple definition of 'google::protobuf::io::EpsCopyOutputStream::ByteCount(unsigned char*) const'
/usr/bin/ld.gold: bazel-out/k8-opt/bin/external/protobuf~/_objs/protobuf_lite/coded_stream.pic.o: previous definition here
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So, for some reason bazel build creates two folders for protobuf protobuf~ and com_google_protobuf when building and I don't know why. I've tried to update bazel, use bazelisk, remove duplictaing folder - but still problem occurs. Thanks in advance for advice how to solve this.

OS is linux mint 20.3