From 4826e386286d9558d7ab93f323a37c0bba6c01aa Mon Sep 17 00:00:00 2001 From: David Turner Date: Thu, 11 Nov 2021 07:20:09 +0000 Subject: [PATCH] Upgrade JNA to 5.10.0 (#80617) This commit upgrades JNA to 5.10.0. The primary reason for this upgrade is to adopt a newer version of `libffi` which supports the `LIBFFI_TMPDIR` environment variable so that we can change the location of temporary executables and resolve #77014. This commit also switches to the upstream JNA releases rather than using the specially-repackaged ones we've used in the past. --- build-tools-internal/build.gradle | 2 +- build-tools-internal/version.properties | 3 +-- .../org/elasticsearch/gradle/plugin/PluginBuildPlugin.java | 2 +- server/build.gradle | 3 +-- server/licenses/jna-5.10.0.jar.sha1 | 1 + server/licenses/jna-5.7.0-1.jar.sha1 | 1 - x-pack/plugin/sql/qa/server/build.gradle | 4 ++-- x-pack/plugin/sql/sql-cli/build.gradle | 2 +- x-pack/plugin/sql/sql-cli/licenses/jna-5.10.0.jar.sha1 | 1 + x-pack/plugin/sql/sql-cli/licenses/jna-5.7.0-1.jar.sha1 | 1 - 10 files changed, 9 insertions(+), 11 deletions(-) create mode 100644 server/licenses/jna-5.10.0.jar.sha1 delete mode 100644 server/licenses/jna-5.7.0-1.jar.sha1 create mode 100644 x-pack/plugin/sql/sql-cli/licenses/jna-5.10.0.jar.sha1 delete mode 100644 x-pack/plugin/sql/sql-cli/licenses/jna-5.7.0-1.jar.sha1 diff --git a/build-tools-internal/build.gradle b/build-tools-internal/build.gradle index f4f4677a8a5e..4aa5eccf3f2e 100644 --- a/build-tools-internal/build.gradle +++ b/build-tools-internal/build.gradle @@ -211,7 +211,7 @@ dependencies { api 'com.netflix.nebula:gradle-extra-configurations-plugin:5.0.1' api 'com.netflix.nebula:gradle-info-plugin:9.2.0' api 'org.apache.rat:apache-rat:0.11' - api "org.elasticsearch:jna:5.7.0-1" + api "net.java.dev.jna:jna:${versions.getProperty('jna')}" api 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0' // for our ide tweaking api 'gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.7' diff --git a/build-tools-internal/version.properties b/build-tools-internal/version.properties index e03b4729eace..a1aa39b2b67d 100644 --- a/build-tools-internal/version.properties +++ b/build-tools-internal/version.properties @@ -18,8 +18,7 @@ log4j = 2.11.1 slf4j = 1.6.2 ecsLogging = 1.2.0 -# when updating the JNA version, also update the version in buildSrc/build.gradle -jna = 5.7.0-1 +jna = 5.10.0 netty = 4.1.66.Final diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java b/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java index 12c40c1da113..a41549015b9b 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/plugin/PluginBuildPlugin.java @@ -151,7 +151,7 @@ private static void configureDependencies(final Project project) { dependencies.add("compileOnly", "org.locationtech.jts:jts-core:" + VersionProperties.getVersions().get("jts")); dependencies.add("compileOnly", "org.apache.logging.log4j:log4j-api:" + VersionProperties.getVersions().get("log4j")); dependencies.add("compileOnly", "org.apache.logging.log4j:log4j-core:" + VersionProperties.getVersions().get("log4j")); - dependencies.add("compileOnly", "org.elasticsearch:jna:" + VersionProperties.getVersions().get("jna")); + dependencies.add("compileOnly", "net.java.dev.jna:jna:" + VersionProperties.getVersions().get("jna")); } /** diff --git a/server/build.gradle b/server/build.gradle index ec2942f19c88..0f9798c53f22 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -61,8 +61,7 @@ dependencies { api "org.apache.logging.log4j:log4j-api:${versions.log4j}" api "org.apache.logging.log4j:log4j-core:${versions.log4j}", optional - // repackaged jna with native bits linked against all elastic supported platforms - api "org.elasticsearch:jna:${versions.jna}" + api "net.java.dev.jna:jna:${versions.jna}" api "co.elastic.logging:log4j2-ecs-layout:${versions.ecsLogging}" api "co.elastic.logging:ecs-logging-core:${versions.ecsLogging}" diff --git a/server/licenses/jna-5.10.0.jar.sha1 b/server/licenses/jna-5.10.0.jar.sha1 new file mode 100644 index 000000000000..3f0395cd5d17 --- /dev/null +++ b/server/licenses/jna-5.10.0.jar.sha1 @@ -0,0 +1 @@ +7cf4c87dd802db50721db66947aa237d7ad09418 \ No newline at end of file diff --git a/server/licenses/jna-5.7.0-1.jar.sha1 b/server/licenses/jna-5.7.0-1.jar.sha1 deleted file mode 100644 index d41fa4c8990c..000000000000 --- a/server/licenses/jna-5.7.0-1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8ffc051522e63292eaf757d89353c14e94233988 \ No newline at end of file diff --git a/x-pack/plugin/sql/qa/server/build.gradle b/x-pack/plugin/sql/qa/server/build.gradle index 42ebf1e2f4c5..9c959303732e 100644 --- a/x-pack/plugin/sql/qa/server/build.gradle +++ b/x-pack/plugin/sql/qa/server/build.gradle @@ -32,7 +32,7 @@ dependencies { api "org.jline:jline-reader:${jlineVersion}" api "org.jline:jline-style:${jlineVersion}" - testRuntimeOnly "org.elasticsearch:jna:${versions.jna}" + testRuntimeOnly "net.java.dev.jna:jna:${versions.jna}" } // this is just a test fixture used by other projects and not in production @@ -96,7 +96,7 @@ subprojects { testRuntimeOnly "org.jline:jline-reader:${jlineVersion}" testRuntimeOnly "org.jline:jline-style:${jlineVersion}" - testRuntimeOnly "org.elasticsearch:jna:${versions.jna}" + testRuntimeOnly "net.java.dev.jna:jna:${versions.jna}" // spatial dependency testRuntimeOnly project(path: xpackModule('spatial')) diff --git a/x-pack/plugin/sql/sql-cli/build.gradle b/x-pack/plugin/sql/sql-cli/build.gradle index cf9b599446a9..f9210317fefe 100644 --- a/x-pack/plugin/sql/sql-cli/build.gradle +++ b/x-pack/plugin/sql/sql-cli/build.gradle @@ -30,7 +30,7 @@ dependencies { api xpackProject('plugin:sql:sql-action') api project(":libs:elasticsearch-cli") api project(':libs:elasticsearch-x-content') - runtimeOnly "org.elasticsearch:jna:${versions.jna}" + runtimeOnly "net.java.dev.jna:jna:${versions.jna}" testImplementation project(":test:framework") } diff --git a/x-pack/plugin/sql/sql-cli/licenses/jna-5.10.0.jar.sha1 b/x-pack/plugin/sql/sql-cli/licenses/jna-5.10.0.jar.sha1 new file mode 100644 index 000000000000..3f0395cd5d17 --- /dev/null +++ b/x-pack/plugin/sql/sql-cli/licenses/jna-5.10.0.jar.sha1 @@ -0,0 +1 @@ +7cf4c87dd802db50721db66947aa237d7ad09418 \ No newline at end of file diff --git a/x-pack/plugin/sql/sql-cli/licenses/jna-5.7.0-1.jar.sha1 b/x-pack/plugin/sql/sql-cli/licenses/jna-5.7.0-1.jar.sha1 deleted file mode 100644 index d41fa4c8990c..000000000000 --- a/x-pack/plugin/sql/sql-cli/licenses/jna-5.7.0-1.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -8ffc051522e63292eaf757d89353c14e94233988 \ No newline at end of file