Have a query deps(...) mode that ignores data dependencies
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 75
Description
### Description of the feature request:
When running `bazel query deps(some-target)`, the result includes data dependencies and their transitive dependencies. I would like to ignore/exclude data dependencies.
### What underlying problem are you trying to solve with this feature?
I am only interested in the libraries that are _linked_ into some-target. Ultimately I want to assert that the set of of libraries linked into some-target does not include certain libraries.
### Which operating system are you running Bazel on?
Linux
### What is the output of `bazel info release`?
6.2.0
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse master; git rev-parse HEAD` ?
_No response_
### Have you found anything relevant by searching the web?
#15017 is loosely related, but it's not about querying, but about whether data dependencies are built when building the target that specifies them.
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start with the `bazel query deps(some-target)` entry point and compare its current results for linked and data dependencies. Define how excluding data dependencies should work transitively, then add coverage for a target where those dependency sets differ; done when the query returns only linked libraries for the requested use case.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100