Skip to content
Closed
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
6 changes: 3 additions & 3 deletions .github/workflows/graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-latest', 'windows-latest' ]
java-version: [ '24.0.2' ]
java-version: [ '25.0.1' ]
steps:
- uses: actions/checkout@v4
- name: Free Disk Space on Ubuntu
Expand All @@ -72,9 +72,9 @@ jobs:
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache-
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-
# TODO Remove this workaround after. The graalvm native image built with windows server is missing some GRMs for testcontainers
- name: Run test with GraalVM CE
- name: Run test with GraalVM CE for ${{ matrix.java-version }}
if: matrix.os == 'windows-latest'
run: ./mvnw -PgenerateMetadata -e -T 1C clean verify
- name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }}
if: matrix.os == 'ubuntu-latest'
run: ./mvnw -PnativeTestInShardingSphere -e "-DjvmArgs=-XX:MaxRAMPercentage=85.0" clean verify
run: ./mvnw -PnativeTestInShardingSphere -e clean verify
8 changes: 4 additions & 4 deletions .github/workflows/nightly-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
"PATH=$env:PATH" >> $env:GITHUB_ENV
- uses: graalvm/setup-graalvm@v1
with:
java-version: '24.0.2'
java-version: '25.0.1'
distribution: 'graalvm-community'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
Expand All @@ -135,9 +135,9 @@ jobs:
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache-
${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-
# TODO Remove this workaround after. The graalvm native image built with windows server is missing some GRMs for testcontainers
- name: Run test with GraalVM CE
- name: Run test with GraalVM CE for ${{ matrix.java-version }}
if: matrix.os == 'windows-latest'
run: ./mvnw -PgenerateMetadata -e -T 1C clean verify
- name: Run nativeTest with GraalVM CE
- name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }}
if: matrix.os == 'ubuntu-latest'
run: ./mvnw -PnativeTestInShardingSphere -e "-DjvmArgs=-XX:MaxRAMPercentage=85.0" clean verify
run: ./mvnw -PnativeTestInShardingSphere -e clean verify
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
1. Pipeline: Improve "alter transmission rule": verify STREAM_CHANNEL TYPE NAME - [#36864](https://github.com/apache/shardingsphere/pull/36864)
1. Pipeline: InventoryDumperContextSplitter supports multi-columns unique key first integer column splitting - [#36935](https://github.com/apache/shardingsphere/pull/36935)
1. Encrypt: Support handling show create view result decoration in encrypt - [#37299](https://github.com/apache/shardingsphere/pull/37299)
1. Proxy Native: Support building Proxy Native via GraalVM CE for JDK 25 - [#37357](https://github.com/apache/shardingsphere/pull/37357)

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion distribution/proxy-native/Dockerfile-linux-dynamic
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

FROM ghcr.io/graalvm/native-image-community:24.0.2 AS nativebuild
FROM ghcr.io/graalvm/native-image-community:25.0.1 AS nativebuild
WORKDIR /build
COPY ./ .
RUN --mount=type=cache,target=/root/.m2 ./mvnw -am -pl distribution/proxy-native -T1C -DskipTests "-Prelease.native" clean package
Expand Down
2 changes: 1 addition & 1 deletion distribution/proxy-native/Dockerfile-linux-mostly
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

FROM ghcr.io/graalvm/native-image-community:24.0.2 AS nativebuild
FROM ghcr.io/graalvm/native-image-community:25.0.1 AS nativebuild
ENV NATIVE_IMAGE_OPTIONS="--static-nolibc"
WORKDIR /build
COPY ./ .
Expand Down
2 changes: 1 addition & 1 deletion distribution/proxy-native/Dockerfile-linux-static
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

FROM ghcr.io/graalvm/native-image-community:24.0.2-muslib AS nativebuild
FROM ghcr.io/graalvm/native-image-community:25.0.1-muslib AS nativebuild
ENV NATIVE_IMAGE_OPTIONS="--static,--libc=musl"
WORKDIR /build
COPY ./ .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CE 的 `native-image` 命令行工具的长篇大论的 shell 命令。
ShardingSphere JDBC 要求在如下或更高版本的 `GraalVM CE` 完成构建 GraalVM Native Image。使用者可通过 SDKMAN! 快速切换 JDK。这同理
适用于 https://sdkman.io/jdks#graal , https://sdkman.io/jdks#nik 和 https://sdkman.io/jdks#mandrel 等 `GraalVM CE` 的下游发行版。

- GraalVM CE For JDK 24.0.2,对应于 SDKMAN! 的 `24.0.2-graalce`
- GraalVM CE For JDK 25.0.1,对应于 SDKMAN! 的 `25.0.1-graalce`

用户依然可以使用 SDKMAN! 上的 `21.0.8-graal` 等旧版本的 Oracle GraalVM 来构建 ShardingSphere 的 GraalVM Native Image 产物。
但这将导致集成部分第三方依赖时,构建 GraalVM Native Image 失败。
Expand Down Expand Up @@ -52,7 +52,7 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.11.0</version>
<version>0.11.3</version>
<extensions>true</extensions>
<configuration>
<buildArgs>
Expand Down Expand Up @@ -92,12 +92,12 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh

```groovy
plugins {
id 'org.graalvm.buildtools.native' version '0.11.0'
id 'org.graalvm.buildtools.native' version '0.11.3'
}

dependencies {
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.0', classifier: 'repository', ext: 'zip')
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.3', classifier: 'repository', ext: 'zip')
}

graalvmNative {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ShardingSphere JDBC requires GraalVM Native Image to be built with GraalVM CE as
JDK through `SDKMAN!`. Same reason applicable to downstream distributions of `GraalVM CE` such as https://sdkman.io/jdks#graal ,
https://sdkman.io/jdks#nik and https://sdkman.io/jdks#mandrel .

- GraalVM CE For JDK 24.0.2, corresponding to `24.0.2-graalce` of SDKMAN!
- GraalVM CE For JDK 25.0.1, corresponding to `25.0.1-graalce` of SDKMAN!

Users can still use old versions of Oracle GraalVM such as `21.0.8-graal` on SDKMAN! to build ShardingSphere's GraalVM Native Image product.
But this will cause the failure of building GraalVM Native Image when integrating some third-party dependencies.
Expand Down Expand Up @@ -53,7 +53,7 @@ and the documentation of GraalVM Native Build Tools shall prevail.
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.11.0</version>
<version>0.11.3</version>
<extensions>true</extensions>
<configuration>
<buildArgs>
Expand Down Expand Up @@ -95,12 +95,12 @@ Reference https://github.com/graalvm/native-build-tools/issues/572 .

```groovy
plugins {
id 'org.graalvm.buildtools.native' version '0.11.0'
id 'org.graalvm.buildtools.native' version '0.11.3'
}

dependencies {
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.0', classifier: 'repository', ext: 'zip')
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.11.3', classifier: 'repository', ext: 'zip')
}

graalvmNative {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ShardingSphere 定义了,

贡献者必须在设备安装,

1. GraalVM CE 24.0.2,或与 GraalVM CE 24.0.2 兼容的 GraalVM 下游发行版。以 [GraalVM Native Image](/cn/user-manual/shardingsphere-jdbc/graalvm-native-image) 为准。
1. GraalVM CE 25.0.1,或与 GraalVM CE 25.0.1 兼容的 GraalVM 下游发行版。以 [GraalVM Native Image](/cn/user-manual/shardingsphere-jdbc/graalvm-native-image) 为准。
2. 编译 GraalVM Native Image 所需要的本地工具链。以 https://www.graalvm.org/latest/reference-manual/native-image/#prerequisites 为准。
3. 可运行 Linux Containers 的 Docker Engine,或与 testcontainers-java 兼容的 Container Runtime。以 https://java.testcontainers.org/supported_docker_environment/ 为准。

Expand All @@ -41,8 +41,8 @@ ShardingSphere 定义了,
sudo apt install unzip zip -y
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 24.0.2-graalce
sdk use java 24.0.2-graalce
sdk install java 25.0.1-graalce
sdk use java 25.0.1-graalce
```

可在 bash 通过如下命令安装编译 GraalVM Native Image 所需要的本地工具链。
Expand Down Expand Up @@ -85,11 +85,11 @@ winget install --id version-fox.vfox --source winget --exact
if (-not (Test-Path -Path $PROFILE)) { New-Item -Type File -Path $PROFILE -Force }; Add-Content -Path $PROFILE -Value 'Invoke-Expression "$(vfox activate pwsh)"'
# 此时需要打开新的 Powershell 7 终端
vfox add java
vfox install java@24.0.2-graalce
vfox use --global java@24.0.2-graalce
vfox install java@25.0.1-graalce
vfox use --global java@25.0.1-graalce
```

当 Windows 弹出窗口,要求允许类似 `C:\users\shard\.version-fox\cache\java\v-24.0.2-graalce\java-24.0.2-graalce\bin\java.exe` 路径的应用通过 Windows 防火墙时,应当批准。
当 Windows 弹出窗口,要求允许类似 `C:\users\shard\.version-fox\cache\java\v-25.0.1-graalce\java-25.0.1-graalce\bin\java.exe` 路径的应用通过 Windows 防火墙时,应当批准。
背景参考 https://support.microsoft.com/en-us/windows/risks-of-allowing-apps-through-windows-firewall-654559af-3f54-3dcf-349f-71ccd90bcc5c 。

可在 Powershell 7 通过如下命令安装编译 GraalVM Native Image 所需要的本地工具链。**特定情况下,开发者可能需要为 Visual Studio 的使用购买许可证。**
Expand Down Expand Up @@ -286,34 +286,38 @@ class SolutionTest {
当前执行 `./mvnw -PnativeTestInShardingSphere -e -T 1C clean verify` 将涉及到针对 `com.oracle.svm.core.code.CodeCachePoolMXBean` 的警告日志,

```shell
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access

com.oracle.svm.core.code.CodeCachePoolMXBean$CodeAndDataPool.getConstructors()

without it being registered for runtime reflection. Add com.oracle.svm.core.code.CodeCachePoolMXBean$CodeAndDataPool.getConstructors() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
java.base@24.0.2/java.lang.Class.getConstructors(DynamicHub.java:1128)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.findConstructors(MBeanIntrospector.java:459)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:430)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:389)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:137)
java.management@24.0.2/com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
java.management@24.0.2/javax.management.StandardMBean.construct(StandardMBean.java:174)
java.management@24.0.2/javax.management.StandardMBean.<init>(StandardMBean.java:268)
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access

com.oracle.svm.core.code.CodeCachePoolMXBean$NativeMetadataPool.getConstructors()

without it being registered for runtime reflection. Add com.oracle.svm.core.code.CodeCachePoolMXBean$NativeMetadataPool.getConstructors() to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
java.base@24.0.2/java.lang.Class.getConstructors(DynamicHub.java:1128)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.findConstructors(MBeanIntrospector.java:459)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:430)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:389)
java.management@24.0.2/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:137)
java.management@24.0.2/com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
java.management@24.0.2/javax.management.StandardMBean.construct(StandardMBean.java:174)
java.management@24.0.2/javax.management.StandardMBean.<init>(StandardMBean.java:268)
org.graalvm.nativeimage.MissingReflectionRegistrationError: Cannot reflectively access the 'com.oracle.svm.core.code.CodeCachePoolMXBean$CodeAndDataPool'. To allow this operation, add the following to the 'reflection' section of 'reachability-metadata.json' and rebuild the native image:

{
"type": "com.oracle.svm.core.code.CodeCachePoolMXBean$CodeAndDataPool"
}

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection
java.base@25.0.1/java.lang.Class.getConstructors(DynamicHub.java:1277)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.findConstructors(MBeanIntrospector.java:459)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:430)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:389)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:137)
java.management@25.0.1/com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
java.management@25.0.1/javax.management.StandardMBean.construct(StandardMBean.java:174)
java.management@25.0.1/javax.management.StandardMBean.<init>(StandardMBean.java:268)
org.graalvm.nativeimage.MissingReflectionRegistrationError: Cannot reflectively access the 'com.oracle.svm.core.code.CodeCachePoolMXBean$NativeMetadataPool'. To allow this operation, add the following to the 'reflection' section of 'reachability-metadata.json' and rebuild the native image:

{
"type": "com.oracle.svm.core.code.CodeCachePoolMXBean$NativeMetadataPool"
}

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection
java.base@25.0.1/java.lang.Class.getConstructors(DynamicHub.java:1277)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.findConstructors(MBeanIntrospector.java:459)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.getClassMBeanInfo(MBeanIntrospector.java:430)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanIntrospector.getMBeanInfo(MBeanIntrospector.java:389)
java.management@25.0.1/com.sun.jmx.mbeanserver.MBeanSupport.<init>(MBeanSupport.java:137)
java.management@25.0.1/com.sun.jmx.mbeanserver.MXBeanSupport.<init>(MXBeanSupport.java:66)
java.management@25.0.1/javax.management.StandardMBean.construct(StandardMBean.java:174)
java.management@25.0.1/javax.management.StandardMBean.<init>(StandardMBean.java:268)
```

相关警告在 `GraalVM CE For JDK 24.0.2` 上无法避免。
相关警告在 `GraalVM CE For JDK 25.0.1` 上无法避免。
因为 `com.oracle.svm.core.code.CodeCachePoolMXBean` 的无参构造函数通过 Java 类 `org.graalvm.nativeimage.Platform.HOSTED_ONLY` 被标记为无论实际的 Platform 是什么,
仅在 Native Image 生成期间可见,且无法在 Runtime 使用的元素。
Loading
Loading