bazel-xcode / PodToBUILD

An easy way to integrate CocoaPods into Bazel
Apache License 2.0
323 stars 69 forks source link

Cannot build `nanopb` #146

Open sgammon opened 4 years ago

sgammon commented 4 years ago

Hey esteemed PodToBUILD authors,

I get the following errors when attempting to build nanopb:

ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: source file '//Vendor/nanopb:pb_common.c' is misplaced here (expected .m or .mm)
ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: '//Vendor/nanopb:pb_common.c' does not produce any objc_library non_arc_srcs files (expected .m or .mm)
ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: source file '//Vendor/nanopb:pb_decode.c' is misplaced here (expected .m or .mm)
ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: '//Vendor/nanopb:pb_decode.c' does not produce any objc_library non_arc_srcs files (expected .m or .mm)
ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: source file '//Vendor/nanopb:pb_encode.c' is misplaced here (expected .m or .mm)
ERROR: /Volumes/.../Vendor/nanopb/BUILD.bazel:112:13: in non_arc_srcs attribute of objc_library rule //Vendor/nanopb:nanopb: '//Vendor/nanopb:pb_encode.c' does not produce any objc_library non_arc_srcs files (expected .m or .mm)

From the following declaration:

new_pod_repository(
  name = "nanopb",
  url = "https://github.com/nanopb/nanopb/archive/df0e92f474f9cca704fe2b31483f0b4d1b1715a4.zip",
  podspec_url = "https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/6/1/e/nanopb/1.30905.0/nanopb.podspec.json",
  inhibit_warnings = True,
)
joprice commented 3 years ago

I'm seeing the same with Yoga. It seems that the c sources need to be built using a cc_library that the objc_library would depend on.

spennihana commented 3 years ago

Any workaround found?