apollo icon indicating copy to clipboard operation
apollo copied to clipboard

BUILD error when build apollo 2.0 from source about protobuf

Open gaoxiang12 opened this issue 8 years ago • 6 comments

Hi guys, I get an error when trying to build apollo 2.0 from source. After input "bash apollo build" I get these messages:

ERROR: /home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/BUILD:441:1: Traceback (most recent call last): File "/home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/BUILD", line 441 cc_proto_library(name = "cc_test_protos", srcs = (L...), <4 more arguments>) File "/home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/protobuf.bzl", line 247, in cc_proto_library cc_libs += [default_runtime] trying to mutate a frozen object ERROR: /home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/BUILD:742:1: Traceback (most recent call last): File "/home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/BUILD", line 742 py_proto_library(name = "python_specific_test_pro...", <6 more arguments>) File "/home/xiang/.cache/bazel/_bazel_xiang/b12dad91e376cd0947d4dee163139822/external/com_google_protobuf/protobuf.bzl", line 373, in py_proto_library py_libs += [default_runtime] trying to mutate a frozen object ^C Bazel caught interrupt signal; shutting down.

I'm using ubuntu 16.04 with ROS K. Looks like some things goes wrong in bazel query and protobuf. But I'm not familiar with bazel. Any suggestions?

gaoxiang12 avatar Jan 01 '18 09:01 gaoxiang12

Do you work in docker container?

xiaoxq avatar Jan 04 '18 00:01 xiaoxq

I have the same issue. It's ok in the docker, but in the pc side there will be the same error. Who can support me?

liupanpan avatar Jan 08 '18 12:01 liupanpan

I'm in Ubuntu 16.04 and I don't want to docker another ubuntu 1404 in my system...

gaoxiang12 avatar Jan 09 '18 12:01 gaoxiang12

I found a relation issue on stack overflow https://stackoverflow.com/questions/47688252/tensorflow-trying-to-mutate-a-frozen-object-bazel It seems that we should downgrade the bazel to some older version or....

And further search shows: https://github.com/google/protobuf/issues/3796

And the patch: Make .bzl files compatible with future versions of Bazel

My solution: downgrade bazel to 0.5.4 and solved the "mutate a frozen object" problem.

jianglinchun avatar Jan 11 '18 04:01 jianglinchun

it seems impossible to build apollo in ubuntu 16.04, because firstly the ros in apollo is based on indigo , and ros can be install in ubuntu 16.04 only in distro kinetic , secondly the docs in apollo said " the apollo docker is the only supporting realtime system"

lxbeyond avatar Jan 16 '18 05:01 lxbeyond

It is recommended to build Apollo in Ubuntu 14.04. Should you want to continue building in Apollo 16.04, please refer to: the following document Closing this issue as it seems to be resolved.

natashadsouza avatar Aug 23 '18 21:08 natashadsouza