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

protobufjs example: incompatibility with rules_docker #59

Open
mvukov opened this issue Jul 29, 2022 · 0 comments
Open

protobufjs example: incompatibility with rules_docker #59

mvukov opened this issue Jul 29, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mvukov
Copy link

mvukov commented Jul 29, 2022

In the workspace file of the protobufjs example I just added at the bottom:

http_archive(
    name = "io_bazel_rules_docker",
    sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
    urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)

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:container.bzl",
    "container_pull",
)

container_pull(
    name = "ubuntu_focal",
    tag = "ubuntu:20.04",
    digest = "sha256:b2339eee806d44d6a8adc0a790f824fb71f03366dd754d400316ae5a7e3ece3e",
    registry = "index.docker.io",
    repository = "library/ubuntu",
)

when I run bazel build @ubuntu_focal//image I get the following love letter:

INFO: Repository bazel_gazelle_go_repository_config instantiated at:
  /home/milan/dev/aspect_bazel_examples/protobufjs/WORKSPACE.bazel:81:15: in <toplevel>
  /home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/io_bazel_rules_docker/repositories/deps.bzl:38:12: in deps
  /home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/io_bazel_rules_docker/repositories/go_repositories.bzl:41:25: in go_deps
  /home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/bazel_gazelle/deps.bzl:77:25: in gazelle_dependencies
Repository rule go_repository_config defined at:
  /home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/bazel_gazelle/internal/go_repository_config.bzl:57:39: in <toplevel>
ERROR: An error occurred during the fetch of repository 'bazel_gazelle_go_repository_config':
   Traceback (most recent call last):
	File "/home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/bazel_gazelle/internal/go_repository_config.bzl", line 25, column 31, in _go_repository_config_impl
		config_path = ctx.path(ctx.attr.config)
Error in path: Not a regular file: /home/milan/dev/aspect_bazel_examples/protobufjs/WORKSPACE
ERROR: /home/milan/dev/aspect_bazel_examples/protobufjs/WORKSPACE.bazel:81:15: fetching go_repository_config rule //external:bazel_gazelle_go_repository_config: Traceback (most recent call last):
	File "/home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/bazel_gazelle/internal/go_repository_config.bzl", line 25, column 31, in _go_repository_config_impl
		config_path = ctx.path(ctx.attr.config)
Error in path: Not a regular file: /home/milan/dev/aspect_bazel_examples/protobufjs/WORKSPACE
ERROR: /home/milan/.cache/bazel/_bazel_milan/b93d749a5afa9d6a20cfa8ddf92dbbb1/external/io_bazel_rules_docker/container/go/cmd/extract_config/BUILD:19:11: no such package '@com_github_google_go_containerregistry//pkg/v1/tarball': no such package '@bazel_gazelle_go_repository_config//': Not a regular file: /home/milan/dev/aspect_bazel_examples/protobufjs/WORKSPACE and referenced by '@io_bazel_rules_docker//container/go/cmd/extract_config:go_default_library'
ERROR: Analysis of target '@ubuntu_focal//image:image' failed; build aborted: 
INFO: Elapsed time: 11.866s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (49 packages loaded, 471 targets configured)
    Fetching @com_github_google_go_containerregistry; Restarting.
    Fetching @com_github_pkg_errors; Restarting.

It may be that gazelle defs inside rules_nodejs and rules_docker clash.

bazel-examples: daf995d
bazel: 5.2.0
os: Ubuntu 20.04

@cgrindel cgrindel added bug Something isn't working need: discussion and removed need: discussion labels Sep 27, 2022
@gregmagolan gregmagolan moved this to 📋 Backlog in Open Source Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 📋 Backlog
Development

No branches or pull requests

3 participants