-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 .deb package lists dependency on system JDK (unintentionally?) #5753
Comments
I had a little bit of a dive into the code and commit history on this today.
Other things, not completely related to the JDK, but encountered during my research:
Anyway, the current situation seems invalid to me. Please make a decision whether we want or do not want an embedded JDK in the Debian/Fedora packages. |
We do want an embedded JDK in our Debian/Fedora packages. It's not clear yet, however, if we still have to depend (or at least optionally depend) on a system JDK as well in the long-term. The reason is that currently the embedded JDK is a full JDK that's also compatible with the JavaBuilder that we ship. However, we're considering stripping down the embedded JDK to the bare minimum that's needed to run Bazel itself, at which point you'd need a system JDK (or a JDK from a remote repository) in order to build Java code. Maybe we should change the "Depends" to a "Recommends" in our packages (if we verify that Bazel indeed currently works without an installed JDK, which is something that we don't test on CI yet)? |
Thanks for clarifying, @philwo. IIUC:
Bazel isn't only used to build Java code, so for those environments not having that hard dependency would be great! Making it a recommended (or suggested even) dependency makes sense, imo. Perhaps also consider adding the JDK 9/10/11 versions as well to the list (inside the big OR'd list), as recommending only JDK8 isn't the choice of everyone. I understand RPM/spec doesn't have a recommended/suggested level of dependencies, so yeah, I'm not so sure what would be the right thing to do there. I'd volunteer to update the dependencies in a PR if we have consensus over what to do exactly.
Is that something I can help with as well in a PR? If so, I'd appreciate some pointers where to look - I'm not yet familiar so much with Bazel's source tree. |
I've com across the following in the 0.18.0-rc3 release notes:
I think it would not make sense for the Bazel project to be able to build special Bazel deb/rpm packages which try to use the local system JRE to run. First of all, because you cannot assume that all major mainline Linux distributions will provide the JRE Bazel needs. In order to have Bazel move forward without having to look at what all those Linux distributions are shipping, it makes sense to keep embedding the JDK (well, JRE then, if you can't build with it at all), including the deb/rpm packages. TL;DR: Bazel deb/rpm packaging should drop the JDK dependencies (like I did in https://github.com/gertvdijk/bazel/commit/a6cda75bfcc1100be7d78a146fb1e81f19c7c105) and it's safe to do this at current HEAD, I think. |
Can the documentation at https://docs.bazel.build/versions/master/install-ubuntu.html be updated to mention that you don't need to edit
|
…meaning. This addresses user feedback from #5753 (comment). PiperOrigin-RevId: 281059785
The dependency seems to be gone and the docs have been updated. |
Description of the problem / feature request:
Note that that 0.16.0 comes with an embedded JDK also for the .deb file (notice increased size from 100MB to 155MB).
I had the expectation that installing Bazel would drop the dependency on it for itself, so I can install and run Bazel without a local JDK installed.
However:
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Get a clean Debian/Ubuntu machine (e.g. Docker/Vagrant or something).
Install as per the documentation the dependencies, e.g.
Download Bazel from the GitHub releases page - not the .sh file, but the .deb file.
Install Bazel with
dpkg
, e.g.dpkg -i /path/to/downloaded/deb
What operating system are you running Bazel on?
Debian, Ubuntu.
What's the output of
bazel info release
?Unable to install Bazel - so, nothing.
If
bazel info release
returns "development version" or "(@Non-Git)", tell us how you built Bazel.Obtained Bazel from GitHub release page
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?n/a
Have you found anything relevant by searching the web?
#5744 - but that's pointing out that the need for a local JDK is a bug, underlining my statement in this report.
Any other information, logs, or outputs that you want to share?
If this dependency is deliberately kept in place, yet also shipping an embedded JDK, please update the documentation/resources explaining the need for that; the current situation does not compile in my head.
The text was updated successfully, but these errors were encountered: