Bug 288653 - textproc/elasticsearch8: Update to recent version
Summary: textproc/elasticsearch8: Update to recent version
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Vladimir Druzenko
URL:
Keywords:
Depends on:
Blocks: 293746 296777
  Show dependency tree / graph
 
Reported: 2025-08-04 09:27 UTC by vincent.jancso
Modified: 2026-11-05 13:04 UTC (History)
11 users (show)

See Also:
bugzilla: maintainer-feedback? (elastic)
vvd: merge-quarterly+


Attachments
Elasticsearch 8.19.3 (4.40 KB, application/x-gzip)
2025-09-17 19:18 UTC, Saro
no flags Details
Elasticsearch 8.19.4 (4.38 KB, application/x-gzip)
2025-09-22 15:17 UTC, Saro
no flags Details
Elasticsearch 8.19.5 (4.39 KB, application/x-gzip)
2025-10-08 17:34 UTC, Saro
no flags Details
Elasticsearch 8.19.6 (4.40 KB, application/x-gzip)
2025-10-24 15:31 UTC, Saro
no flags Details
Elasticsearch 8.19.7 (4.30 KB, application/x-gzip)
2025-11-11 17:48 UTC, Saro
no flags Details
Elasticsearch 8.19.7_1 (4.33 KB, application/x-gzip)
2025-11-11 19:10 UTC, Saro
no flags Details
patch to update to Elasticsearch 8.19.7_1 (8.30 KB, patch)
2025-12-02 14:48 UTC, Mark Linimon
no flags Details | Diff
Elasticsearch 8.19.8 (9.10 KB, patch)
2025-12-04 20:39 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.9 (14.94 KB, patch)
2025-12-31 14:54 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.10 (15.58 KB, patch)
2026-01-20 19:25 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.10 (9.74 KB, patch)
2026-01-20 19:31 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.11 (73.63 KB, patch)
2026-02-05 19:34 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.12 (74.36 KB, patch)
2026-03-06 17:51 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.12 (84.57 KB, patch)
2026-03-12 18:24 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.20 (165.15 KB, patch)
2026-09-08 21:10 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.20 (166.14 KB, patch)
2026-09-10 19:20 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.20 (166.14 KB, patch)
2026-09-10 19:23 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.20_3 (166.14 KB, patch)
2026-09-24 15:36 UTC, Saro
no flags Details | Diff
Elasticsearch 8.19.23 (164.39 KB, patch)
2026-10-27 20:47 UTC, Saro
no flags Details | Diff
v1 (9.65 KB, text/plain)
2026-10-31 16:10 UTC, Vladimir Druzenko
no flags Details
Elasticsearch 8.19.24 (158.86 KB, patch)
2026-11-04 14:11 UTC, Saro
saro: maintainer-approval? (elastic)
Details | Diff
Build and Install libvec.so (1.49 KB, patch)
2026-11-05 10:56 UTC, Daniel
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description vincent.jancso 2025-08-04 09:27:02 UTC
I have noticed, that the freebsd port is outdated (8.11.3).
The latest available release currently is 8.19.0.

There is also an open issue regarding FreeBSD Support: https://github.com/elastic/elasticsearch/issues/131904#issuecomment-3149591132

8.18.0 had some changes which will actively prevent elasticsearch to start on unsupported platforms. Looks like they are willing to take a look at it. Let's hope they will fix it.
Comment 1 Saro 2025-09-11 17:16:38 UTC
(In reply to vincent.jancso from comment #0)

I implemented the missing NativeAccess functionality into Elasticsearch a few months ago.

https://github.com/sarog/elasticsearch/

Currently the repository has the fixes applied on the 8.17 branch. I'm working on porting the fixes to 8.19 and 9.1 shortly.

If you decide to try it out, you need to add the following properties in `jvm.options:

-Des.nativelibs.path=/usr/local/lib
-Dorg.elasticsearch.nativeaccess.enableVectorLibrary=false
Comment 2 Saro 2025-09-11 17:21:49 UTC
For a quick overview of what changes/patches are needed:
https://github.com/elastic/elasticsearch/compare/main...sarog:elasticsearch:freebsd

The 8.19 branch has a few conflicts which I have resolved but not pushed yet. Currently running a test build in a VM before I publish the changes to the repository.
Comment 3 vincent.jancso 2025-09-12 09:09:03 UTC
(In reply to Saro from comment #2)

Wow, this was unexpected. Thank you for providing patches. I will give it a try once you got 8.19 up and running :-)
Comment 4 Saro 2025-09-17 19:17:54 UTC
An update: I have moved my repository to a GitHub organization as I plan to upload a few more port projects, such as Elastic's machine learning (ml-cpp) library.

New location: https://github.com/portsbuild/elasticsearch

Currently, the 8.19.3 distribution is tagged and a binary artifact is readily available (built via GitHub Actions). It's understandable if one does not wish to download an unknown binary, so I will provide the building steps and a port Makefile in a follow-up comment (or see: https://github.com/sarog/freebsd-ports/tree/main/textproc/elasticsearch8).

While I have successfully upgraded my ES nodes from 8.15.5 to 8.19.3, I strongly recommend testing this release before rolling out into production!

Please note: if you are using Kibana, you may also need to update it to 8.19.x. The port is available here if you want to try it: https://github.com/sarog/freebsd-ports/tree/main/textproc/kibana8

Building Elasticsearch
----------------------

First, please review the code changes:

https://github.com/elastic/elasticsearch/compare/v8.19.3...portsbuild:elasticsearch:v8.19.3

Once reviewed, you can build the FreeBSD package on any OS of your choice. When building on FreeBSD, I had to install java/openjdk versions 17 to 23 (inclusive). Running ES 8.19.3 requires openjdk 21+.

**NOTE**: the following will build Elasticsearch with a TEST public key (the "license.key" property in the build command below). This means if you have a valid ES (e.g. Enterprise) license key, it will not work with this build. The solution is to build the package with Elastic's production public key, which is easily extracted from a 8.19.3 release (re: x-pack-core-8.19.3.jar). I will apply this change once I can confirm the build works.

## Install the necessary JDKs
$ pkg install java/openjdk17 java/openjdk19 java/openjdk20 java/openjdk21 java/openjdk22 java/openjdk23

$ git clone --depth 1 --branch v8.19.3 https://github.com/portsbuild/elasticsearch elasticsearch-8.19.3
$ cd elasticsearch-8.19.3
$ ./gradlew distribution:archives:freebsd-tar:assemble -D"build.snapshot=false" -D"license.key=x-pack/license-tools/src/test/resources/public.key" -Porg.gradle.java.installations.paths=/usr/local/openjdk21,/usr/local/openjdk17,/usr/local/openjdk19,/usr/local/openjdk20,/usr/local/openjdk22,/usr/local/openjdk23
$ mv distribution/archives/freebsd-tar/build/distributions/elasticsearch-8.19.3-freebsd-x86_64.tar.gz /usr/ports/distfiles/

## Apply the port patch (supplied in a follow-up comment).
## You may want to create a /usr/local/ports and extract the port patch there to avoid conflicts.
$ cd /usr/ports/textproc/elasticsearch8
$ make makesum
$ make reinstall clean

If you are upgrading from a previous version, do not forget to update jvm.options with the properties mentioned in the previous post. On new installs, the port includes the necessary patches to update jvm.options for you.

Update rc.conf with the following so ES uses JDK 21:
elasticsearch_java_home="/usr/local/openjdk21"

Upgrade docs from Elastic: https://www.elastic.co/docs/deploy-manage/upgrade/deployment-or-cluster/self-managed

Next up: updating sysutils/beats8 and sysutils/logstash8
Comment 5 Saro 2025-09-17 19:18:56 UTC
Created attachment 263889 [details]
Elasticsearch 8.19.3
Comment 6 Saro 2025-09-22 15:17:32 UTC
Created attachment 263987 [details]
Elasticsearch 8.19.4

This build includes Elastic's public key, so commercial licenses should technically work (untested as I don't have an Enterprise license).
Comment 7 Saro 2025-09-22 15:51:24 UTC
For Kibana 8.19.4, see bug #289759.
Comment 8 Saro 2025-10-08 17:34:35 UTC
Created attachment 264413 [details]
Elasticsearch 8.19.5

Update to 8.19.5
Comment 9 Saro 2025-10-24 15:31:19 UTC
Created attachment 264852 [details]
Elasticsearch 8.19.6
Comment 10 Saro 2025-11-11 17:48:49 UTC
Created attachment 265336 [details]
Elasticsearch 8.19.7

This release removes the 'shebangfix' from the Makefile as the changes are now done at the source level.

FreeBSD test results are also available: https://github.com/portsbuild/elasticsearch/actions/workflows/freebsd-test.yml

Currently, only 1 test out of ~500 is failing and I am unsure as to why (re: testSyncWithLinksThrowExceptionWhenDestinationIsNotWritable). Details here: https://github.com/portsbuild/elasticsearch/actions/runs/19247832419/job/55026096980#step:3:48545

Lastly, Elasticsearch 9.2 is now available at Bugfix #290954.
Comment 11 Saro 2025-11-11 19:10:51 UTC
Created attachment 265338 [details]
Elasticsearch 8.19.7_1

Forgot to update the PATH in the startup script so bash can be found via env.
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2025-12-02 14:48:35 UTC
Created attachment 265778 [details]
patch to update to Elasticsearch 8.19.7_1

^Triage: reformat as git diff.
Comment 13 Saro 2025-12-02 16:11:07 UTC
(In reply to Mark Linimon from comment #12)

FYI, ES 8.19.8 was just released by Elastic. I'll submit a diff patch later today after testing.
Comment 14 Saro 2025-12-04 20:39:01 UTC
Created attachment 265852 [details]
Elasticsearch 8.19.8

I hope this patch file format is acceptable!
Comment 15 Saro 2025-12-31 14:54:39 UTC
Created attachment 266686 [details]
Elasticsearch 8.19.9
Comment 16 wolfgang 2026-01-20 09:50:42 UTC
This PR is now 6 month old and has seen 18 iterations, but is still in state "New". Is there anything we can do to get this forward? Maintainer is the elastic list, but I don't know if there is anyone with available time on that list.
Comment 17 Saro 2026-01-20 12:54:14 UTC
(In reply to wolfgang from comment #16)

I imagine part of the issue is that the port relies on source code modifications to function, requiring extensive review by a maintainer with Java experience. It's also the fact that the code is hosted on a third-party repository, raising trust issues. I've done my best to make the process as transparent as possible (e.g. binaries are built by GitHub Actions). If a trusted maintainer can host a fork of the repository, I'd be more than happy to cooperate and cede control of the distribution.

Alternatively, we can create a traditional port that downloads the code, patches and builds Elasticsearch natively on the host. It's going to be a little bit complex, but I think it's doable.
Comment 18 Kurt Jaeger freebsd_committer freebsd_triage 2026-01-20 15:47:25 UTC
(In reply to Saro from comment #17)
testbuild on 15.0 amd64 has some plist issues ? Did I do something wrong ?

https://people.freebsd.org/~pi/logs/elasticsearch8-15.txt
Comment 19 Saro 2026-01-20 19:25:12 UTC
(In reply to Kurt Jaeger from comment #18)

Not at all; I didn't update the PLIST (my mistake!). I will attach a new patch file along with an update to 8.19.10.


I'll be sure to use `make check-plist` going forward.
Comment 20 Saro 2026-01-20 19:25:46 UTC
Created attachment 267337 [details]
Elasticsearch 8.19.10
Comment 21 Saro 2026-01-20 19:31:06 UTC
Created attachment 267338 [details]
Elasticsearch 8.19.10

My apologies, I included an extra 'Makefile.build' file in the previous patch.
Comment 22 Kurt Jaeger freebsd_committer freebsd_triage 2026-01-20 20:50:46 UTC
(In reply to Saro from comment #17)
Thanks for explaining those two issues. I asked portmgr if they want to comment on this.

In other news, the 8.19.10 patch builds on 16/15/14.3/13.5 amd64.
Comment 23 Kurt Jaeger freebsd_committer freebsd_triage 2026-01-24 15:47:10 UTC
(In reply to Saro from comment #17)
It looks more sensible to do a real port with the sources from upstream instead of using a 3rd party repo. Can you give it a try ?
Comment 24 Saro 2026-01-24 17:44:52 UTC
(In reply to Kurt Jaeger from comment #23)

Sure! I've already started writing/testing this type of build. I found an existing port that leverages gradle as a reference, so it's not that involving as I initially thought.

Question: do I also include the test sources in the patch? I think it's a good idea; I'm just wondering if it's the norm.
Comment 25 Saro 2026-02-05 19:34:54 UTC
Created attachment 267828 [details]
Elasticsearch 8.19.11

As requested, here is the port to build Elasticsearch 8.19.11 by pulling in the upstream sources and applying the necessary patches without having to rely on a third-party repo. Building ES takes approximately 6 minutes on an i7-6700 with 16 GB of RAM. As a bonus, I have also included the ability to build the Elasticsearch vector library (libvec.so) for a performance boost.

Once my changes are reviewed & approved, I will begin porting 9.1, 9.2 and the newly released 9.3 branch in the same method.
Comment 26 Kurt Jaeger freebsd_committer freebsd_triage 2026-02-16 14:09:38 UTC
testbuilds for native build@work
Comment 27 Kurt Jaeger freebsd_committer freebsd_triage 2026-02-16 14:15:14 UTC
(In reply to Kurt Jaeger from comment #26)

Ups:

textproc/elasticsearch8 depends on nonexistent origin 'java/openjdk19' (port EXPIRED: 2026-02-14 Has expired: No longer supported by upstream); Please contact maintainer of the port to fix this.
Comment 28 Kurt Jaeger freebsd_committer freebsd_triage 2026-02-16 17:33:57 UTC
(In reply to Kurt Jaeger from comment #27)
I removed it from the list, then build fails with:

* Where:
Settings file '/wrkdirs/usr/ports/textproc/elasticsearch8/work/elasticsearch-8.19.11/build-conventions/settings.gradle' line: 11

* What went wrong:
Plugin [id: 'com.gradle.develocity', version: '4.2.2'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2.2')
  Searched in the following repositories:
    Gradle Central Plugin Repository
Comment 29 Kurt Jaeger freebsd_committer freebsd_triage 2026-02-16 17:34:46 UTC
(In reply to Kurt Jaeger from comment #28)
where 'it' means jdk19...
Comment 30 Saro 2026-02-16 18:44:48 UTC
(In reply to Kurt Jaeger from comment #27)

Well that's just great... :|

I've briefly looked into ways of bypassing the requirement of having several JDKs to no avail. I'll research a bit more and see if there is a gradle parameter or anything else that can help.

I'm wondering if the newer versions of ES (9.1/9.2/9.3) will work without JDK19 being present.
Comment 31 Saro 2026-02-18 22:02:31 UTC
(In reply to Kurt Jaeger from comment #29)

I managed to remove the JDK 19 dependency by modifying the source code -- stuff that is irrelevant if our runtime is Java 21+. However, Elastic recently pushed changes that completely replaces the Entitlement module in the upcoming 8.19.12, so my fixes are basically scrap. Furthermore, JDK 20|22|23 will expire in the Ports tree on 2025-03|04|05-12 respectively.

See: https://github.com/elastic/elasticsearch/pull/142326
and: https://github.com/elastic/elasticsearch/pull/141783

I'm fairly optimistic we can avoid having to install outdated JDKs entirely. Updates to follow.
Comment 32 Saro 2026-03-06 17:51:54 UTC
Created attachment 268579 [details]
Elasticsearch 8.19.12

Installing deprecated JDKs are no longer necessary with this port.
Comment 33 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-06 20:19:50 UTC
(In reply to Saro from comment #32)
testbuilds@work
Comment 34 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-07 09:00:26 UTC
(In reply to Kurt Jaeger from comment #33)
Testbuild logs are here:
https://people.freebsd.org/~pi/logs/elasticsearch8/

It seems all of them failed using poudriere, here:

* What went wrong:
Plugin [id: 'com.gradle.develocity', version: '4.2.2'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Included Builds (No included builds contain this plugin)
- Plugin Repositories (could not resolve plugin artifact 'com.gradle.develocity:com.gradle.develocity.gradle.plugin:4.2.2')
  Searched in the following repositories:
    Gradle Central Plugin Repository

Any idea what went wrong ?
Comment 35 Saro 2026-03-07 14:03:27 UTC
(In reply to Kurt Jaeger from comment #34)

Does your box have access to the internet? Elasticsearch downloads a ton of stuff from remote repositories before it starts building. I'll run a test build using poudriere as well to see what's going on.
Comment 36 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-07 14:40:16 UTC
(In reply to Saro from comment #35)
Yes. But: poudriere shuts down network access during build to avoid loading undocumented files during build. This is by design, so your port should list the required files in the DEPEND section and distinfo.
Comment 37 Saro 2026-03-07 14:51:18 UTC
(In reply to Kurt Jaeger from comment #36)

Noted. I will read the docs and follow-up. :)
Comment 38 Saro 2026-03-08 22:33:51 UTC
OK, I figured it out (thanks to yuri/acm's work on other similar ports using gradle) but things get a bit more involving now.

The problem is there's no way of adding the several dozen (or hundred?) dependencies to distinfo. The workaround is to bundle the deps into a tarball and host them on another site for later retrieval. The port will then download the deps.tar.gz and extract them into a temp folder for gradle to use offline.

Docs: https://docs.freebsd.org/en/books/porters-handbook/book/#slow-sources

| "The distfile must be placed into ~/public_distfiles/ of someone’s freefall account. Ask the person who commits the port to do this. This person will also set MASTER_SITES to LOCAL/username where username is their FreeBSD cluster login."

Similar ports with this method ("DEV_UPDATE_MODE"):
https://github.com/freebsd/freebsd-ports/blob/main/biology/gatk/Makefile
https://github.com/freebsd/freebsd-ports/blob/main/security/zaproxy/Makefile

I'll upload a new patch after I run the build process through poudriere.
Comment 39 Saro 2026-03-12 18:24:42 UTC
Created attachment 268752 [details]
Elasticsearch 8.19.12

Poudriere has successfully built Elasticsearch 8.19.12 offline.

This port requires additional work before committing and/or running through poudriere. It requires the committer to rebuild the dependencies archive and upload it to their "freefall" account. The steps to do this are written in the Makefile for future reference.

# To rebuild the deps archive:
#   1. Set DEV_UPDATE_MODE=yes
#   2. make makesum build
#   3. Upload the *-deps archive
#   4. Set DEV_UPDATE_MODE=no
#   5. make clean makesum

The committer also needs to update the MASTER_SITES+= by replacing `unknown` with their username.
Comment 40 Vladimir Druzenko freebsd_committer freebsd_triage 2026-03-12 23:48:39 UTC
With all due respect to the work done, I don't like such drastic changes...
Could you tell me which comment describes why the current method is bad and why it's necessary to switch to the source code from GitHub?
Comment 41 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-13 07:29:51 UTC
(In reply to Saro from comment #39)
uploading elasticsearch-8.19.12-deps.tar.gz right now...
Comment 42 Saro 2026-03-13 10:55:20 UTC
(In reply to Vladimir Druzenko from comment #40)

There's no comment per se; the GitHub repository (portsbuild/elasticsearch) is considered third-party and as such, cannot be easily trusted since it's under the control of someone else (me). While I've done my best to make everything transparent, I personally wouldn't want to download binaries from sources other than official or trusted.

Unfortunately the ports framework is not able to handle gradle dependencies like it does with Cargo crates or go modules. The method we have switched to now is used by other ports that build with gradle, so it seems to be the only viable solution for the time being. It's the only way to build locally and offline when using poudriere.

I am still open to the idea of a trusted committer forking the repository for distribution if that improves the situation.
Comment 43 Saro 2026-03-14 18:19:08 UTC
Last night, I realized my reply above may have given the wrong impression or message. My point was to highlight the fact people need to be aware of the port's origin, and perhaps this was a factor of not accepting my work in the first place (which is understandable). I'm also inferring this based on Kurt's comment to create a traditional port, which honestly is the right approach from a security standpoint.

To be clear, I don't mind hosting the project and being responsible of the distribution. I just don't know what the policy is with the ports tree, but I trust port maintainers/committers have sound judgement in these types of situations.

Now that is out of the way, some bad news: we may have no choice but to go with an external building process. My modifications (re: removing code referencing deprecated JDKs) unknowingly nerfed support for running ES on JDK 25. This applies for both 8.19 and 9.x branches. There is no way around this.

This leaves us with the following possible options to get this port finally committed:

1. Reinstate the deprecated JDK ports by begging portmgr. This solves our dilemma, but is unlikely to happen.

2. Modify the port Makefile to download/bootstrap the missing JDKs as part of the ES build process. This will add another layer of complexity, not to mention longer build times. I honestly don't want to do this.

3. Have another host/service (e.g. GitHub Actions) build the distribution. This is the simplest solution, and avoids having to upload dependencies separately, thus removing the additional burden on committers.

This leads me to propose a solution to may satisfy the trust requirement with option #3:

If I modify the GitHub Action to announce a SHA256 checksum after building the distribution and before uploading the release artifact, is that an acceptable form of verification? This allows the committer to triple check the release, from source code to the final tarball.

The workflow is here: https://github.com/portsbuild/elasticsearch/blob/freebsd/.github/workflows/gradle-package.yml

Logs: https://github.com/portsbuild/elasticsearch/actions

If anyone else has ideas, please do share as I feel like I've exhausted all possible options. Apologies for the long wall of text.
Comment 44 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-14 20:01:05 UTC
(In reply to Vladimir Druzenko from comment #40)
Comment 23, that was my comment. Basically, what the updated port was doing initially was to build parts 'somewhere', made those parts available on a non-elastic-site available to be used in a port build. This is not really a secure and verifiable approach.

The general idea of the ports tree is to use the distfiles of upstream and build from scratch. It looks like the concepts and implementation of some build systems does not really support this any more. In this case, GRADLE tries to fetch a huge list of files (3000+?), build some stuff out of it, and let it be used by the final build. The details look very complex, and this ticket system has not enough disk space to fully discuss this 8-} (*irony*)

The submitter of the current patches did some marvelous work, and I'm currently testing this.

I made the deps now available at:

http://distcache.FreeBSD.org/local-distfiles/pi/elasticsearch/elasticsearch-8.19.12-deps.tar.gz

but it probably takes a while for them to become available.
Comment 45 Kurt Jaeger freebsd_committer freebsd_triage 2026-03-14 20:03:37 UTC
(In reply to Saro from comment #43)
Thank you for your work! You wrote:

> My modifications (re: removing code referencing deprecated JDKs) unknowingly 
> nerfed support for running ES on JDK 25. This applies for both 8.19 and 9.x
> branches. There is no way around this.

Can you explain this in more detail ? Why did it nerf support for ES on jdk25 ?
Why is there no way around it ?
Comment 46 Saro 2026-03-15 02:28:55 UTC
(In reply to Kurt Jaeger from comment #45)

Sure, I'll do my best to explain:

In modern Java, you can have your app utilize new Java features (APIs) without having to change the runtime JRE (or existing code for that matter).

Let's say your app uses JDK 17 right now, but there are features available in JDK 19 that you want to use. Instead of bumping the minimum runtime to 17 and forcing your users to upgrade, you can stay backward compliant by simply making your project Multi-Release JAR (MRJAR) capable. You do this by creating separate source folder(s) in your project directory: src/main is the default runtime (17) while code in src/main19 makes use of APIs in JDK 19, and src/main22 will be for JDK 22, etc.

Now if someone runs your app with JDK 17, everything works like before. If they switch over to JDK 22, the app will make use of newer APIs and features without having to recompile.

Elastic makes *heavy* use of MRJAR, and the "problematic" code in question is related to Java Native Access (JNA) functionality, which is ironically the reason why I started porting ES to FreeBSD in the first place.

If you check the recent Makefile I submitted (re: post-patch) you will notice a few src folders being removed, namely:

libs/native/src/main20
libs/native/src/main22

If I am not mistaken, the last removal (main22) is the issue. Even though it says 22, the APIs in 25 remain unchanged, so removing the methods basically prevent ES starting on JDK 25. Without having JDK 22 to compile the src/main22 folder, the classes are unavailable during execution.

I briefly considered renaming main22 to main25 as a workaround, but this is something I do not feel comfortable doing, especially in such a sophisticated piece of software that is used to store massive amounts of data.

More importantly, we need to figure out a solution for the long-term. On Friday, I ported Elasticsearch 9.3.1 so it builds via poudriere + offline, but it refuses to start on both JDK 21 and 25. Without having access to JDK 19/20/22/23 on the host, we are unable to properly compile Elasticsearch on FreeBSD. IMHO older JDKs are still relevant even if they were EOL'ed upstream (developers still need them!). If there is a formal process to have them reinstated, it's something to consider.

Further reading if you're interested:
- https://www.baeldung.com/java-multi-release-jar
- https://openjdk.org/jeps/238
Comment 47 Saro 2026-09-08 21:10:55 UTC
Created attachment 274561 [details]
Elasticsearch 8.19.20

:)

All tests (except 2, see below) have passed: https://github.com/portsbuild/elasticsearch/actions/runs/33906037094

The only 2 tests that have failed (now temporarily disabled) are:
- testSetMaximumNumberOfThreads: /proc/self/rlimit is not reliable.
- testTimeoutPerConnection: a very flaky test.

The test suite is now included with this Port. Note that it can't be run as root and requires an additional step or two to get it running (see the GH workflow file, or feel free to ask).

I'll release 8.19.21 after reviewing & testing.
Comment 48 Saro 2026-09-08 21:16:34 UTC
As a quick reminder:

This port requires additional work before committing and/or running through poudriere. It requires the committer to rebuild the dependencies archive and upload it to their "freefall" account. The steps to do this are written in the Makefile for future reference.

# To rebuild the deps archive:
#   1. Set DEV_UPDATE_MODE=yes
#   2. make makesum build
#   3. Upload the *-deps archive
#   4. Set DEV_UPDATE_MODE=no
#   5. make clean makesum

The committer also needs to update the MASTER_SITES+= by replacing `unknown` with their username.
Comment 49 Saro 2026-09-10 19:20:17 UTC
Created attachment 274607 [details]
Elasticsearch 8.19.20

Minor fix to include a missing patch, and defaulted DEV_UPDATE_MODE=no.

Side note: 8.19.21 is ready, but it requires Gradle >= 9.7.1. I filed a report at bug #298375.
Comment 50 Saro 2026-09-10 19:23:19 UTC
Created attachment 274608 [details]
Elasticsearch 8.19.20

Sigh. Let's try this again (missed the latter part of the fix...).

Apologies for the noise.
Comment 51 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 15:24:26 UTC
(In reply to Saro from comment #50)
Buidl fails in poudriere:

> Task :x-pack:plugin:ml:extractNativeLicenses

> Task :libs:native:native-libraries:buildLibVec FAILED
Downloading https://services.gradle.org/distributions/gradle-9.6.1-all.zip

Exception in thread "main" java.net.UnknownHostException: services.gradle.org
        at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:569)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:284)
        at java.base/java.net.Socket.connect(Socket.java:659)
        at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:304)
        at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:161)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:516)
        at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:604)
        at java.base/sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:207)
        at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:289)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:196)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:963)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:899)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:872)
        at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:181)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1377)
        at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1302)
        at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223)
        at org.gradle.wrapper.Install.forceFetch(SourceFile:2)
        at org.gradle.wrapper.Install$1.call(SourceFile:8)
        at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:67)
Comment 52 Palle Girgensohn freebsd_committer freebsd_triage 2026-09-24 15:30:17 UTC
(In reply to Vladimir Druzenko from comment #51)
you must prefetch the artefacts, but guess you realise that?

java.net.UnknownHostException: services.gradle.org

happens since the build process is not allowed net access, as it should be.
Comment 53 Saro 2026-09-24 15:36:34 UTC
Created attachment 275075 [details]
Elasticsearch 8.19.20_3

(In reply to Vladimir Druzenko from comment #51)

My bad, please try this patch (I was using the wrong 'gradle' binary). AFAIK, you don't have to rebuild the DEPS archive.
Comment 54 Saro 2026-09-24 15:39:05 UTC
(In reply to Palle Girgensohn from comment #52)

Yep, I forgot to change the 'gradle' binary to use when building `libvec.so`. I'm maintaining two sets of patches on my side for this port (per version) so I got them mixed up. :|
Comment 55 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 15:48:34 UTC
(In reply to Saro from comment #54)
After some research I did exact the same change and run poudriere testport already. :-D
Comment 56 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 15:56:15 UTC
(In reply to Palle Girgensohn from comment #52)
I know the cause of this error. I am simply reporting it.
Comment 57 Palle Girgensohn freebsd_committer freebsd_triage 2026-09-24 16:12:51 UTC
(In reply to Vladimir Druzenko from comment #56)
Excellent, I expected as much. :-D
Comment 58 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 19:57:19 UTC
Silent grab gcc if installed:

====> Running Q/A tests (stage-qa)
Error: /usr/local/lib/libvec.so is linked to /usr/local/lib/gcc15/libstdc++.so.6 from lang/gcc15 but it is not declared as a dependency
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
===> No pkg-plist issues found (check-plist)
====> Running Q/A tests (stage-qa)
Comment 59 Saro 2026-09-24 20:26:24 UTC
(In reply to Vladimir Druzenko from comment #58)

I believe this is happening because gcc is listed above clang in the toolchains configuration (libs/simdvec/native/build.gradle:48). We can move the `clang(Clang)` block above the `gcc(Gcc)` one in toolchains() to prioritize the former.

Are you able to try this? I ask because I'm leaving the office soon and taking 2 weeks off. :) If not, I have a 13 hour flight ahead of me, perhaps I can give it a try.

FYI, this is only present in ES 8.19 and no longer an issue in later versions as Elastic has migrated to a more modern approach to building native libraries.
Comment 60 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 20:30:32 UTC
(In reply to Saro from comment #59)
Already tried without success.
Move Clang to 1st place - still uses Gcc. Remove definition of the Gcc in toolChains - still uses gcc, but build fails without "-march=core-avx2".
Comment 61 Saro 2026-09-24 20:48:38 UTC
(In reply to Vladimir Druzenko from comment #60)

That's very strange. On my test builds, I was able to build `libvec.so` without GCC being present (fresh installs too). A quick workaround is to drop `c++17-lang` and replace it with `gcc14` in the Makefile. I used to test/benchmark libvec.so with gcc13, so there are no issues there.
Comment 62 Vladimir Druzenko freebsd_committer freebsd_triage 2026-09-24 20:55:58 UTC
It builds with gcc if gcc installed. If gcc is not installed - it build with system clang without errors.
But I want to build with clang if gcc installed too.
Comment 63 Vladimir Druzenko freebsd_committer freebsd_triage 2026-10-26 21:24:28 UTC
Friendly ping.
Comment 64 Saro 2026-10-27 14:32:59 UTC
(In reply to Vladimir Druzenko from comment #63)

I've been meaning to follow-up. :)

I want this port to be released, so I will suggest we omit including vector library (libvec.so) support for the time being. It's optional and isn't a hard requirement to get ES working. The only drawback is reduced performance when it comes to vector-based search operations.

Note that in later ES versions (e.g. 9.4, 9.5), building libvec.so is much simpler. I can probably back-port the build process to 8.19, but I don't think this is important right now.

I will submit a 8.19.23 patch file without libvec shortly.

Also, I have 9.4 and 9.5 ready to be ported. Here are all the test results:

8.19.23: https://github.com/portsbuild/elasticsearch/actions/runs/39297466394/job/118885622967

9.4.8: https://github.com/portsbuild/elasticsearch/actions/runs/39615138282/job/119274043461

9.5.5: https://github.com/portsbuild/elasticsearch/actions/runs/40385486909/job/121792515335
Comment 65 Saro 2026-10-27 20:47:20 UTC
Created attachment 276577 [details]
Elasticsearch 8.19.23
Comment 66 Vladimir Druzenko freebsd_committer freebsd_triage 2026-10-30 23:04:25 UTC
(In reply to Saro from comment #65)
Are you sure there are no errors when running "make patch"?
Also, I'd like to ask that you not shorten filenames in the patches.
Comment 67 Saro 2026-10-30 23:35:20 UTC
(In reply to Vladimir Druzenko from comment #66)

No issues; ran it through Poudriere too. Is something wrong?

I shorten the patch filenames because portlint kept complaining about them being more than 100 characters long. I asked about this in the Discord #ports channel not long ago if this was still relevant. Someone said there might be tar header limitations, so I decided to play it safe and kept shortening. If this is not the case, I'll go back to original names.
Comment 68 Vladimir Druzenko freebsd_committer freebsd_triage 2026-10-31 15:54:35 UTC
(In reply to Saro from comment #67)
Issues sometimes arise with shorten filenames in the patches when running "make makepatch".
Comment 69 Vladimir Druzenko freebsd_committer freebsd_triage 2026-10-31 16:05:34 UTC
(In reply to Saro from comment #67)
===>  Applying FreeBSD patches for elasticsearch8-8.19.23 from /usr/ports/textproc/elasticsearch8/files
1 out of 2 hunks failed--saving rejects to build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/info/ParallelDetector.java.rej
===>  FAILED Applying FreeBSD patch-build-conventions_src_main_java_org_elasticsearch_gradle_internal_conventions_info_PD.java
===> FAILED to apply cleanly FreeBSD patch(es)  patch-build-conventions_src_main_java_org_elasticsearch_gradle_internal_conventions_info_PD.java
*** Error code 1
Comment 70 Vladimir Druzenko freebsd_committer freebsd_triage 2026-10-31 16:10:30 UTC
Created attachment 276828 [details]
v1

Please use my Makefile as base.

Additional changes added after your patch was applied:

diff --git a/textproc/elasticsearch8/files/branches.json b/textproc/elasticsearch8/files/branches.json
index 8cd767fb575a..745d1ad4aceb 100644
--- a/textproc/elasticsearch8/files/branches.json
+++ b/textproc/elasticsearch8/files/branches.json
@@ -18,4 +18,4 @@
       "version" : "8.19.23"
     }
   ]
-}
\ No newline at end of file
+}
diff --git a/textproc/elasticsearch8/files/patch-distribution_archives_freebsd-tar_build.gradle b/textproc/elasticsearch8/files/patch-distribution_archives_freebsd-tar_build.gradle
index 74840d44df34..7dc99d2a8c38 100644
--- a/textproc/elasticsearch8/files/patch-distribution_archives_freebsd-tar_build.gradle
+++ b/textproc/elasticsearch8/files/patch-distribution_archives_freebsd-tar_build.gradle
@@ -3,4 +3,3 @@
 @@ -0,0 +1,2 @@
 +// This file is intentionally blank. All configuration of the
 +// distribution is done in the parent project.
-\ No newline at end of file
diff --git a/textproc/elasticsearch8/files/patch-distribution_src_bin_elasticsearch-env b/textproc/elasticsearch8/files/patch-distribution_src_bin_elasticsearch-env
index c61030024ce9..d1ca5c9c013b 100644
--- a/textproc/elasticsearch8/files/patch-distribution_src_bin_elasticsearch-env
+++ b/textproc/elasticsearch8/files/patch-distribution_src_bin_elasticsearch-env
@@ -1,11 +1,5 @@
 --- distribution/src/bin/elasticsearch-env.orig        2026-08-26 20:47:40 UTC
 +++ distribution/src/bin/elasticsearch-env
-@@ -1,4 +1,4 @@
--#!/bin/bash
-+#!/usr/bin/env bash
-
- set -e -o pipefail
-
 @@ -49,6 +49,9 @@ else
    if [ "$(uname -s)" = "Darwin" ]; then
      # macOS has a different structure
diff --git a/textproc/elasticsearch8/files/patch-libs_native_libraries_build.gradle b/textproc/elasticsearch8/files/patch-libs_native_libraries_build.gradle
index f3729b28cd4d..30c1b0c89e33 100644
--- a/textproc/elasticsearch8/files/patch-libs_native_libraries_build.gradle
+++ b/textproc/elasticsearch8/files/patch-libs_native_libraries_build.gradle
@@ -47,7 +47,7 @@
 -    unix("755")
 +  if (System.getProperty("os.name", "").startsWith("FreeBSD")) {
 +    into layout.buildDirectory.dir('platform')
-+    from('/usr/local/lib') {
++    from('%%LOCALBASE%%/lib') {
 +      include 'libzstd.so'
 +      into 'freebsd-x64'
 +    }
diff --git a/textproc/elasticsearch8/files/patch-qa_packaging_src_test_java_org_elasticsearch_packaging_util_Cleanup.java b/textproc/elasticsearch8/files/patch-qa_packaging_src_test_java_org_elasticsearch_packaging_util_Cleanup.java
index 076d407f8e4e..c3d10699c87f 100644
--- a/textproc/elasticsearch8/files/patch-qa_packaging_src_test_java_org_elasticsearch_packaging_util_Cleanup.java
+++ b/textproc/elasticsearch8/files/patch-qa_packaging_src_test_java_org_elasticsearch_packaging_util_Cleanup.java
@@ -5,16 +5,16 @@
      );

 +    private static final List<String> ELASTICSEARCH_FILES_FREEBSD = Arrays.asList(
-+        "/usr/local/share/elasticsearch",
-+        "/usr/local/etc/elasticsearch/elasticsearch.keystore",
-+        "/usr/local/etc/elasticsearch",
-+        "/usr/local/lib/elasticsearch",
-+        "/usr/local/libexec/elasticsearch",
++        "%%DATADIR%%",
++        "%%ETCDIR%%/elasticsearch.keystore",
++        "%%ETCDIR%",
++        "%%PREFIX%%/lib/elasticsearch",
++        "%%PREFIX%%/libexec/elasticsearch",
 +        "/var/log/elasticsearch",
 +        "/var/run/elasticsearch",
 +        "/var/db/elasticsearch",
-+        "/usr/local/share/doc/elasticsearch",
-+        "/usr/local/etc/rc.d/elasticsearch"
++        "%%DOCSDIR%%",
++        "%%PREFIX%%/etc/rc.d/elasticsearch"
 +    );
 +
      // todo
Comment 71 Saro 2026-11-02 19:32:01 UTC
(In reply to Vladimir Druzenko from comment #70)

No problem using the revised Makefile as a base along with the patch changes. However, I noticed that java/openjdk25 was removed from BUILD_DEPENDS. Is this because JAVA_VERSION=25 will implicitly add it as a dependency?

I also noticed you re-added `do-build-LIBVEC-on` but the OPTIONS are missing along with the other actions to enable/disable it in jvm.options. :)

Side note: this ES release builds libvec.so regardless of the setting in the Ports Makefile, but does not copy it to /usr/local/lib. This task was written to facilitate testing ES on FreeBSD, and will be modified in the next release to only build when explicitly enabled.
Comment 72 Vladimir Druzenko freebsd_committer freebsd_triage 2026-11-03 00:59:56 UTC
(In reply to Saro from comment #71)
1. Yes JAVA_VERSION=25 adds java/openjdk25 in run and build deps.
2. Forgot to remove "2" lines. :-)
3. If I missed something in jvm.options - please just fix this.
Comment 73 Saro 2026-11-04 14:11:40 UTC
Created attachment 276973 [details]
Elasticsearch 8.19.24
Comment 74 commit-hook freebsd_committer freebsd_triage 2026-11-04 18:04:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=af554253eb2d9785af4519d0edad9985936006f3

commit af554253eb2d9785af4519d0edad9985936006f3
Author:     Saro <saro@saromedia.com>
AuthorDate: 2026-11-04 17:51:33 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-11-04 18:02:50 +0000

    textproc/elasticsearch8: Update 8.11.3 => 8.19.24

    Changelogs (71 new versions):
    https://www.elastic.co/guide/en/elasticsearch/reference/8.19/es-release-notes.html

    PR:             288653
    Approved by:    elastic (maintainer, inactive)
    Sponsored by:   UNIS Labs (vvd)
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
    MFH:            2026Q4

 textproc/elasticsearch8/Makefile                   | 230 +++++++++++++++------
 textproc/elasticsearch8/distinfo                   |   8 +-
 textproc/elasticsearch8/files/branches.json (new)  |  25 +++
 textproc/elasticsearch8/files/elasticsearch.in     |  61 +++---
 .../files/patch-bin_elasticsearch-env (gone)       |  26 ---
 ...al_conventions_info_ParallelDetector.java (new) |  30 +++
 ...info_GlobalBuildInfoPluginFuncTest.groovy (new) | 207 +++++++++++++++++++
 ...rg_elasticsearch_gradle_internal_Jdk.java (new) |  11 +
 ...icsearch_gradle_internal_MrjarPlugin.java (new) |  55 +++++
 ...nal_distribution_BundledJdkPlatforms.java (new) |  10 +
 ..._internal_info_GlobalBuildInfoPlugin.java (new) |  73 +++++++
 ..._AbstractCustomJavaToolchainResolver.java (new) |  10 +
 ...chain_OracleOpenJdkToolchainResolver.java (new) |  12 ++
 ...earch_gradle_internal_util_HttpUtils.java (new) |  63 ++++++
 ...gradle_internal_util_HttpUtilsSpec.groovy (new) |  93 +++++++++
 ...rch_gradle_ElasticsearchDistribution.java (new) |  20 ++
 ...ain_java_org_elasticsearch_gradle_OS.java (new) |  38 ++++
 ...xtures_DistributionDownloadFixture.groovy (new) |  12 ++
 .../elasticsearch8/files/patch-build.gradle (new)  |  22 ++
 .../files/patch-config_elasticsearch.yml (gone)    |  23 ---
 .../files/patch-config_jvm.options (gone)          |  12 --
 .../patch-distribution_archives_build.gradle (new) |  25 +++
 ...ibution_archives_freebsd-tar_build.gradle (new) |   5 +
 .../files/patch-distribution_build.gradle (new)    |  29 +++
 ...ch-distribution_src_bin_elasticsearch-env (new) |  12 ++
 ...patch-gradle_gradle-daemon-jvm.properties (new) |  13 ++
 ..._java_org_elasticsearch_core_IOUtils.java (new) |  19 ++
 ...ment_bootstrap_HardcodedEntitlements.java (new) |  22 ++
 ...lement_runtime_policy_FileAccessTree.java (new) |  11 +
 ..._entitlement_runtime_policy_Platform.java (new) |  21 ++
 ...policy_entitlements_FilesEntitlement.java (new) |  14 ++
 ..._nativeaccess_jna_JnaFreebsdCLibrary.java (new) |  44 ++++
 ...eaccess_jna_JnaNativeLibraryProvider.java (new) |  19 ++
 ...ch_nativeaccess_jna_JnaPosixCLibrary.java (new) |  20 ++
 .../patch-libs_native_libraries_build.gradle (new) |  91 ++++++++
 ..._nativeaccess_jdk_JdkFreebsdCLibrary.java (new) |  42 ++++
 ...eaccess_jdk_JdkNativeLibraryProvider.java (new) |  19 ++
 ...ch_nativeaccess_jdk_JdkPosixCLibrary.java (new) |  16 ++
 ...rch_nativeaccess_FreebsdNativeAccess.java (new) |  74 +++++++
 ...arch_nativeaccess_NativeAccessHolder.java (new) |  11 +
 ...earch_nativeaccess_PosixNativeAccess.java (new) |  42 ++++
 ...rch_nativeaccess_lib_FreebsdCLibrary.java (new) |  18 ++
 ...search_nativeaccess_lib_LoaderHelper.java (new) |  11 +
 ...earch_nativeaccess_lib_NativeLibrary.java (new) |   8 +
 ...search_nativeaccess_PreallocateTests.java (new) |  34 +++
 ...arch_nativeaccess_ProcessLimitsTests.java (new) |  61 ++++++
 ...ccess_VectorSimilarityFunctionsTests.java (new) |  11 +
 .../patch-libs_simdvec_native_build.gradle (new)   |  27 +++
 ..._gradle_wrapper_gradle-wrapper.properties (new) |  10 +
 ...earch_simdvec_AbstractVectorTestCase.java (new) |  11 +
 ...ttp_netty4_Netty4HttpServerTransport.java (new) |  11 +
 ...earch_transport_netty4_NetUtilsTests.java (new) |  11 +
 ...rt_netty4_SimpleNetty4TransportTests.java (new) |  25 +++
 .../patch-plugins_examples_settings.gradle (new)   |  11 +
 ...ch_bootstrap_SpawnerNoBootstrapTests.java (new) |  11 +
 ...icsearch_packaging_test_ArchiveTests.java (new) | 135 ++++++++++++
 ...ch_packaging_test_ConfigurationTests.java (new) |  10 +
 ...ckaging_test_KeystoreManagementTests.java (new) |  10 +
 ...rch_packaging_test_PackagingTestCase.java (new) |  19 ++
 ...search_packaging_test_PluginCliTests.java (new) |  10 +
 ...lasticsearch_packaging_util_Archives.java (new) |  37 ++++
 ...elasticsearch_packaging_util_Cleanup.java (new) |  88 ++++++++
 ...icsearch_packaging_util_Distribution.java (new) |  34 +++
 ...asticsearch_packaging_util_Platforms.java (new) |  23 +++
 ...g_elasticsearch_packaging_util_Shell.java (new) |  18 ++
 ...sticsearch_bootstrap_BootstrapChecks.java (new) |  15 ++
 ...org_elasticsearch_monitor_os_OsProbe.java (new) |  11 +
 ...g_elasticsearch_plugins_PluginsTests.java (new) |  10 +
 .../files/patch-settings.gradle (new)              |  10 +
 ...g_elasticsearch_test_cluster_util_OS.java (new) |  38 ++++
 ...asticsearch_xpack_core_XPackSettings.java (new) |  17 ++
 textproc/elasticsearch8/files/pkg-message.in       |  46 +++--
 textproc/elasticsearch8/files/public.key (new)     | Bin 0 -> 513 bytes
 73 files changed, 2199 insertions(+), 182 deletions(-)
Comment 75 commit-hook freebsd_committer freebsd_triage 2026-11-04 18:05:07 UTC
A commit in branch 2026Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=55214b73cc5d6b1aaa4fc7289e805b9914a463d6

commit 55214b73cc5d6b1aaa4fc7289e805b9914a463d6
Author:     Saro <saro@saromedia.com>
AuthorDate: 2026-11-04 17:51:33 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-11-04 18:03:55 +0000

    textproc/elasticsearch8: Update 8.11.3 => 8.19.24

    Changelogs (71 new versions):
    https://www.elastic.co/guide/en/elasticsearch/reference/8.19/es-release-notes.html

    PR:             288653
    Approved by:    elastic (maintainer, inactive)
    Sponsored by:   UNIS Labs (vvd)
    Co-authored-by: Vladimir Druzenko <vvd@FreeBSD.org>
    MFH:            2026Q4

    (cherry picked from commit af554253eb2d9785af4519d0edad9985936006f3)

 textproc/elasticsearch8/Makefile                   | 230 +++++++++++++++------
 textproc/elasticsearch8/distinfo                   |   8 +-
 textproc/elasticsearch8/files/branches.json (new)  |  25 +++
 textproc/elasticsearch8/files/elasticsearch.in     |  61 +++---
 .../files/patch-bin_elasticsearch-env (gone)       |  26 ---
 ...al_conventions_info_ParallelDetector.java (new) |  30 +++
 ...info_GlobalBuildInfoPluginFuncTest.groovy (new) | 207 +++++++++++++++++++
 ...rg_elasticsearch_gradle_internal_Jdk.java (new) |  11 +
 ...icsearch_gradle_internal_MrjarPlugin.java (new) |  55 +++++
 ...nal_distribution_BundledJdkPlatforms.java (new) |  10 +
 ..._internal_info_GlobalBuildInfoPlugin.java (new) |  73 +++++++
 ..._AbstractCustomJavaToolchainResolver.java (new) |  10 +
 ...chain_OracleOpenJdkToolchainResolver.java (new) |  12 ++
 ...earch_gradle_internal_util_HttpUtils.java (new) |  63 ++++++
 ...gradle_internal_util_HttpUtilsSpec.groovy (new) |  93 +++++++++
 ...rch_gradle_ElasticsearchDistribution.java (new) |  20 ++
 ...ain_java_org_elasticsearch_gradle_OS.java (new) |  38 ++++
 ...xtures_DistributionDownloadFixture.groovy (new) |  12 ++
 .../elasticsearch8/files/patch-build.gradle (new)  |  22 ++
 .../files/patch-config_elasticsearch.yml (gone)    |  23 ---
 .../files/patch-config_jvm.options (gone)          |  12 --
 .../patch-distribution_archives_build.gradle (new) |  25 +++
 ...ibution_archives_freebsd-tar_build.gradle (new) |   5 +
 .../files/patch-distribution_build.gradle (new)    |  29 +++
 ...ch-distribution_src_bin_elasticsearch-env (new) |  12 ++
 ...patch-gradle_gradle-daemon-jvm.properties (new) |  13 ++
 ..._java_org_elasticsearch_core_IOUtils.java (new) |  19 ++
 ...ment_bootstrap_HardcodedEntitlements.java (new) |  22 ++
 ...lement_runtime_policy_FileAccessTree.java (new) |  11 +
 ..._entitlement_runtime_policy_Platform.java (new) |  21 ++
 ...policy_entitlements_FilesEntitlement.java (new) |  14 ++
 ..._nativeaccess_jna_JnaFreebsdCLibrary.java (new) |  44 ++++
 ...eaccess_jna_JnaNativeLibraryProvider.java (new) |  19 ++
 ...ch_nativeaccess_jna_JnaPosixCLibrary.java (new) |  20 ++
 .../patch-libs_native_libraries_build.gradle (new) |  91 ++++++++
 ..._nativeaccess_jdk_JdkFreebsdCLibrary.java (new) |  42 ++++
 ...eaccess_jdk_JdkNativeLibraryProvider.java (new) |  19 ++
 ...ch_nativeaccess_jdk_JdkPosixCLibrary.java (new) |  16 ++
 ...rch_nativeaccess_FreebsdNativeAccess.java (new) |  74 +++++++
 ...arch_nativeaccess_NativeAccessHolder.java (new) |  11 +
 ...earch_nativeaccess_PosixNativeAccess.java (new) |  42 ++++
 ...rch_nativeaccess_lib_FreebsdCLibrary.java (new) |  18 ++
 ...search_nativeaccess_lib_LoaderHelper.java (new) |  11 +
 ...earch_nativeaccess_lib_NativeLibrary.java (new) |   8 +
 ...search_nativeaccess_PreallocateTests.java (new) |  34 +++
 ...arch_nativeaccess_ProcessLimitsTests.java (new) |  61 ++++++
 ...ccess_VectorSimilarityFunctionsTests.java (new) |  11 +
 .../patch-libs_simdvec_native_build.gradle (new)   |  27 +++
 ..._gradle_wrapper_gradle-wrapper.properties (new) |  10 +
 ...earch_simdvec_AbstractVectorTestCase.java (new) |  11 +
 ...ttp_netty4_Netty4HttpServerTransport.java (new) |  11 +
 ...earch_transport_netty4_NetUtilsTests.java (new) |  11 +
 ...rt_netty4_SimpleNetty4TransportTests.java (new) |  25 +++
 .../patch-plugins_examples_settings.gradle (new)   |  11 +
 ...ch_bootstrap_SpawnerNoBootstrapTests.java (new) |  11 +
 ...icsearch_packaging_test_ArchiveTests.java (new) | 135 ++++++++++++
 ...ch_packaging_test_ConfigurationTests.java (new) |  10 +
 ...ckaging_test_KeystoreManagementTests.java (new) |  10 +
 ...rch_packaging_test_PackagingTestCase.java (new) |  19 ++
 ...search_packaging_test_PluginCliTests.java (new) |  10 +
 ...lasticsearch_packaging_util_Archives.java (new) |  37 ++++
 ...elasticsearch_packaging_util_Cleanup.java (new) |  88 ++++++++
 ...icsearch_packaging_util_Distribution.java (new) |  34 +++
 ...asticsearch_packaging_util_Platforms.java (new) |  23 +++
 ...g_elasticsearch_packaging_util_Shell.java (new) |  18 ++
 ...sticsearch_bootstrap_BootstrapChecks.java (new) |  15 ++
 ...org_elasticsearch_monitor_os_OsProbe.java (new) |  11 +
 ...g_elasticsearch_plugins_PluginsTests.java (new) |  10 +
 .../files/patch-settings.gradle (new)              |  10 +
 ...g_elasticsearch_test_cluster_util_OS.java (new) |  38 ++++
 ...asticsearch_xpack_core_XPackSettings.java (new) |  17 ++
 textproc/elasticsearch8/files/pkg-message.in       |  46 +++--
 textproc/elasticsearch8/files/public.key (new)     | Bin 0 -> 513 bytes
 73 files changed, 2199 insertions(+), 182 deletions(-)
Comment 76 Vladimir Druzenko freebsd_committer freebsd_triage 2026-11-04 18:07:20 UTC
We did it! Thanks!

Let's add textproc/elasticsearch94 (9.4.9) and textproc/elasticsearch95 (9.5.6)!
Comment 77 Saro 2026-11-04 18:38:56 UTC
(In reply to Vladimir Druzenko from comment #76)

Amazing! Thank you as well for your time reviewing and testing!

I'll start porting 9.4.9 and 9.5.6 now. :) The code is tested and ready, just need to create the Makefile + patches.
Comment 78 linus.sundqvist 2026-11-05 07:29:50 UTC
Trying to build elasticsearch8-8.19.24 with poudriere (2026Q4) results in:

=======================<phase: fetch          >============================
===== env: NO_DEPENDS=yes USER=root UID=0 GID=0
=> elasticsearch-8.19.24-deps.tar.gz doesn't seem to exist in /portdistfiles.
=> Attempting to fetch http://distcache.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz
fetch: http://distcache.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz: Not Found
=> Attempting to fetch http://distcache.us-east.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz
fetch: http://distcache.us-east.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz: Not Found
=> Attempting to fetch http://distcache.eu.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz
fetch: http://distcache.eu.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz: Not Found
=> Attempting to fetch http://distcache.us-west.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz
fetch: http://distcache.us-west.FreeBSD.org/local-distfiles/vvd/elastic/elasticsearch/elasticsearch-8.19.24-deps.tar.gz: Not Found
=> Attempting to fetch http://distcache.FreeBSD.org/ports-distfiles/elasticsearch-8.19.24-deps.tar.gz
fetch: http://distcache.FreeBSD.org/ports-distfiles/elasticsearch-8.19.24-deps.tar.gz: Not Found
=> Couldn't fetch it - please try to retrieve this
=> port manually into /portdistfiles and try again.
*** Error code 1

Stop.
make: stopped making "fetch" in /usr/ports/textproc/elasticsearch8
=>> Cleaning up wrkdir
===>  Cleaning for elasticsearch8-8.19.24
build of textproc/elasticsearch8 | elasticsearch8-8.19.24 ended at Thu Nov  5 08:23:15 CET 2026
build time: 00:00:03
!!! build failure encountered !!!
Comment 79 Daniel 2026-11-05 10:56:45 UTC
Created attachment 277004 [details]
Build and Install libvec.so

(In reply to commit-hook from comment #74)
elasticsearch won't start without NativeAccess, aka libvec.so
Please always build and install it.
Comment 80 Saro 2026-11-05 11:46:07 UTC
(In reply to Daniel from comment #79)

If you are upgrading from 8.11.3, add the following lines to jvm.options:

-Des.nativelibs.path=/usr/local/lib
-Dorg.elasticsearch.nativeaccess.enableVectorLibrary=false
Comment 81 commit-hook freebsd_committer freebsd_triage 2026-11-05 13:03:05 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=abde9a63044975aa2d41da654e437c17196864e2

commit abde9a63044975aa2d41da654e437c17196864e2
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2026-11-05 12:57:33 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-11-05 13:02:15 +0000

    textproc/elasticsearch8: Fix path to distfiles in LOCAL

    While here fix whitespaces in one patch.

    PR:             288653
    Approved by:    blanket (fix fetch)
    Reported by:    linus.sundqvist@loopia.se
    Sponsored by:   UNIS Labs
    MFH:            2026Q4

 textproc/elasticsearch8/Makefile                                        | 2 +-
 ...elasticsearch_gradle_internal_conventions_info_ParallelDetector.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 82 commit-hook freebsd_committer freebsd_triage 2026-11-05 13:04:08 UTC
A commit in branch 2026Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0f36a5b5e2318ba10bc5859ed42f733d141cb49d

commit 0f36a5b5e2318ba10bc5859ed42f733d141cb49d
Author:     Vladimir Druzenko <vvd@FreeBSD.org>
AuthorDate: 2026-11-05 12:57:33 +0000
Commit:     Vladimir Druzenko <vvd@FreeBSD.org>
CommitDate: 2026-11-05 13:03:24 +0000

    textproc/elasticsearch8: Fix path to distfiles in LOCAL

    While here fix whitespaces in one patch.

    PR:             288653
    Approved by:    blanket (fix fetch)
    Reported by:    linus.sundqvist@loopia.se
    Sponsored by:   UNIS Labs
    MFH:            2026Q4

    (cherry picked from commit abde9a63044975aa2d41da654e437c17196864e2)

 textproc/elasticsearch8/Makefile                                        | 2 +-
 ...elasticsearch_gradle_internal_conventions_info_ParallelDetector.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)