From 58aba6b2eca5317e4699fd10ba830bc0b2839c88 Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Thu, 23 Apr 2015 14:49:10 -0700 Subject: [PATCH] Fix protoc dependency race. According to Eureka team, using protobuf_lib_type=="target" without a direct dependency on a protoc target causes flakiness in the build. This introduces a new variable to represent the protoc host target, with a default value for platforms like iOS where a prebuilt copy of protoc is used. Change-Id: I39c08bd76c6bc4a5291b0e19b2d22a9f3beb04d0 --- cdm/cdm.gyp | 4 ++++ platforms/global_config.gypi | 2 ++ third_party/protoc.gypi | 2 ++ 3 files changed, 8 insertions(+) diff --git a/cdm/cdm.gyp b/cdm/cdm.gyp index 588255a7..189c33a9 100644 --- a/cdm/cdm.gyp +++ b/cdm/cdm.gyp @@ -104,5 +104,9 @@ 'wvcdm_static', ], }, + { + 'target_name': 'dummy', + 'type': 'none', + } ], } diff --git a/platforms/global_config.gypi b/platforms/global_config.gypi index 87bb1c34..c0cb8583 100644 --- a/platforms/global_config.gypi +++ b/platforms/global_config.gypi @@ -26,6 +26,7 @@ # 2) protobuf_lib_type == 'target' # Use an existing protobuf gyp target from your project. # Specify the protobuf gyp file and target in protobuf_lib. + # Specify the protoc gyp file and target in protoc_host_target (optional). # Specify the path to protoc in protoc_dir. # # 3) protobuf_lib_type == 'source' @@ -35,6 +36,7 @@ 'protobuf_lib_type%': 'system', 'protobuf_lib%': '-lprotobuf', 'protoc_dir%': '/usr/bin', + 'protoc_host_target%': 'dummy', }, # end variables 'target_defaults': { diff --git a/third_party/protoc.gypi b/third_party/protoc.gypi index 3f13d089..bc358add 100644 --- a/third_party/protoc.gypi +++ b/third_party/protoc.gypi @@ -17,9 +17,11 @@ # protobuf_lib is a gyp target. 'dependencies': [ '<(protobuf_lib)', + '<(protoc_host_target)', ], 'export_dependent_settings': [ '<(protobuf_lib)', + '<(protoc_host_target)', ], }], ['protobuf_lib_type=="source"', {