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

chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 5623ead6b [KYUUBI #6456] Opens jdk.internal.ref
5623ead6b is described below

commit 5623ead6bdea8a9b5948c07ca48c857c2e518940
Author: Cheng Pan <[email protected]>
AuthorDate: Fri Jun 7 11:02:04 2024 +0800

    [KYUUBI #6456] Opens jdk.internal.ref
    
    # :mag: Description
    
    This PR follows SPARK-45508 to modify the JVM args by adding 
`--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED`, without this arg should 
not affect Spark engines as `spark-submit` will handle that by launching a 
sub-process and adding those JVM args.
    
    The change benefits Spark in-process cases in UT, a little.
    
    This PR also renames maven properties `maven.plugin.surefire.argLine` back 
to `extraJavaTestArgs` as it is used in both surefire and scalatest plugins, 
and makes it always takes effect instead of only JDK 17, then we don't need a 
copy when adding a new profile `java-21`
    
    ## Types of changes :bookmark:
    
    - [ ] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    Pass GHA.
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [x] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6456 from pan3793/add-open.
    
    Closes #6456
    
    ef7310a2e [Cheng Pan] add opens
    
    Authored-by: Cheng Pan <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
---
 bin/load-kyuubi-env.sh |  2 ++
 pom.xml                | 44 +++++++++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/bin/load-kyuubi-env.sh b/bin/load-kyuubi-env.sh
index 779ac2bea..aa7cee023 100755
--- a/bin/load-kyuubi-env.sh
+++ b/bin/load-kyuubi-env.sh
@@ -78,6 +78,7 @@ KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/java.nio=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/java.util=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED"
+KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/sun.nio.cs=ALL-UNNAMED"
 KYUUBI_JAVA_OPTS="$KYUUBI_JAVA_OPTS 
--add-opens=java.base/sun.security.action=ALL-UNNAMED"
@@ -97,6 +98,7 @@ KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/java.nio=ALL-U
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/java.util=ALL-UNNAMED"
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED"
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED"
+KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/sun.nio.cs=ALL-UNNAMED"
 KYUUBI_CTL_JAVA_OPTS="$KYUUBI_CTL_JAVA_OPTS 
--add-opens=java.base/sun.security.action=ALL-UNNAMED"
diff --git a/pom.xml b/pom.xml
index 3268a1b00..92e2803fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -238,7 +238,6 @@
         
<maven.plugin.scalatest.debug.enabled>false</maven.plugin.scalatest.debug.enabled>
         <maven.plugin.spotless.version>2.30.0</maven.plugin.spotless.version>
         <maven.plugin.surefire.version>3.2.1</maven.plugin.surefire.version>
-        <maven.plugin.surefire.argLine></maven.plugin.surefire.argLine>
         <maven.plugin.jacoco.version>0.8.11</maven.plugin.jacoco.version>
         
<maven.plugin.scalastyle.version>1.0.0</maven.plugin.scalastyle.version>
         <maven.plugin.shade.version>3.5.2</maven.plugin.shade.version>
@@ -269,6 +268,26 @@
         <distMgmtSnapshotsName>Apache Development Snapshot 
Repository</distMgmtSnapshotsName>
         
<distMgmtSnapshotsUrl>https://repository.apache.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
 
+        <extraJavaTestArgs>-XX:+IgnoreUnrecognizedVMOptions
+            --add-opens=java.base/java.lang=ALL-UNNAMED
+            --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
+            --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
+            --add-opens=java.base/java.io=ALL-UNNAMED
+            --add-opens=java.base/java.net=ALL-UNNAMED
+            --add-opens=java.base/java.nio=ALL-UNNAMED
+            --add-opens=java.base/java.util=ALL-UNNAMED
+            --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
+            --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
+            --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
+            --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
+            --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
+            --add-opens=java.base/sun.security.action=ALL-UNNAMED
+            --add-opens=java.base/sun.security.tools.keytool=ALL-UNNAMED
+            --add-opens=java.base/sun.security.x509=ALL-UNNAMED
+            --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
+            -Djdk.reflect.useDirectMethodHandle=false
+            -Dio.netty.tryReflectionSetAccessible=true</extraJavaTestArgs>
+
         
<debugArgLine>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debugArgLine>
     </properties>
 
@@ -1413,7 +1432,7 @@
                     <configuration>
                         <skipTests>true</skipTests>
                         <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
-                        <argLine>${maven.plugin.surefire.argLine}</argLine>
+                        <argLine>${extraJavaTestArgs}</argLine>
                         <environmentVariables>
                             
<KYUUBI_WORK_DIR_ROOT>${project.build.directory}/work</KYUUBI_WORK_DIR_ROOT>
                         </environmentVariables>
@@ -1441,7 +1460,7 @@
                         
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                         <junitxml>.</junitxml>
                         <filereports>TestSuite.txt</filereports>
-                        <argLine>${maven.plugin.surefire.argLine}</argLine>
+                        <argLine>${extraJavaTestArgs}</argLine>
                         <environmentVariables>
                             
<KYUUBI_WORK_DIR_ROOT>${project.build.directory}/work</KYUUBI_WORK_DIR_ROOT>
                         </environmentVariables>
@@ -1892,24 +1911,7 @@
                 <maven.compiler.source></maven.compiler.source>
                 <maven.compiler.target></maven.compiler.target>
                 
<maven.compiler.release>${java.version}</maven.compiler.release>
-                <maven.plugin.surefire.argLine>-XX:+IgnoreUnrecognizedVMOptions
-                    --add-opens=java.base/java.lang=ALL-UNNAMED
-                    --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
-                    --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
-                    --add-opens=java.base/java.io=ALL-UNNAMED
-                    --add-opens=java.base/java.net=ALL-UNNAMED
-                    --add-opens=java.base/java.nio=ALL-UNNAMED
-                    --add-opens=java.base/java.util=ALL-UNNAMED
-                    --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
-                    
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
-                    --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
-                    --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
-                    --add-opens=java.base/sun.security.action=ALL-UNNAMED
-                    
--add-opens=java.base/sun.security.tools.keytool=ALL-UNNAMED
-                    --add-opens=java.base/sun.security.x509=ALL-UNNAMED
-                    --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
-                    -Djdk.reflect.useDirectMethodHandle=false
-                    
-Dio.netty.tryReflectionSetAccessible=true</maven.plugin.surefire.argLine>
+                
<minimalJavaBuildVersion>${java.version}</minimalJavaBuildVersion>
             </properties>
         </profile>
 

Reply via email to