Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

HEAD busted with documented set up #1126

Closed
jmhodges opened this issue Sep 4, 2019 · 2 comments
Closed

HEAD busted with documented set up #1126

jmhodges opened this issue Sep 4, 2019 · 2 comments

Comments

@jmhodges
Copy link
Contributor

jmhodges commented Sep 4, 2019

HEAD (4109d47) is currently not working and fails in the errors dependency in rules_docker:

INFO: Call stack for the definition of repository 'com_github_pkg_errors' which is a go_repository (rule definition at /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/bazel_gazelle/internal/go_repository.bzl:189:17):
 - /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/io_bazel_rules_docker/repositories/go_repositories.bzl:44:9
 - /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/io_bazel_rules_docker/repositories/deps.bzl:34:5
 - /Users/jeffhodges/src/github.com/jmhodges/bazel_bugs/WORKSPACE:27:1
ERROR: An error occurred during the fetch of repository 'com_github_pkg_errors':
   Unable to load package for //:WORKSPACE: BUILD file not found in any of the following directories.
 - /Users/jeffhodges/src/github.com/jmhodges/bazel_bugs
INFO: Call stack for the definition of repository 'com_github_google_go_containerregistry' which is a go_repository (rule definition at /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/bazel_gazelle/internal/go_repository.bzl:189:17):
 - /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/io_bazel_rules_docker/repositories/go_repositories.bzl:38:9
 - /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/io_bazel_rules_docker/repositories/deps.bzl:34:5
 - /Users/jeffhodges/src/github.com/jmhodges/bazel_bugs/WORKSPACE:27:1
ERROR: /private/var/tmp/_bazel_jeffhodges/f64e3aaa7d5f6266a5011fdea0b8bb7c/external/io_bazel_rules_docker/container/go/cmd/join_layers/BUILD:3:1: @io_bazel_rules_docker//container/go/cmd/join_layers:go_default_library depends on @com_github_pkg_errors//:go_default_library in repository @com_github_pkg_errors which failed to fetch. no such package '@com_github_pkg_errors//': Unable to load package for //:WORKSPACE: BUILD file not found in any of the following directories.
 - /Users/jeffhodges/src/github.com/jmhodges/bazel_bugs
ERROR: Analysis of target '//dockertest:dockertest' failed; build aborted: no such package '@com_github_pkg_errors//': Unable to load package for //:WORKSPACE: BUILD file not found in any of the following directories.
 - /Users/jeffhodges/src/github.com/jmhodges/bazel_bugs

This was built with this WORKSPACE using what I believe is the same set up as documented in the README and using new_container_pull:

workspace(name = "com_github_jmhodges_bazel_bugs")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = "49b04b1c7fe8636ca44455d72e2a5854bf666f21e50601383066c182d887ff58",
    strip_prefix = "rules_docker-4109d47b8656464e3075f3af1f6c8705e0eec867",
    urls = ["https://github.com/bazelbuild/rules_docker/archive/4109d47b8656464e3075f3af1f6c8705e0eec867.zip"],
)

load(
    "@io_bazel_rules_docker//repositories:repositories.bzl",
    container_repositories = "repositories",
)

container_repositories()

load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")

container_deps()

load("@io_bazel_rules_docker//container:new_pull.bzl", "new_container_pull")

new_container_pull(
    name = "mysql",
    registry = "index.docker.io",
    repository = "library/mysql",
    # digest for tag 5.7.25 on 2019-02-28
    digest = "sha256:2bd4665d9c5ecad61f7ceff82f82e6470c4686b9ec0fd986b84012861506c722",
)
@jmhodges
Copy link
Contributor Author

jmhodges commented Sep 4, 2019

PEBKAC. My bad

@nlopezgi
Copy link
Contributor

This was likely due to not having a BUILD file at the top level directory. See also:
bazel-contrib/bazel-gazelle#609
#1139.

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

No branches or pull requests

2 participants