bazel-remote
bazel-remote copied to clipboard
error during build of bazel-remote + fix
The error, described at the end, occurs when trying to build from source machine on centos7 compiler is gcc 8.3.0 installed not local to the machine I was needing LD_LIBRARY_PATH to pass this but this step eas not taking that into account.
I am new to bazel, I found out that option "use_default_shell_env=True" in actions.run was necessary. a modification of external/io_bazel_rules_go/proto/compiler.bzl in actions.run fixed the problem
bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/go-protoc -protoc bazel-out/host/bin/external/com_google_protobuf/protoc -importpath google.golang.org/genproto/protobuf/api -out_path bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/proto/wkt/linux_amd64_stripped/api_go_proto%/ -plugin bazel-out/host/bin/external/com_github_golang_protobuf/protoc-gen-go/linux_amd64_stripped/protoc-gen-go -descriptor_set bazel-out/k8-fastbuild/bin/external/com_google_protobuf/source_context_proto-descriptor-set.proto.bin -descriptor_set bazel-out/k8-fastbuild/bin/external/com_google_protobuf/any_proto-descriptor-set.proto.bin -descriptor_set bazel-out/k8-fastbuild/bin/external/com_google_protobuf/type_proto-descriptor-set.proto.bin -descriptor_set bazel-out/k8-fastbuild/bin/external/com_google_protobuf/api_proto-descriptor-set.proto.bin -expected bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/proto/wkt/linux_amd64_stripped/api_go_proto%/google.golang.org/genproto/protobuf/api/api.pb.go -import 'google/protobuf/source_context.proto=google.golang.org/genproto/protobuf/source_context' -import 'google/protobuf/any.proto=github.com/golang/protobuf/ptypes/any' -import 'google/protobuf/type.proto=google.golang.org/genproto/protobuf/ptype' -import 'google/protobuf/api.proto=google.golang.org/genproto/protobuf/api' google/protobuf/api.proto)
ERROR: /net/hogsback/home1/thierry/bazel/bazel/_bazel_thierry/aa4e8273d17ebfffbcef68d297df2765/external/io_bazel_rules_go/proto/wkt/BUILD.bazel:3:1: Generating into bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/proto/wkt/linux_amd64_stripped/struct_go_proto%/github.com/golang/protobuf/ptypes/struct failed (Exit 1) go-protoc failed: error executing command
(cd /net/hogsback/home1/thierry/bazel/bazel/_bazel_thierry/aa4e8273d17ebfffbcef68d297df2765/sandbox/processwrapper-sandbox/915/execroot/main &&
exec env -
CGO_ENABLED=1
GOARCH=amd64
GOOS=linux
GOROOT=external/go_sdk
GOROOT_FINAL=GOROOT
PATH=/soft/fw/tools/gcc/gcc-8.3.0-rhel7-x64/bin:/usr/bin:/bin
bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/go-protoc -protoc bazel-out/host/bin/external/com_google_protobuf/protoc -importpath github.com/golang/protobuf/ptypes/struct -out_path bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/proto/wkt/linux_amd64_stripped/struct_go_proto%/ -plugin bazel-out/host/bin/external/com_github_golang_protobuf/protoc-gen-go/linux_amd64_stripped/protoc-gen-go -descriptor_set bazel-out/k8-fastbuild/bin/external/com_google_protobuf/struct_proto-descriptor-set.proto.bin -expected bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/proto/wkt/linux_amd64_stripped/struct_go_proto%/github.com/golang/protobuf/ptypes/struct/struct.pb.go -import 'google/protobuf/struct.proto=github.com/golang/protobuf/ptypes/struct' google/protobuf/struct.proto)
Execution platform: @local_config_platform//:host
Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/host/bin/external/com_google_protobuf/protoc: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by bazel-out/host/bin/external/com_google_protobuf/protoc) bazel-out/host/bin/external/com_google_protobuf/protoc: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by bazel-out/host/bin/external/com_google_protobuf/protoc)
bazel-out/host/bin/external/com_google_protobuf/protoc: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by bazel-out/host/bin/external/com_google_protobuf/protoc)
2019/12/04 19:28:24 error running protoc: exit status 1
Target //:bazel-remote failed to build
INFO: Elapsed time: 1.239s, Critical Path: 0.42s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
I wonder if this could have any unpleasant side effects? Another alternative might be to add this path to a file in /etc/ld.so.conf.d/
We might have to wait for this to be fixed upstream: https://github.com/bazelbuild/rules_go/issues/2265