From 1bb88641788abdbfd72b76c9741880cb3b1ae37a Mon Sep 17 00:00:00 2001 From: sharp-pixel Date: Thu, 6 Jan 2022 18:39:13 +0100 Subject: [PATCH] Add darwin-arm64-tar and no-jdk-darwin-arm64-tar archive distributions. (#1668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add darwin-arm64-tar and no-jdk-darwin-arm64-tar archive distributions. Signed-off-by: Cédric Pelvet * Fix dangling HTML tags in javadoc to solve build issues with JDK 17. Signed-off-by: Cédric Pelvet --- distribution/archives/build.gradle | 14 ++++++++++++++ .../archives/darwin-arm64-tar/build.gradle | 13 +++++++++++++ .../archives/no-jdk-darwin-arm64-tar/build.gradle | 13 +++++++++++++ distribution/build.gradle | 4 ++-- .../src/main/java/org/opensearch/painless/Def.java | 8 +++++--- .../main/java/org/opensearch/plugins/Plugin.java | 3 ++- .../org/opensearch/script/AggregationScript.java | 2 +- settings.gradle | 2 ++ 8 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 distribution/archives/darwin-arm64-tar/build.gradle create mode 100644 distribution/archives/no-jdk-darwin-arm64-tar/build.gradle diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 2c5b91f7e135d..ac70ee04444c7 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -95,6 +95,13 @@ distribution_archives { } } + darwinArm64Tar { + archiveClassifier = 'darwin-arm64' + content { + archiveFiles(modulesFiles('darwin-arm64'), 'tar', 'darwin', 'arm64', true) + } + } + noJdkDarwinTar { archiveClassifier = 'no-jdk-darwin-x64' content { @@ -102,6 +109,13 @@ distribution_archives { } } + noJdkDarwinArm64Tar { + archiveClassifier = 'no-jdk-darwin-arm64' + content { + archiveFiles(modulesFiles('darwin-arm64'), 'tar', 'darwin', 'arm64', false) + } + } + freebsdTar { archiveClassifier = 'freebsd-x64' content { diff --git a/distribution/archives/darwin-arm64-tar/build.gradle b/distribution/archives/darwin-arm64-tar/build.gradle new file mode 100644 index 0000000000000..bb3e3a302c8d6 --- /dev/null +++ b/distribution/archives/darwin-arm64-tar/build.gradle @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +// This file is intentionally blank. All configuration of the +// distribution is done in the parent project. diff --git a/distribution/archives/no-jdk-darwin-arm64-tar/build.gradle b/distribution/archives/no-jdk-darwin-arm64-tar/build.gradle new file mode 100644 index 0000000000000..bb3e3a302c8d6 --- /dev/null +++ b/distribution/archives/no-jdk-darwin-arm64-tar/build.gradle @@ -0,0 +1,13 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * + * Modifications Copyright OpenSearch Contributors. See + * GitHub history for details. + */ + +// This file is intentionally blank. All configuration of the +// distribution is done in the parent project. diff --git a/distribution/build.gradle b/distribution/build.gradle index 33232195973f0..356aaa269e106 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -280,7 +280,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { // Setup all required JDKs project.jdks { ['darwin', 'linux', 'windows'].each { platform -> - (platform == 'linux' ? ['x64', 'aarch64'] : ['x64']).each { architecture -> + (platform == 'linux' || platform == 'darwin' ? ['x64', 'aarch64'] : ['x64']).each { architecture -> "bundled_${platform}_${architecture}" { it.platform = platform it.version = VersionProperties.getBundledJdk(platform) @@ -353,7 +353,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { } } def buildModules = buildModulesTaskProvider - List excludePlatforms = ['darwin-x64', 'freebsd-x64', 'linux-x64', 'linux-arm64', 'windows-x64'] + List excludePlatforms = ['darwin-x64', 'freebsd-x64', 'linux-x64', 'linux-arm64', 'windows-x64', 'darwin-arm64'] if (platform != null) { excludePlatforms.remove(excludePlatforms.indexOf(platform)) } else { diff --git a/modules/lang-painless/src/main/java/org/opensearch/painless/Def.java b/modules/lang-painless/src/main/java/org/opensearch/painless/Def.java index 6fe0888c867a9..1c5b40b0e7166 100644 --- a/modules/lang-painless/src/main/java/org/opensearch/painless/Def.java +++ b/modules/lang-painless/src/main/java/org/opensearch/painless/Def.java @@ -234,11 +234,12 @@ static MethodHandle arrayLengthGetter(Class arrayType) { *

* A dynamic method call for variable {@code x} of type {@code def} looks like: * {@code x.method(args...)} + *

*

* This method traverses {@code recieverClass}'s class hierarchy (including interfaces) * until it finds a matching whitelisted method. If one is not found, it throws an exception. * Otherwise it returns a handle to the matching method. - *

+ *

* @param painlessLookup the whitelist * @param functions user defined functions and lambdas * @param constants available constants to be used if the method has the {@code InjectConstantAnnotation} @@ -468,6 +469,7 @@ private static MethodHandle lookupReferenceInternal( *

* A dynamic field load for variable {@code x} of type {@code def} looks like: * {@code y = x.field} + *

*

* The following field loads are allowed: *

    @@ -482,7 +484,7 @@ private static MethodHandle lookupReferenceInternal( * This method traverses {@code recieverClass}'s class hierarchy (including interfaces) * until it finds a matching whitelisted getter. If one is not found, it throws an exception. * Otherwise it returns a handle to the matching getter. - *

    + *

    * @param painlessLookup the whitelist * @param receiverClass Class of the object to retrieve the field from. * @param name Name of the field. @@ -537,7 +539,7 @@ static MethodHandle lookupGetter(PainlessLookup painlessLookup, Class receive * This method traverses {@code recieverClass}'s class hierarchy (including interfaces) * until it finds a matching whitelisted setter. If one is not found, it throws an exception. * Otherwise it returns a handle to the matching setter. - *

    + *

    * @param painlessLookup the whitelist * @param receiverClass Class of the object to retrieve the field from. * @param name Name of the field. diff --git a/server/src/main/java/org/opensearch/plugins/Plugin.java b/server/src/main/java/org/opensearch/plugins/Plugin.java index cf62b6937dd0d..9a7dcbd6a78f6 100644 --- a/server/src/main/java/org/opensearch/plugins/Plugin.java +++ b/server/src/main/java/org/opensearch/plugins/Plugin.java @@ -208,10 +208,11 @@ public List> getSettingUpgraders() { * Provides a function to modify index template meta data on startup. *

    * Plugins should return the input template map via {@link UnaryOperator#identity()} if no upgrade is required. + *

    *

    * The order of the template upgrader calls is undefined and can change between runs so, it is expected that * plugins will modify only templates owned by them to avoid conflicts. - *

    + *

    * @return Never {@code null}. The same or upgraded {@code IndexTemplateMetadata} map. * @throws IllegalStateException if the node should not start because at least one {@code IndexTemplateMetadata} * cannot be upgraded diff --git a/server/src/main/java/org/opensearch/script/AggregationScript.java b/server/src/main/java/org/opensearch/script/AggregationScript.java index a3b982ecdf704..c45541ff93658 100644 --- a/server/src/main/java/org/opensearch/script/AggregationScript.java +++ b/server/src/main/java/org/opensearch/script/AggregationScript.java @@ -128,7 +128,7 @@ public void setScorer(Scorable scorer) { *

    * The default implementation just calls {@code setNextVar("_value", value)} but * some engines might want to handle this differently for better performance. - *

    + *

    * @param value per-document value, typically a String, Long, or Double */ public void setNextAggregationValue(Object value) { diff --git a/settings.gradle b/settings.gradle index 3fdc7ec03bf99..bcf1fd5937668 100644 --- a/settings.gradle +++ b/settings.gradle @@ -34,6 +34,8 @@ List projects = [ 'distribution:archives:windows-zip', 'distribution:archives:no-jdk-windows-zip', 'distribution:archives:darwin-tar', + 'distribution:archives:darwin-arm64-tar', + 'distribution:archives:no-jdk-darwin-arm64-tar', 'distribution:archives:no-jdk-darwin-tar', 'distribution:archives:freebsd-tar', 'distribution:archives:no-jdk-freebsd-tar',