bazel-contrib / bazel-contrib/rules_distroless

Building w/ v0.5.1 produces a `repository is used prior to being defined.` error

Open
#152 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Starlark
Stars
101
Forks
74
Avg merge
9h 42m
Merged PRs (30d)
2

Description

(This issue may be due to user error on my part, but it does seem pretty odd!)

When I load distroless with this command (`bazel_dep(name = "rules_distroless", version = "0.3.8")`), it loads fine.

When I load the newer version with `bazel_dep(name = "rules_distroless", version = "0.5.1")`, I get this error:

```
ERROR: Failed to load Starlark extension '@@compatibility_proxy//:proxy.bzl'.
Cycle in the workspace file detected. This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
- @@compatibility_proxy
This could either mean you have to add the '@@compatibility_proxy' repository with a statement like `http_archive` in your WORKSPACE file (note that transitive dependencies are not added automatically), or move an existing definition earlier in your WORKSPACE file.
```

I suppose this could be due to some misconfiguration on my side, but it does seem like it should be possible to `bazel_dep()` the latest version cleanly.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by loading rules_distroless with bazel_dep at version 0.5.1, then compare it with version 0.3.8. Start from the compatibility_proxy repository error; the issue is done when version 0.5.1 loads cleanly through bazel_dep without the repository-definition cycle.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.