elasticsearch-8.17 introduced dependency on jdk. Without a jdk installed, it fails to start complaining about jdk.attach module not found. After installing virtual/jdk:17, it works without a problem Reproducible: Always
Created attachment 920379 [details, diff] Depend on jdk insted of on jre
(In reply to nebojsa from comment #0) > elasticsearch-8.17 introduced dependency on jdk. Without a jdk installed, it > fails to start complaining about jdk.attach module not found. > After installing virtual/jdk:17, it works without a problem > > Reproducible: Always Usually if using virtual/jdk, it should go in DEPEND according to https://wiki.gentoo.org/wiki/Java_Developer_Guide#JDK.2FJRE. In RDEPEND you put virtual/jre - and don't forget to inherit either of java-pkg-2.eclass of java-pkg-opt-2.eclass.
(In reply to Volkmar W. Pogatzki from comment #2) > (In reply to nebojsa from comment #0) > > elasticsearch-8.17 introduced dependency on jdk. Without a jdk installed, it > > fails to start complaining about jdk.attach module not found. > > After installing virtual/jdk:17, it works without a problem > > > > Reproducible: Always > > Usually if using virtual/jdk, it should go in DEPEND according to > https://wiki.gentoo.org/wiki/Java_Developer_Guide#JDK.2FJRE. > In RDEPEND you put virtual/jre - and don't forget to inherit either of > java-pkg-2.eclass of java-pkg-opt-2.eclass. This package is not compiled - it is a binary bundle, that's why it does not inherit java-pkg-*.eclass. Further, it depends on jdk runtime, and not on jre runtime. Running it with jre runtime is what produces the error. If anything, package name could be changed to better reflect its contents, to elasticsearch-bin, and a warning could be issued to the user about either setting up jdk as system-vm or setting ES_JAVA_HOME in /etc/conf.d/elasticsearch to point to one.
afaik, binary blob should never depend on jdk. if it does, there's something wrong.
> package name could be changed to better reflect its contents, to elasticsearch-bin We only use the -bin suffix if there's a chance of confusion with a from-source package. There's an infinitesimal likelihood of anyone actually packaging ElasticSearch from source on Gentoo (maybe one of the forks, sure). > afaik, binary blob should never depend on jdk. if it does, there's something wrong. I had this argument when initially updating the ebuild to 8.x. Upstream ships it bundled with JDK (which we remove), however until this point it hasn't explicitly required JDK features. `jdk.attach` introduced in https://github.com/elastic/elasticsearch/commit/afd7e4e9117090b70b23347426472926eec77096 I didn't notice when packaging this release because I also have an appropriate JDK installed. I feel like just using JDK for ES is going to be the better long-term solution. We should have done that in the first place since it's what upstream actually uses. CC Java project: Any feedback before I just implement this? Do you want to have a fight with Elastic/Amazon about how they build and distribute their software?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b418ef3efc844001381e04b3a7b75de3703386fe commit b418ef3efc844001381e04b3a7b75de3703386fe Author: Matt Jolly <kangie@gentoo.org> AuthorDate: 2025-04-16 07:52:34 +0000 Commit: Matt Jolly <kangie@gentoo.org> CommitDate: 2025-04-16 07:56:59 +0000 app-misc/elasticsearch: add 8.17.4, 8.18.0, 9.0.0 From this commit we explicitly depend on a JDK at runtime, rather than the JRE that we were previously using. While this was fine when the package was initially tested, a simultaneously installed JDK masked the fact that this no longer works, and has not for an indeterminate period. Closes: https://bugs.gentoo.org/950962 Signed-off-by: Matt Jolly <kangie@gentoo.org> app-misc/elasticsearch/Manifest | 3 + app-misc/elasticsearch/elasticsearch-8.17.4.ebuild | 109 +++++++++++++++++++++ app-misc/elasticsearch/elasticsearch-8.18.0.ebuild | 109 +++++++++++++++++++++ app-misc/elasticsearch/elasticsearch-9.0.0.ebuild | 109 +++++++++++++++++++++ .../elasticsearch/files/elasticsearch-env-2.patch | 24 +++++ .../elasticsearch/files/elasticsearch-env-3.patch | 24 +++++ 6 files changed, 378 insertions(+)