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

[Bug]: Undeclared dependence on bazel-lib 2.7.7 #351

Closed
agoessling opened this issue Jul 24, 2024 · 4 comments · Fixed by #354 or #360
Closed

[Bug]: Undeclared dependence on bazel-lib 2.7.7 #351

agoessling opened this issue Jul 24, 2024 · 4 comments · Fixed by #354 or #360
Labels
bug Something isn't working

Comments

@agoessling
Copy link
Contributor

agoessling commented Jul 24, 2024

What happened?

The clang-tidy aspect contains an undeclared dependency on bazel-lib 2.7.7 (or at least one >2.5.0). If you pare the example module down to just the clang-tidy relevant code, you technically don't need to depend on bazel-lib directly, but when you remove this dependency the version in rules_lint (2.5.0) is insufficient. If you change the dependency in rules_lint to 2.7.7, things work as expected.

Version

Development (host) and target OS/architectures: linux x86

Output of bazel --version: bazel 7.2.1

Language(s) and/or frameworks involved: C/C++ clang-tidy

How to reproduce

1. Clone this branch: https://github.com/agoessling/rules_lint/tree/bazel_lib_dep
2. `cd rules_lint/example`
3. `bazel build --aspects=//tools/lint:linters.bzl%clang_tidy --output_groups=rules_lint_human src:hello_c && cat bazel-bin/src/hello_c.AspectRulesLintClangTidy.out`
4. change `bazel-lib` dep to 2.7.7 in `rules_lint/MODULE.bazel`
5. `bazel build --aspects=//tools/lint:linters.bzl%clang_tidy --output_groups=rules_lint_human src:hello_c && cat bazel-bin/src/hello_c.AspectRulesLintClangTidy.out`

Any other information?

No response

@agoessling agoessling added the bug Something isn't working label Jul 24, 2024
alexeagle added a commit that referenced this issue Jul 30, 2024
Now it matches the version in MODULE.bazel.

Fixes #351
@alexeagle
Copy link
Member

I guess you're using WORKSPACE and not bzlmod, since the MODULE.bazel file in this repo already has a minimum of bazel-lib 2.5.0. See #354

@agoessling
Copy link
Contributor Author

I don't think so, the reproduction branch I linked above doesn't even have a WORKSPACE file, only MODULE.bazel:
image

@agoessling
Copy link
Contributor Author

Also note, the required dependency is >2.5.0, 2.5.0 is in the MODULE.bazel file and it doesn't work.

@agoessling
Copy link
Contributor Author

@alexeagle I'm not sure this should be closed. Did you take a look at the branch that is reproducing this issue? It is using bzlmod. The issue isn't with not having 2.5.0, 2.5.0 is not enough. 2.7.7 makes it work. Note: rules_lint contains an override to 2.7.7. Sorry I haven't done a good job explaining the issue. The reproduction steps above are probably the best way to demonstrate the problem.

@alexeagle alexeagle reopened this Aug 3, 2024
alexeagle added a commit that referenced this issue Aug 6, 2024
We used a single_version_override locally which makes it hard to repro what users see.
Note that the example was already on 2.7.7, this just lines them up.

Fixes #351
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
None yet
2 participants