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

Bazel 7 queries produces missing jar files for rules_jvm_external #21814

Open
carolosf opened this issue Mar 26, 2024 · 2 comments
Open

Bazel 7 queries produces missing jar files for rules_jvm_external #21814

carolosf opened this issue Mar 26, 2024 · 2 comments

Comments

@carolosf
Copy link

Description of the bug:

We’re seeing some strangeness recently with Bazel 7/7.1.0/7.1.1

Not sure how to reproduce yet outside of our repo and seeing if anyone has noticed anything similar.

We’re finding that if you don’t have anything cached and do a query first instead of a build that rules_jvm_external maven dependencies are missing jar files in ‘bazel-bin/external/maven/…’

Once this happens even if you do a build the directories never get a jar file and builds fail with ‘java.lang.NoClassDefFoundError’

If you do a build first instead of a query jars get created as usual.

The above happens in Linux and macOS.

There may be a related error where we see queries hang and never complete but that might be related to MacOS Sonoma Java.

Sample query that produces both issues for us:
‘bazel query “deps(//…)” —notool_deps —output=streamed_jsonproto > myfile

Which category does this issue belong to?

Core, Java Rules

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Not determined yet

Which operating system are you running Bazel on?

Linux and MacOS 14.4.1

What is the output of bazel info release?

No response

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 HEAD ?

No response

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

GitHub issue #21712 might be related to the second part but might be unrelated to first part

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added team-Core Skyframe, bazel query, BEP, options parsing, bazelrc team-Rules-Java Issues for Java rules labels Mar 26, 2024
@fmeum
Copy link
Collaborator

fmeum commented Mar 26, 2024

That you aren't seeing the jar files is likely working as expected if you use a disk or remote cache due to --remote_download_outputs=toplevel being the default in Bazel 7.

That doesn't explain the NoClassDefFoundError though. Do you have a shareable example setup that reproduces this issue?

@iancha1992 iancha1992 removed the team-Core Skyframe, bazel query, BEP, options parsing, bazelrc label Mar 26, 2024
@carolosf
Copy link
Author

Trying to reproduce this in a toy repo.

Unfortunately in the toy repo when I do a query the bazel-bin directory is not created but in the real repo it does get created when doing a query.

There must be something in our .bazelrc config that might be making it generate a bazel-bin...

I will continue to investigate.

This is the repo in the meantime if others have a similar issue and want to experiment:
https://github.com/carolosf/bazel-21814

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants