Skip to content

Commit 34b42f4

Browse files
committed
fix(isthmus): use reachability-metadata.json for native image build
The native image build passed GraalVM options that are now deprecated and emitted build warnings (issue #531): - -H:IncludeResources (resource inclusion) - -H:DynamicProxyConfigurationFiles (dynamic proxy config, via proxies.json) Both are replaced by a single declarative reachability-metadata.json on the classpath under META-INF/native-image/io.substrait/isthmus-cli/, which is the approach GraalVM now expects. Also: - Drop --report-unsupported-elements-at-runtime, itself deprecated and now a no-op (unsupported elements are always reported at run time). - Strip picocli-codegen's empty ([]) proxy-config.json after compile; its mere presence triggered the deprecated DynamicProxyConfigurationResources warning. reflect-config.json / resource-config.json (the real picocli metadata) are left intact. Verified with a native build (Oracle GraalVM 25.0.2): the build no longer emits any of these deprecation warnings, and smoke.sh / tpch_smoke.sh pass against the produced binary.
1 parent b370df5 commit 34b42f4

3 files changed

Lines changed: 224 additions & 34 deletions

File tree

isthmus-cli/build.gradle.kts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ graalvmNative {
5656
named("main") {
5757
imageName.set("isthmus")
5858
fallback.set(false)
59-
buildArgs.add("-H:IncludeResources=.*yaml")
60-
buildArgs.add("--report-unsupported-elements-at-runtime")
59+
// Resource inclusion and dynamic-proxy configuration are declared in
60+
// src/main/resources/META-INF/native-image/.../reachability-metadata.json, replacing the
61+
// deprecated -H:IncludeResources and -H:DynamicProxyConfigurationFiles flags (issue #531).
6162
buildArgs.add("-H:+ReportExceptionStackTraces")
62-
buildArgs.add("-H:DynamicProxyConfigurationFiles=${project.file("proxies.json")}")
6363
buildArgs.add("--features=io.substrait.isthmus.cli.RegisterAtRuntime")
6464
// Removed due to https://github.com/oracle/graal/issues/13316
6565
// buildArgs.add("--future-defaults=all")
@@ -98,7 +98,21 @@ tasks.register("writeIsthmusVersion") {
9898
}
9999
}
100100

101-
tasks.named("compileJava") { dependsOn("writeIsthmusVersion") }
101+
tasks.named<JavaCompile>("compileJava") {
102+
dependsOn("writeIsthmusVersion")
103+
// picocli-codegen emits an empty (`[]`) proxy-config.json because isthmus uses class-based
104+
// @Command annotations and needs no JDK dynamic proxies. Its mere presence makes GraalVM emit the
105+
// deprecated 'DynamicProxyConfigurationResources' warning (issue #531), so delete it after
106+
// compile.
107+
// reflect-config.json / resource-config.json (the real picocli metadata) are left untouched.
108+
doLast {
109+
destinationDirectory
110+
.file("META-INF/native-image/picocli-generated/proxy-config.json")
111+
.get()
112+
.asFile
113+
.delete()
114+
}
115+
}
102116

103117
tasks.named<Javadoc>("javadoc") {
104118
description = "Generate Javadoc for main source files (excludes generated)."

isthmus-cli/proxies.json

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
{
2+
"comment": "GraalVM reachability metadata for the isthmus native image. Replaces the deprecated -H:IncludeResources and -H:DynamicProxyConfigurationFiles build args (issue #531).",
3+
"resources": [
4+
{
5+
"glob": "**/*.yaml"
6+
}
7+
],
8+
"reflection": [
9+
{
10+
"type": {
11+
"proxy": [
12+
"org.apache.calcite.rel.metadata.BuiltInMetadata$AllPredicates$Handler"
13+
]
14+
}
15+
},
16+
{
17+
"type": {
18+
"proxy": [
19+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Collation$Handler"
20+
]
21+
}
22+
},
23+
{
24+
"type": {
25+
"proxy": [
26+
"org.apache.calcite.rel.metadata.BuiltInMetadata$ColumnOrigin$Handler"
27+
]
28+
}
29+
},
30+
{
31+
"type": {
32+
"proxy": [
33+
"org.apache.calcite.rel.metadata.BuiltInMetadata$ColumnUniqueness$Handler"
34+
]
35+
}
36+
},
37+
{
38+
"type": {
39+
"proxy": [
40+
"org.apache.calcite.rel.metadata.BuiltInMetadata$CumulativeCost$Handler"
41+
]
42+
}
43+
},
44+
{
45+
"type": {
46+
"proxy": [
47+
"org.apache.calcite.rel.metadata.BuiltInMetadata$DistinctRowCount$Handler"
48+
]
49+
}
50+
},
51+
{
52+
"type": {
53+
"proxy": [
54+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Distribution$Handler"
55+
]
56+
}
57+
},
58+
{
59+
"type": {
60+
"proxy": [
61+
"org.apache.calcite.rel.metadata.BuiltInMetadata$ExplainVisibility$Handler"
62+
]
63+
}
64+
},
65+
{
66+
"type": {
67+
"proxy": [
68+
"org.apache.calcite.rel.metadata.BuiltInMetadata$ExpressionLineage$Handler"
69+
]
70+
}
71+
},
72+
{
73+
"type": {
74+
"proxy": [
75+
"org.apache.calcite.rel.metadata.BuiltInMetadata$FunctionalDependency$Handler"
76+
]
77+
}
78+
},
79+
{
80+
"type": {
81+
"proxy": [
82+
"org.apache.calcite.rel.metadata.BuiltInMetadata$InputFieldsUsed$Handler"
83+
]
84+
}
85+
},
86+
{
87+
"type": {
88+
"proxy": [
89+
"org.apache.calcite.rel.metadata.BuiltInMetadata$LowerBoundCost$Handler"
90+
]
91+
}
92+
},
93+
{
94+
"type": {
95+
"proxy": [
96+
"org.apache.calcite.rel.metadata.BuiltInMetadata$MaxRowCount$Handler"
97+
]
98+
}
99+
},
100+
{
101+
"type": {
102+
"proxy": [
103+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Measure$Handler"
104+
]
105+
}
106+
},
107+
{
108+
"type": {
109+
"proxy": [
110+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Memory$Handler"
111+
]
112+
}
113+
},
114+
{
115+
"type": {
116+
"proxy": [
117+
"org.apache.calcite.rel.metadata.BuiltInMetadata$MinRowCount$Handler"
118+
]
119+
}
120+
},
121+
{
122+
"type": {
123+
"proxy": [
124+
"org.apache.calcite.rel.metadata.BuiltInMetadata$NodeTypes$Handler"
125+
]
126+
}
127+
},
128+
{
129+
"type": {
130+
"proxy": [
131+
"org.apache.calcite.rel.metadata.BuiltInMetadata$NonCumulativeCost$Handler"
132+
]
133+
}
134+
},
135+
{
136+
"type": {
137+
"proxy": [
138+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Parallelism$Handler"
139+
]
140+
}
141+
},
142+
{
143+
"type": {
144+
"proxy": [
145+
"org.apache.calcite.rel.metadata.BuiltInMetadata$PercentageOriginalRows$Handler"
146+
]
147+
}
148+
},
149+
{
150+
"type": {
151+
"proxy": [
152+
"org.apache.calcite.rel.metadata.BuiltInMetadata$PopulationSize$Handler"
153+
]
154+
}
155+
},
156+
{
157+
"type": {
158+
"proxy": [
159+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Predicates$Handler"
160+
]
161+
}
162+
},
163+
{
164+
"type": {
165+
"proxy": [
166+
"org.apache.calcite.rel.metadata.BuiltInMetadata$RowCount$Handler"
167+
]
168+
}
169+
},
170+
{
171+
"type": {
172+
"proxy": [
173+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Selectivity$Handler"
174+
]
175+
}
176+
},
177+
{
178+
"type": {
179+
"proxy": [
180+
"org.apache.calcite.rel.metadata.BuiltInMetadata$Size$Handler"
181+
]
182+
}
183+
},
184+
{
185+
"type": {
186+
"proxy": [
187+
"org.apache.calcite.rel.metadata.BuiltInMetadata$TableReferences$Handler"
188+
]
189+
}
190+
},
191+
{
192+
"type": {
193+
"proxy": [
194+
"org.apache.calcite.rel.metadata.BuiltInMetadata$UniqueKeys$Handler"
195+
]
196+
}
197+
},
198+
{
199+
"type": {
200+
"proxy": [
201+
"org.apache.calcite.runtime.CalciteResource"
202+
]
203+
}
204+
}
205+
]
206+
}

0 commit comments

Comments
 (0)