You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by ch...@apache.org on 2024/04/01 04:43:37 UTC

(incubator-fury) branch test-main updated (37d34340 -> 5bdada3a)

This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a change to branch test-main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git


    omit 37d34340 fix: add license header to build.sbt (#1442)
    omit 59da6e90 feat(java): add openj9 ci (#1437)
    omit 09583c90 fix(java): fix illegal classname caused by negative hash (#1436)
     new 21ff8cc8 fix(java): fix illegal classname caused by negative hash (#1436)
     new d99eb973 feat(java): add openj9 ci (#1437)
     new 5bdada3a fix: add license header to build.sbt (#1442)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (37d34340)
            \
             N -- N -- N   refs/heads/test-main (5bdada3a)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


(incubator-fury) 02/03: feat(java): add openj9 ci (#1437)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch test-main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git

commit d99eb973c0ba27627791ef83e26675a5147099e1
Author: chaokunyang <ch...@apache.org>
AuthorDate: Sun Mar 31 13:13:32 2024 +0800

    feat(java): add openj9 ci (#1437)
    
    This PR add openj9 ci, since we have openj9 users, see #1433 . Class GC
    in linux distribution are not supported in this PR.
---
 .github/workflows/ci.yml                           | 25 +++++++++++++++++++++-
 .../org/apache/fury/util/unsafe/_JDKAccess.java    |  4 ++--
 .../java/org/apache/fury/util/unsafe/_Lookup.java  |  2 +-
 .../src/test/java/org/apache/fury/TestUtils.java   |  5 +++++
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a200dc4f..bff362f2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -62,7 +62,30 @@ jobs:
         run: ./ci/run_ci.sh install_pyfury
       - name: Run CI with Maven
         run: ./ci/run_ci.sh java${{ matrix.java-version }}
-
+  openj9:
+    name: Openj9 Java CI
+    runs-on: ubuntu-latest
+    env:
+      MY_VAR: "PATH"
+    strategy:
+      matrix:
+        # String in openj9 1.8 share byte array by offset, fury doesn't allow it.
+        java-version: ["21"]
+    steps:
+      - uses: actions/checkout@v4
+      - name: Set up JDK ${{ matrix.java-version }}
+        uses: actions/setup-java@v4
+        with:
+          java-version: ${{ matrix.java-version }}
+          distribution: 'adopt-openj9'
+      - name: Install bazel
+        run: ./ci/run_ci.sh install_bazel
+      - name: Install python
+        run: ./ci/run_ci.sh install_python
+      - name: Install pyfury
+        run: ./ci/run_ci.sh install_pyfury
+      - name: Run CI with Maven
+        run: ./ci/run_ci.sh java${{ matrix.java-version }}
   graalvm:
     name: GraalVM CI
     runs-on: ubuntu-latest
diff --git a/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_JDKAccess.java b/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_JDKAccess.java
index e7d3b0de..dd429197 100644
--- a/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_JDKAccess.java
+++ b/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_JDKAccess.java
@@ -54,7 +54,7 @@ import sun.misc.Unsafe;
 public class _JDKAccess {
   // CHECKSTYLE.ON:TypeName
   public static final int JAVA_VERSION;
-  public static final boolean OPEN_J9;
+  public static final boolean IS_OPEN_J9;
   public static final Unsafe UNSAFE;
   public static final Class<?> _INNER_UNSAFE_CLASS;
   public static final Object _INNER_UNSAFE;
@@ -65,7 +65,7 @@ public class _JDKAccess {
       property = property.substring(2);
     }
     String jmvName = System.getProperty("java.vm.name", "");
-    OPEN_J9 = jmvName.contains("OpenJ9");
+    IS_OPEN_J9 = jmvName.contains("OpenJ9");
     JAVA_VERSION = Integer.parseInt(property);
     Unsafe unsafe;
     try {
diff --git a/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_Lookup.java b/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_Lookup.java
index 16ddedb1..7ade95e0 100644
--- a/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_Lookup.java
+++ b/java/fury-core/src/main/java/org/apache/fury/util/unsafe/_Lookup.java
@@ -72,7 +72,7 @@ class _Lookup {
           }
           int fullAccessMask = 31; // for IBM Open J9 JDK
           return (Lookup)
-              constructor.invoke(objectClass, _JDKAccess.OPEN_J9 ? fullAccessMask : trusted);
+              constructor.invoke(objectClass, _JDKAccess.IS_OPEN_J9 ? fullAccessMask : trusted);
         } else {
           if (constructor == null) {
             constructor =
diff --git a/java/fury-core/src/test/java/org/apache/fury/TestUtils.java b/java/fury-core/src/test/java/org/apache/fury/TestUtils.java
index b45d3707..97050684 100644
--- a/java/fury-core/src/test/java/org/apache/fury/TestUtils.java
+++ b/java/fury-core/src/test/java/org/apache/fury/TestUtils.java
@@ -28,6 +28,8 @@ import java.util.ArrayList;
 import java.util.function.Supplier;
 import org.apache.fury.util.FieldAccessor;
 import org.apache.fury.util.ReflectionUtils;
+import org.apache.fury.util.unsafe._JDKAccess;
+import org.testng.SkipException;
 
 /** Test utils. */
 public class TestUtils {
@@ -47,6 +49,9 @@ public class TestUtils {
    * @param predicate whether stop Trigger OOM.
    */
   public static void triggerOOMForSoftGC(Supplier<Boolean> predicate) {
+    if (_JDKAccess.IS_OPEN_J9) {
+      throw new SkipException("OpenJ9 unsupported");
+    }
     System.gc();
     while (predicate.get()) {
       triggerOOM();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


(incubator-fury) 03/03: fix: add license header to build.sbt (#1442)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch test-main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git

commit 5bdada3a9d85eeb5a7a08339519a31c20a6417ed
Author: chaokunyang <ch...@apache.org>
AuthorDate: Sun Mar 31 18:31:27 2024 +0200

    fix: add license header to build.sbt (#1442)
    
    ideally all files should have license headers
    
    relates to #1441
---
 scala/build.sbt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/scala/build.sbt b/scala/build.sbt
index d4d7b188..892c01c5 100644
--- a/scala/build.sbt
+++ b/scala/build.sbt
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 name := "fury-scala"
 scalaVersion := "2.13.13"
 crossScalaVersions := Seq("2.13.12", "3.3.3")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org


(incubator-fury) 01/03: fix(java): fix illegal classname caused by negative hash (#1436)

Posted by ch...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch test-main
in repository https://gitbox.apache.org/repos/asf/incubator-fury.git

commit 21ff8cc8c71a4662ceefc87bd5c118f39af71308
Author: chaokunyang <ch...@apache.org>
AuthorDate: Sat Mar 30 22:00:00 2024 +0800

    fix(java): fix illegal classname caused by negative hash (#1436)
    
    Closes #1433
---
 .../src/main/java/org/apache/fury/codegen/CodeGenerator.java        | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/java/fury-core/src/main/java/org/apache/fury/codegen/CodeGenerator.java b/java/fury-core/src/main/java/org/apache/fury/codegen/CodeGenerator.java
index da3bc7e0..397ddca4 100644
--- a/java/fury-core/src/main/java/org/apache/fury/codegen/CodeGenerator.java
+++ b/java/fury-core/src/main/java/org/apache/fury/codegen/CodeGenerator.java
@@ -344,10 +344,12 @@ public class CodeGenerator {
     }
     // classLoader will be null for jdk classes.
     ClassLoader classLoader = cls.getClassLoader();
+    // Hashcode may be negative in open-j9 jdk. While using `abs` to remove sign works fine too.
+    // it's still possible that hashCodes of two objects only differ in sign.
     if (classLoader == null) {
-      return String.valueOf(cls.hashCode());
+      return String.valueOf(cls.hashCode()).replace("-", "_");
     } else {
-      return String.format("%s_%s", classLoader.hashCode(), cls.hashCode());
+      return String.format("%s_%s", classLoader.hashCode(), cls.hashCode()).replace("-", "_");
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org