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

import_deps_checker tests aren't compatible with the current Bazel JDK #8162

Closed
katre opened this issue Apr 26, 2019 · 13 comments
Closed

import_deps_checker tests aren't compatible with the current Bazel JDK #8162

katre opened this issue Apr 26, 2019 · 13 comments
Assignees
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Java Issues for Java rules type: bug

Comments

@katre
Copy link
Member

katre commented Apr 26, 2019

Because tests under //src/java_tools haven't been run, the code has decayed badly. I don't understand how to fix these.

To reproduce:

$ bazel build --nokeep_going  //src/java_tools/import_deps_checker/javatests/...
INFO: Analysed 31 targets (0 packages loaded, 0 targets configured).
INFO: Found 31 targets...
ERROR: missing input file '@local_jdk//:jre/lib/rt.jar'
ERROR: /usr/local/google/home/jcater/repos/bazel/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD:84:1: //src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps:DepsCheckerClassVisitorTest: missing input file '@local_jdk//:jre/lib/rt.jar'
ERROR: /usr/local/google/home/jcater/repos/bazel/src/java_tools/import_deps_checker/javatests/com/google/devtools/build/importdeps/BUILD:84:1 1 input file(s) do not exist
INFO: Elapsed time: 0.325s, Critical Path: 0.02s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

I suspect that even cleaning this up to build, the tests still won't actually pass.

@katre katre added P1 I'll work on this now. (Assignee required) team-Rules-Java Issues for Java rules type: bug labels Apr 26, 2019
@katre
Copy link
Member Author

katre commented Apr 26, 2019

In #8164, I add all tests under //src/java_tools except the tests for import_deps_checker. Be sure to re-enable the tests when this is fixed.

@katre
Copy link
Member Author

katre commented Apr 26, 2019

Buildtools also fails under jdk8. I don't know if there's a way to fix this for both.

@iirina
Copy link
Contributor

iirina commented Apr 26, 2019

@katre can you also link a log or an error snippet for buildtools?

@iirina
Copy link
Contributor

iirina commented Apr 26, 2019

I found the buildkite run: https://buildkite.com/bazel/bazel-bazel-github-presubmit/builds/2717#533453ca-1692-4357-a693-15e7257602b1

Tests are failing with java.lang.NoSuchFieldError: ANNOTATION_PROCESSOR_MODULE_PATH

@cushon
Copy link
Contributor

cushon commented Apr 26, 2019

@kevin1e100 FYI for import_deps_checker.

@local_jdk shouldn't be used anymore, but even if the test resolves a JDK correctly rt.jar doesn't exist for JDK > 8.

I would try dropping in @bazel_tools//tools/jdk:platformclasspath instead of @local_jdk//:jre/lib/rt.jar and see if that works.

java.lang.NoSuchFieldError: ANNOTATION_PROCESSOR_MODULE_PATH

That probably indicates the necessary --patch-module= flags aren't getting set, or are being set incorrectly.

@cushon cushon removed their assignment May 1, 2019
@meisterT
Copy link
Member

This seems to be fixed.

@meteorcloudy
Copy link
Member

Should the following tests be re-enabled again:

# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/8162
- "-//src/java_tools/import_deps_checker/..."

@meisterT
Copy link
Member

meisterT commented Sep 7, 2022

likely, let's try?

@meisterT meisterT reopened this Sep 7, 2022
@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P1 I'll work on this now. (Assignee required) labels Oct 17, 2022
@comius
Copy link
Contributor

comius commented Oct 17, 2022

@meisterT did you try?

@meisterT
Copy link
Member

Nope, I though @meteorcloudy did, but I don't see a sign. Do you want to try it?

@meteorcloudy
Copy link
Member

Sorry, I didn't, it was a drop-by comment when I was fixing something else.

@comius
Copy link
Contributor

comius commented Oct 17, 2022

#16491

Copy link

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage) if you think this issue is still relevant or you are interested in getting the issue resolved.

@github-actions github-actions bot added the stale Issues or PRs that are stale (no activity for 30 days) label Dec 22, 2023
@fmeum fmeum removed the stale Issues or PRs that are stale (no activity for 30 days) label Dec 22, 2023
@fmeum fmeum self-assigned this Dec 22, 2023
meteorcloudy pushed a commit to meteorcloudy/bazel that referenced this issue Feb 21, 2024
A compatible JDK 8 is fetched via `remote_java_repository`. Requires fixing paths in golden files to not contain `third_party/bazel/` as well as the expected exit code of the `MethodHandle#invoke` test, which is expected to pass.

Fixes bazelbuild#8162

Closes bazelbuild#20655.

PiperOrigin-RevId: 602641568
Change-Id: I54ec568d981e3bd27caab9e24c0c9eb2a25c6372
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-Java Issues for Java rules type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants