bazel-xcode / PodToBUILD

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

Most of the time I am getting "in objc_library rule XXX: target YYY is not visible from target XXX. Check the visibility declaration of the former target if you think the dependency is legitimate." error #145

Open migfabio opened 4 years ago

migfabio commented 4 years ago

WORKSPACE

...
new_pod_repository(
    name = "NotificationBannerSwift",
    url = "https://github.com/Daltron/NotificationBanner/archive/3.0.4.zip",
)

new_pod_repository(
    name = "MarqueeLabel",
    url = "https://github.com/cbpowell/MarqueeLabel/archive/4.0.2.zip",
)

new_pod_repository(
    name = "SnapKit",
    url = "https://github.com/SnapKit/SnapKit/archive/5.0.1.zip",
)

BUILD

load(
    "@build_bazel_rules_swift//swift:swift.bzl", 
    "swift_library",
)

swift_library(
    name = "MyLib",
    srcs = glob(
        [
            "MyLib/**/*.swift",
        ]
    ),
    deps = [
        "@SnapKit//:SnapKit",
        "@NotificationBannerSwift//:NotificationBannerSwift",
    ],
)

Output of bazel build

ERROR: /private/var/tmp/_bazel_<redacted>/external/NotificationBannerSwift/BUILD.bazel:64:13: in objc_library rule @NotificationBannerSwift//:NotificationBannerSwift_cxx: target '@MarqueeLabel//:MarqueeLabel' is not visible from target '@NotificationBannerSwift//:NotificationBannerSwift_cxx'. Check the visibility declaration of the former target if you think the dependency is legitimate

ERROR: /private/var/tmp/_bazel_<redacted>/external/NotificationBannerSwift/BUILD.bazel:64:13: in objc_library rule @NotificationBannerSwift//:NotificationBannerSwift_cxx: target '@SnapKit//:SnapKit' is not visible from target '@NotificationBannerSwift//:NotificationBannerSwift_cxx'. Check the visibility declaration of the former target if you think the dependency is legitimate

Anyone has some idea how to solve this instead of import both Pods manually in Bazel? Thanks