Skip to content
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

Move to 17 using DS-Memory 4.0.0 with FFM/Panama #577

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions .github/workflows/auto-jdk-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,51 @@ on:
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx4g -Xms1g
MAVEN_OPTS: -Xmx1g -Xms1g

jobs:
build:
name: Build, Test, Install
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
jdk: [ 8,11 ]

env:
JDK_VERSION: ${{ matrix.jdk }}
JDK_VERSION: 17

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Print Current workflow
run: >
cat .github/workflows/auto-jdk-matrix.yml

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-package: jdk
architecture: x64
java-version: 17

- name: Cache local Maven repository
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install Matrix JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64
# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v3 has a "with cache" option

- name: Echo Java Version
run: >
java -version

- name: Test
run: >
mvn clean test
mvn clean test -B
-Dmaven.javadoc.skip=true
-Dgpg.skip=true

Expand All @@ -59,7 +61,10 @@ jobs:
-DskipTests=true
-Dgpg.skip=true

# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
# Lifecycle: validate, compile, test, package, verify, install, deploy
# -B batch mode
# -B batch mode, never stops for user input
# -V show Version without stopping
# -X debug mode
# -q quiet, only show errors
159 changes: 40 additions & 119 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,11 @@ specific language governing permissions and limitations
under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>32</version>
</parent>

<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-java</artifactId>
<version>6.1.0-SNAPSHOT</version>
Expand Down Expand Up @@ -66,8 +58,8 @@ under the License.
</scm>

<issueManagement>
<!-- <system>jira</system>
<url>https://issues.apache.org/jira/browse/DATASKETCHES</url> -->
<!-- <system>jira</system> -->
<!-- <url>https://issues.apache.org/jira/browse/DATASKETCHES</url> -->
<system>GitHub</system>
<url>https://github.com/apache/${project.artifactId}/issues</url>
</issueManagement>
Expand All @@ -83,64 +75,61 @@ under the License.
</developers>

<properties>
<!-- UNIQUE FOR THIS JAVA COMPONENT -->
<datasketches-memory.version>2.2.0</datasketches-memory.version>
<!-- END:UNIQUE FOR THIS JAVA COMPONENT -->

<!-- Test -->
<testng.version>7.5.1</testng.version>
<testng.version>7.10.0</testng.version>
<!-- these are TestNG groups used for excluding / including groups of tests. See profiles section. -->
<testng.generate-java-files>generate_java_files</testng.generate-java-files>
<testng.check-cpp-files>check_cpp_files</testng.check-cpp-files>
<testng.check-cpp-historical-files>check_cpp_historical_files</testng.check-cpp-historical-files>

<!-- System-wide properties -->
<maven.version>3.6.3</maven.version> <!-- may override parent, used in enforcer plugin -->
<java.version>1.8</java.version>
<maven.version>3.6.3</maven.version>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8</argLine>
<argLine>-Xmx4g -Duser.language=en -Duser.country=US -Dfile.encoding=UTF-8 --add-modules=jdk.incubator.foreign</argLine>
<charset.encoding>UTF-8</charset.encoding>
<project.build.sourceEncoding>${charset.encoding}</project.build.sourceEncoding>
<project.build.resourceEncoding>${charset.encoding}</project.build.resourceEncoding>
<project.reporting.outputEncoding>${charset.encoding}</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH-mm-ss'Z'</maven.build.timestamp.format>

<!-- org.mojohaus plugins: used for checking & updating dependency versions -->
<versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>

<!-- Maven Plugins -->
<maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version> <!-- may override parent -->
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version> <!-- may override parent -->
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version> <!-- may override parent -->
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version> <!-- may override parent -->
<maven-gpg-plugin.version>3.2.3</maven-gpg-plugin.version> <!-- may override parent -->
<maven-jar-plugin.version>3.4.0</maven-jar-plugin.version> <!-- may override parent -->
<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version> <!-- may override parent -->
<maven-release-plugin.version>3.0.1</maven-release-plugin.version> <!-- may override parent -->
<maven-remote-resources-plugin.version>3.2.0</maven-remote-resources-plugin.version> <!-- may override parent -->
<maven-source-plugin.version>3.3.1</maven-source-plugin.version> <!-- may override parent -->
<maven-surefire-failsafe-plugins.version>3.2.5</maven-surefire-failsafe-plugins.version><!-- for surefire, failsafe and surefire-report, may override parent-->
<maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
<maven-gpg-plugin.version>3.2.3</maven-gpg-plugin.version>
<maven-jar-plugin.version>3.4.0</maven-jar-plugin.version>
<maven-javadoc-plugin.version>3.7.0</maven-javadoc-plugin.version>
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<maven-remote-resources-plugin.version>3.2.0</maven-remote-resources-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-surefire-failsafe-plugins.version>3.2.5</maven-surefire-failsafe-plugins.version><!-- for surefire, failsafe and surefire-report -->
<maven-install-plugin.version>3.1.2</maven-install-plugin.version>
<!-- Apache Plugins -->
<apache-rat-plugin.version>0.16.1</apache-rat-plugin.version> <!-- may override parent -->
<apache-rat-plugin.version>0.16.1</apache-rat-plugin.version>
<!-- org.jacoco Maven Plugins -->
<jacoco-maven-plugin.version>0.8.12</jacoco-maven-plugin.version>
<!-- org.eluder Maven Plugins -->
<coveralls-repo-token></coveralls-repo-token>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<!-- mojohaus.org plugins -->
<versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>

<!-- other -->
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version> <!-- not used -->
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version> <!-- no actual plugin, referenced by m2e -->
<git-commit-id-plugin.version>4.9.10</git-commit-id-plugin.version>
</properties>

<dependencies>
<!-- UNIQUE FOR THIS JAVA COMPONENT -->
<dependency>
<groupId>org.apache.datasketches</groupId>
<artifactId>datasketches-memory</artifactId>
<version>${datasketches-memory.version}</version>
</dependency>
<!-- END: UNIQUE FOR THIS JAVA COMPONENT -->
<!-- Test Scope -->
<dependency>
<groupId>org.testng</groupId>
Expand Down Expand Up @@ -170,6 +159,11 @@ under the License.
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<compilerArgs>
<arg>--add-modules=jdk.incubator.foreign</arg>
</compilerArgs>
</configuration>
</plugin>

<plugin>
Expand All @@ -193,7 +187,7 @@ under the License.
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8.0,9.0),[11.0,12.0)</version>
<version>[17,18)</version>
</requireJavaVersion>
<requireMavenVersion>
<version>[${maven.version},)</version>
Expand All @@ -212,7 +206,6 @@ under the License.
</plugin>

<plugin>
<!-- Extends Apache Parent pom, pluginManagement-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
Expand All @@ -235,12 +228,15 @@ under the License.
</plugin>

<plugin>
<!-- Extends Apache Parent pom, apache-release profile -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<docfilessubdirs>true</docfilessubdirs>
<show>public</show>
<additionalOptions>
<additionalOption>--add-modules=jdk.incubator.foreign</additionalOption>
</additionalOptions>
</configuration>
<executions>
<execution>
Expand All @@ -253,14 +249,12 @@ under the License.
</plugin>

<plugin>
<!-- Apache Parent pom, pluginManagement-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
</plugin>

<plugin>
<!-- Extends Apache Parent pom, apache-release profile -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
Expand All @@ -283,11 +277,11 @@ under the License.
</plugin>

<plugin>
<!-- Apache Parent pom, pluginManagement-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-failsafe-plugins.version}</version>
<configuration>
<argLine>--add-modules=jdk.incubator.foreign</argLine>
<trimStackTrace>false</trimStackTrace>
<useManifestOnlyJar>false</useManifestOnlyJar>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
Expand All @@ -297,7 +291,6 @@ under the License.
</plugin>

<plugin>
<!-- Apache Parent pom, pluginManagement-->
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
<version>${apache-rat-plugin.version}</version>
Expand Down Expand Up @@ -423,44 +416,8 @@ under the License.
</plugin>
</plugins>
</build>
<profiles>
<!-- Ignore nuisance warning from Apache parent plugin:
"maven-remote-resources-plugin (goal "process") is ignored by m2e".
This profile is only active when the property "m2e.version" is set,
which is the case when building in Eclipse with m2e.
-->
<profile>
<id>only-eclipse</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
<version>${maven-remote-resources-plugin.version}</version>
<executions>
<execution>
<id>process-resource-bundles</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-remote-resources-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
<profiles>

<!-- This profile is used to release signed jars to the Apache Nexus repository.
This must be executed from a git repository set at the proper Release branch (e.g., 1.1.X)
Expand Down Expand Up @@ -606,8 +563,9 @@ under the License.
</plugins>
</build>
</profile>

<!-- Disable source release assembly for 'apache-release' profile.
This is performed from a script outside Maven -->
This is performed from a script outside Maven
<profile>
<id>apache-release</id>
<build>
Expand All @@ -624,44 +582,7 @@ under the License.
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>java8only</id>
<activation>
<jdk>[1.8,1.9),8</jdk>
</activation>
</profile>

<profile>
<id>java11plus</id>
<activation>
<jdk>[11,14)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- Apache Parent pom, pluginManagement-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine}
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED
--add-opens java.base/java.nio=ALL-UNNAMED
--add-opens java.base/sun.nio.ch=ALL-UNNAMED
</argLine>
<excludedGroups>${testng.generate-java-files},${testng.check-cpp-files}</excludedGroups>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profile> -->

<profile>
<id>generate-java-files</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/apache/datasketches/cpc/CpcSketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public byte[] toByteArray() {
final long cap = state.getRequiredSerializedBytes();
final WritableMemory wmem = WritableMemory.allocate((int) cap);
state.exportToMemory(wmem);
return (byte[]) wmem.getArray();
return wmem.getArray();
}

/**
Expand Down
Loading
Loading