-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump the minimum GraalVM CE version supported by compiling to GraalVM…
… Native Image to JDK 23.0.1
- Loading branch information
1 parent
b880850
commit 3be51e1
Showing
12 changed files
with
15,365 additions
and
6,075 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 22.0.2,对应于 SDKMAN! 的 `22.0.2-graalce` | ||
- GraalVM CE For JDK 23.0.1,对应于 SDKMAN! 的 `23.0.1-graalce` | ||
|
||
用户依然可以使用 SDKMAN! 上的 `21.0.2-graalce` 等旧版本的 GraalVM CE 来构建 ShardingSphere 的 GraalVM Native Image 产物。 | ||
但这将导致集成部分第三方依赖时,构建 GraalVM Native Image 失败。 | ||
|
@@ -184,7 +184,7 @@ rules: | |
algorithmClassName: org.example.test.TestShardingAlgorithmFixture | ||
``` | ||
在 `src/main/resources/META-INF/native-image/exmaple-test-metadata/reflect-config.json` 加入如下内容即可在正常在 GraalVM Native | ||
在 `src/main/resources/META-INF/native-image/exmaple-test-metadata/reachability-metadata.json` 加入如下内容即可在正常在 GraalVM Native | ||
Image 下使用。 | ||
|
||
```json | ||
|
@@ -245,7 +245,7 @@ Caused by: java.io.UnsupportedEncodingException: Codepage Cp1252 is not supporte | |
或将对应 JSON 提交到 https://github.com/oracle/graalvm-reachability-metadata 一侧。 | ||
|
||
以 `com.mysql:mysql-connector-j:9.0.0` 的 `com.mysql.cj.jdbc.MysqlXADataSource` 类为例,这是 MySQL JDBC Driver 的 `javax.sql.XADataSource` 的实现。 | ||
用户需要在自有项目的 claapath 的 `/META-INF/native-image/com.mysql/mysql-connector-j/9.0.0/` 文件夹的 `reflect-config.json`文件内定义如下 JSON, | ||
用户需要在自有项目的 claapath 的 `/META-INF/native-image/com.mysql/mysql-connector-j/9.0.0/` 文件夹的 `reachability-metadata.json`文件内定义如下 JSON, | ||
以在 GraalVM Native Image 内部定义 `com.mysql.cj.jdbc.MysqlXADataSource` 的构造函数。 | ||
|
||
```json | ||
|
@@ -354,8 +354,8 @@ ShardingSphere 定义了 `nativeTestInShardingSphere` 的 Maven Profile 用于 | |
sudo apt install unzip zip -y | ||
curl -s "https://get.sdkman.io" | bash | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
sdk install java 22.0.2-graalce | ||
sdk use java 22.0.2-graalce | ||
sdk install java 23.0.1-graalce | ||
sdk use java 23.0.1-graalce | ||
sudo apt-get install build-essential zlib1g-dev -y | ||
git clone [email protected]:apache/shardingsphere.git | ||
|
@@ -394,26 +394,15 @@ cd ./shardingsphere/ | |
|
||
受 https://github.com/apache/shardingsphere/issues/33206 影响, | ||
贡献者执行 `./mvnw -PgenerateMetadata -DskipNativeTests -T 1C -e clean test native:metadata-copy` 后, | ||
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json` 会生成不必要的包含绝对路径的 JSON 条目, | ||
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json` 会生成不必要的包含绝对路径的 JSON 条目, | ||
类似如下, | ||
|
||
```json | ||
{ | ||
"resources":{ | ||
"includes":[{ | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/postgresql//global.yaml\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/postgresql/\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/features/sharding//global.yaml\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/features/sharding/\\E" | ||
}]}, | ||
"bundles":[] | ||
"condition": { | ||
"typeReached": "org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader" | ||
}, | ||
"glob": "home/root/TwinklingLiftWorks/git/public/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/mysql/" | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 22.0.2, corresponding to `22.0.2-graalce` of SDKMAN! | ||
- GraalVM CE For JDK 23.0.1, corresponding to `23.0.1-graalce` of SDKMAN! | ||
|
||
Users can still use the old versions of GraalVM CE such as `21.0.2-graalce` on SDKMAN! to build the GraalVM Native Image product of ShardingSphere. | ||
However, this will cause the failure of building the GraalVM Native Image when integrating some third-party dependencies. | ||
|
@@ -190,7 +190,7 @@ rules: | |
algorithmClassName: org.example.test.TestShardingAlgorithmFixture | ||
``` | ||
|
||
Add the following content to `src/main/resources/META-INF/native-image/exmaple-test-metadata/reflect-config.json` to used | ||
Add the following content to `src/main/resources/META-INF/native-image/exmaple-test-metadata/reachability-metadata.json` to used | ||
normally under GraalVM Native Image. | ||
|
||
```json | ||
|
@@ -258,7 +258,7 @@ or the corresponding JSON should be submitted to https://github.com/oracle/graal | |
|
||
Take the `com.mysql.cj.jdbc.MysqlXADataSource` class of `com.mysql:mysql-connector-j:9.0.0` as an example, | ||
which is the implementation of `javax.sql.XADataSource` of MySQL JDBC Driver. | ||
Users need to define the following JSON in the `reflect-config.json` file in the `/META-INF/native-image/com.mysql/mysql-connector-j/9.0.0/` folder of their own project's claapath, | ||
Users need to define the following JSON in the `reachability-metadata.json` file in the `/META-INF/native-image/com.mysql/mysql-connector-j/9.0.0/` folder of their own project's claapath, | ||
to define the constructor of `com.mysql.cj.jdbc.MysqlXADataSource` inside the GraalVM Native Image. | ||
|
||
```json | ||
|
@@ -369,8 +369,8 @@ Assuming that the contributor is under a new Ubuntu 22.04.4 LTS instance, Contri | |
sudo apt install unzip zip -y | ||
curl -s "https://get.sdkman.io" | bash | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
sdk install java 22.0.2-graalce | ||
sdk use java 22.0.2-graalce | ||
sdk install java 23.0.1-graalce | ||
sdk use java 23.0.1-graalce | ||
sudo apt-get install build-essential zlib1g-dev -y | ||
git clone [email protected]:apache/shardingsphere.git | ||
|
@@ -410,26 +410,15 @@ cd ./shardingsphere/ | |
|
||
Affected by https://github.com/apache/shardingsphere/issues/33206 , | ||
After the contributor executes `./mvnw -PgenerateMetadata -DskipNativeTests -T 1C -e clean test native:metadata-copy`, | ||
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/resource-config.json` will generate unnecessary JSON entries containing absolute paths, | ||
`infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json` will generate unnecessary JSON entries containing absolute paths, | ||
similar to the following. | ||
|
||
```json | ||
{ | ||
"resources":{ | ||
"includes":[{ | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/postgresql//global.yaml\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/postgresql/\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/features/sharding//global.yaml\\E" | ||
}, { | ||
"condition":{"typeReachable":"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"}, | ||
"pattern":"\\Qhome/runner/work/shardingsphere/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/features/sharding/\\E" | ||
}]}, | ||
"bundles":[] | ||
"condition": { | ||
"typeReached": "org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader" | ||
}, | ||
"glob": "home/root/TwinklingLiftWorks/git/public/shardingsphere/test/native/src/test/resources/test-native/yaml/proxy/databases/mysql/" | ||
} | ||
``` | ||
|
||
|
43 changes: 0 additions & 43 deletions
43
...NF/native-image/org.apache.shardingsphere/generated-reachability-metadata/jni-config.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
.../org.apache.shardingsphere/generated-reachability-metadata/predefined-classes-config.json
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
.../native-image/org.apache.shardingsphere/generated-reachability-metadata/proxy-config.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.