Add gencquery to execute configured queries in-build
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
https://github.com/bazelbuild/bazel/issues/5594 made progress on removing the host JDK dependency, but we still have a dependency on the host_jdk that I don't know how to break.
```
$ bazel query --output=build //vehicle/simulation:simulation_lite_query
# /home/austin/local/peloton-tech/vehicle/simulation/BUILD:295:1
genquery(
name = "simulation_lite_query",
testonly = True,
scope = ["//vehicle/simulation:simulation_lite_test", "//util:event", "//util:notifier"],
expression = "deps(//vehicle/simulation:simulation_lite_test) intersect set(//util:event //util:notifier)",
)
```
```
austin[151624] aschuh-debian-z620 (phil) ~/local/peloton-tech
$ bazel query 'somepath(//vehicle/simulation:simulation_lite_test,@local_jdk//:jdk)' --output=label_kind
cc_test rule //vehicle/simulation:simulation_lite_test
java_binary rule @bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main
alias rule @bazel_tools//tools/jdk:jdk
java_runtime rule @local_jdk//:jdk
```
We started bazel with ```--javabase=@openjdk_linux_archive//:runtime --host_javabase=@openjdk_linux_archive//:runtime```
The goal is to never use the host JDK.
Contributor guide
Research direction
Start by reviewing issue 5594 and the demonstrated `bazel query --output=build` and `genquery` usage. Trace the dependency path through `@local_jdk` and the configured `--javabase` and `--host_javabase` options. Done means adding `gencquery` to execute configured queries in-build without using the host JDK.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100