Skip to content

Objective-C bazel target failed to build at 3.12.x #7532

Closed
@stanley-cheung

Description

Environment: MacOS

At the 3.12.x branch, bazel build :protobuf_objc failed, but completed successfully at the 3.11.x branch.

At 3.12.x

stanleycheung@stanleycheung-macbookpro3:~/protobuf$ bazel build :protobuf_objc
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:protobuf_objc (19 packages loaded, 238 targets configured).
INFO: Found 1 target...
ERROR: missing input file 'objectivec/google/protobuf/FieldMask.pbobjc.m', owner: '//:objectivec/google/protobuf/FieldMask.pbobjc.m'
ERROR: /Users/stanleycheung/protobuf/BUILD:969:1: //:protobuf_objc: missing input file '//:objectivec/google/protobuf/FieldMask.pbobjc.m'
ERROR: /Users/stanleycheung/protobuf/BUILD:969:1: C++ compilation of rule '//:protobuf_objc' failed: I/O exception during sandboxed execution: Running '/var/tmp/_bazel_stanleycheung/install/7afe40059062a3d2a6e3d7dae41ab49a/xcode-locator 11.3.1.11C505' failed.
Process terminated by signal 15
stdout: 
stderr: 
Target //:protobuf_objc failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/stanleycheung/protobuf/BUILD:969:1 1 input file(s) do not exist
INFO: Elapsed time: 5.224s, Critical Path: 0.09s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

At 3.11.x

~/protobuf$ bazel build :protobuf_objc
Starting local Bazel server and connecting to it...
INFO: Analyzed target //:protobuf_objc (19 packages loaded, 238 targets configured).
INFO: Found 1 target...
Target //:protobuf_objc up-to-date:
  bazel-out/apl-darwin_x86_64-fastbuild/bin/libprotobuf_objc.a
INFO: Elapsed time: 8.173s, Critical Path: 2.48s
INFO: 25 processes: 25 darwin-sandbox.
INFO: Build completed successfully, 27 total actions

Could it be because of #7173? Is it because objectivec/GPBFieldMask.pbobjc.h is not part of hdrs in the :protobuf_objc BUILD rule? https://github.com/protocolbuffers/protobuf/blob/3.12.x/BUILD#L969

This patch seems to fix the issue:

diff --git a/BUILD b/BUILD
index 8ab4cb413..b32a1f161 100644
--- a/BUILD
+++ b/BUILD
@@ -969,6 +969,16 @@ alias(
 objc_library(
     name = "protobuf_objc",
     hdrs = [
+        "objectivec/GPBAny.pbobjc.h",
+        "objectivec/GPBApi.pbobjc.h",
+        "objectivec/GPBDuration.pbobjc.h",
+        "objectivec/GPBEmpty.pbobjc.h",
+        "objectivec/GPBFieldMask.pbobjc.h",
+        "objectivec/GPBSourceContext.pbobjc.h",
+        "objectivec/GPBStruct.pbobjc.h",
+        "objectivec/GPBTimestamp.pbobjc.h",
+        "objectivec/GPBType.pbobjc.h",
+        "objectivec/GPBWrappers.pbobjc.h",
         "objectivec/GPBArray.h",
         "objectivec/GPBBootstrap.h",
         "objectivec/GPBCodedInputStream.h",
@@ -1017,6 +1027,16 @@ objc_library(
         "objectivec",
     ],
     non_arc_srcs = [
+        "objectivec/GPBAny.pbobjc.m",
+        "objectivec/GPBApi.pbobjc.m",
+        "objectivec/GPBDuration.pbobjc.m",
+        "objectivec/GPBEmpty.pbobjc.m",
+        "objectivec/GPBFieldMask.pbobjc.m",
+        "objectivec/GPBSourceContext.pbobjc.m",
+        "objectivec/GPBStruct.pbobjc.m",
+        "objectivec/GPBTimestamp.pbobjc.m",
+        "objectivec/GPBType.pbobjc.m",
+        "objectivec/GPBWrappers.pbobjc.m",
         "objectivec/GPBArray.m",
         "objectivec/GPBCodedInputStream.m",
         "objectivec/GPBCodedOutputStream.m",
@@ -1031,16 +1051,6 @@ objc_library(
         "objectivec/GPBUtilities.m",
         "objectivec/GPBWellKnownTypes.m",
         "objectivec/GPBWireFormat.m",
-        "objectivec/google/protobuf/Any.pbobjc.m",
-        "objectivec/google/protobuf/Api.pbobjc.m",
-        "objectivec/google/protobuf/Duration.pbobjc.m",
-        "objectivec/google/protobuf/Empty.pbobjc.m",
-        "objectivec/google/protobuf/FieldMask.pbobjc.m",
-        "objectivec/google/protobuf/SourceContext.pbobjc.m",
-        "objectivec/google/protobuf/Struct.pbobjc.m",
-        "objectivec/google/protobuf/Timestamp.pbobjc.m",
-        "objectivec/google/protobuf/Type.pbobjc.m",
-        "objectivec/google/protobuf/Wrappers.pbobjc.m",
     ],
     visibility = ["//visibility:public"],
 )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions