Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Ishmeet opened this issue Aug 9, 2022 · 1 comment
Open

Comments

@Ishmeet
Copy link

Ishmeet commented Aug 9, 2022

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
Copy link

jhchabran commented Feb 3, 2023

@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",
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants