coreos / go-iptables

Go wrapper around iptables utility
Apache License 2.0
1.11k stars 257 forks source link

BUILD file not found in directory 'iptables' of external repository #93

Open Ishmeet opened 2 years ago

Ishmeet commented 2 years ago
ERROR: /private/var/tmp/_bazel_ishmeets/a97eed571e7502676f54512ea1625825/external/com_github_containernetworking_plugins/pkg/ip/BUILD.bazel:3:11: no such package '@com_github_coreos_go_iptables//iptables': BUILD file not found in directory 'iptables' of external repository @com_github_coreos_go_iptables. Add a BUILD file to a directory to mark it as a package. and referenced by '@com_github_containernetworking_plugins//pkg/ip:ip'

WORKSPACE

go_repository(
    name = "com_github_coreos_go_iptables",
    importpath = "github.com/coreos/go-iptables",
    sum = "h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk=",
    version = "v0.6.0",
)
jhchabran commented 1 year ago

@Ishmeet I stumbled across this problem a minute ago, it's because the repository has a build file at its rool, which Bazel wrongly understand as a Bazel buildfile, whereas it's simply a a shell script.

You can fix it by doing the following on your side:

    go_repository(
        name = "com_github_coreos_go_iptables",
        build_file_proto_mode = "disable_global",
        importpath = "github.com/coreos/go-iptables",
        sum = "h1:is9qnZMPYjLd8LYqmm/qlE+wwEgJIkTYdhV3rfZo4jk=",
        version = "v0.6.0",
+        build_file_generation = "on",
    )