Different GOOGLE_PROTOBUF_VERSION for building chrome vs components_unittests?

329 views
Skip to first unread message

Simon Que

unread,
Jul 15, 2016, 5:17:32 PM7/15/16
to Chromium-dev
In the generated C++ for one of my protobuf files (memory_leak_report.proto), I see the following:

#if GOOGLE_PROTOBUF_VERSION < 3000000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers.  Please update
#error your headers.
#endif

The compiler hits this error when I attempt to build chrome, but not when I build components_unittests. Both targets use memory_leak_report.proto.

The full command line that gave me the error is shown below:

===============================

/usr/local/ssd/cros/chromium/.cros_cache/common/goma+2//gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/chrome/renderer/leak_detector/leak_detector/leak_detector_remote_client.o.d -DV8_DEPRECATION_WARNINGS -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_ASH=1 -DUSE_AURA=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_APP_LIST=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DIMAGE_LOADER_EXTENSION=1 -DENABLE_WAYLAND_SERVER=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=274369-1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DOS_CHROMEOS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../.. -Igen -fno-strict-aliasing -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/usr/local/ssd/cros/chromium/src=. -pthread -m64 -march=x86-64 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wno-nonportable-include-path -O2 -fno-ident -fdata-sections -ffunction-sections -g0 -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Xclang -plugin-arg-find-bad-constructs -Xclang check-implicit-copy-ctors -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wno-reserved-user-defined-literal -fno-rtti -fno-exceptions -c ../../chrome/renderer/leak_detector/leak_detector_remote_client.cc -o obj/chrome/renderer/leak_detector/leak_detector/leak_detector_remote_client.o
In file included from ../../chrome/renderer/leak_detector/leak_detector_remote_client.cc:9:
In file included from ../../components/metrics/leak_detector/protobuf_to_mojo_converter.h:9:
gen/components/metrics/proto/memory_leak_report.pb.h:12:2: error: This file was generated by a newer version of protoc which is
#error This file was generated by a newer version of protoc which is
 ^
gen/components/metrics/proto/memory_leak_report.pb.h:13:2: error: incompatible with your Protocol Buffer headers.  Please update
#error incompatible with your Protocol Buffer headers.  Please update
 ^
gen/components/metrics/proto/memory_leak_report.pb.h:14:2: error: your headers.
#error your headers.
 ^
gen/components/metrics/proto/memory_leak_report.pb.h:22:10: fatal error: 'google/protobuf/arena.h' file not found
#include <google/protobuf/arena.h>
         ^
4 errors generated.

Simon Que

unread,
Jul 15, 2016, 6:41:43 PM7/15/16
to Chromium-dev
I figured it out. I moved that file to a new BUILD.gn but needed to add a dependency on the module containing that protobuf.
Reply all
Reply to author
Forward
0 new messages