Skip to content

Commit 459475f

Browse files
committed
feat: upgrade Chicory runtime to v1.4.0 and improve build configuration
• Upgrade Chicory WebAssembly runtime from version 1.3.0 to 1.4.0 • Update Chicory dependency artifact names to new stable packages: - Replace experimental aot-experimental with annotations - Replace host-module-annotations-experimental with chicory-compiler-maven-plugin - Replace host-module-processor-experimental with annotations-processor • Improve Spotless configuration with enhanced wildcard import detection: - Replace simple regex-based wildcard import removal with Groovy-based validation - Add clear error messages for wildcard imports requiring manual expansion • Add not-ci profile for automatic code formatting during local development • Update documentation references to point to current Chicory runtime compiler docs This upgrade modernizes the project's WebAssembly runtime dependencies and improves the developer experience by providing better build validation and automatic code formatting. The Chicory 1.4.0 upgrade brings performance improvements and stability enhancements to WebAssembly execution. Signed-off-by: Hiram Chirino <hiram@hiramchirino.com>
1 parent 50214f8 commit 459475f

File tree

4 files changed

+83
-40
lines changed

4 files changed

+83
-40
lines changed

pom.xml

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<junit.version>5.12.2</junit.version>
7373

7474
<!-- runtime versions -->
75-
<chicory.version>1.3.0</chicory.version>
75+
<chicory.version>1.4.0</chicory.version>
7676
<jersey.version>3.1.10</jersey.version>
7777
<jetty.version>11.0.25</jetty.version>
7878

@@ -112,11 +112,18 @@
112112
<formatJavadoc>false</formatJavadoc>
113113
</googleJavaFormat>
114114
<importOrder/>
115-
<replaceRegex>
116-
<name>Remove wildcard imports</name>
117-
<searchRegex>import\s+(?:static\s+)?[^\*\s]+\*;(\r\n|\r|\n)</searchRegex>
118-
<replacement>$1</replacement>
119-
</replaceRegex>
115+
<jsr223>
116+
<name>Wildcard Imports Not Allowed</name>
117+
<dependency>org.apache.groovy:groovy-jsr223:4.0.27</dependency>
118+
<engine>groovy</engine>
119+
<script>def pattern = ~/import\s+(?:static\s+)?[^\*\s]+\*;(\r\n|\r|\n)/
120+
def matcher = pattern.matcher(source)
121+
if (matcher.find()) {
122+
def importText = matcher.group().trim()
123+
throw new Exception("Wildcard imports not allowed:\n\n " + importText + "\n\nPlease fully expand the imports.\n")
124+
}
125+
source</script>
126+
</jsr223>
120127
<removeUnusedImports/>
121128
</java>
122129
<pom>
@@ -213,6 +220,15 @@
213220
<version>${checkstyle.version}</version>
214221
</dependency>
215222
</dependencies>
223+
<executions>
224+
<execution>
225+
<id>checkstyle</id>
226+
<goals>
227+
<goal>check</goal>
228+
</goals>
229+
<phase>validate</phase>
230+
</execution>
231+
</executions>
216232
</plugin>
217233
<plugin>
218234
<groupId>org.apache.maven.plugins</groupId>
@@ -230,6 +246,59 @@
230246
</build>
231247

232248
<profiles>
249+
<profile>
250+
<id>ci</id>
251+
<activation>
252+
<property>
253+
<name>env.CI</name>
254+
<value>true</value>
255+
</property>
256+
</activation>
257+
<build>
258+
<plugins>
259+
<plugin>
260+
<groupId>com.diffplug.spotless</groupId>
261+
<artifactId>spotless-maven-plugin</artifactId>
262+
<executions>
263+
<execution>
264+
<id>check-format</id>
265+
<goals>
266+
<goal>check</goal>
267+
</goals>
268+
<phase>process-sources</phase>
269+
</execution>
270+
</executions>
271+
</plugin>
272+
</plugins>
273+
</build>
274+
</profile>
275+
<profile>
276+
<id>not-ci</id>
277+
<activation>
278+
<property>
279+
<name>env.CI</name>
280+
<value>!true</value>
281+
</property>
282+
</activation>
283+
<build>
284+
<plugins>
285+
<plugin>
286+
<groupId>com.diffplug.spotless</groupId>
287+
<artifactId>spotless-maven-plugin</artifactId>
288+
<executions>
289+
<execution>
290+
<id>format</id>
291+
<goals>
292+
<goal>apply</goal>
293+
</goals>
294+
<phase>process-sources</phase>
295+
</execution>
296+
</executions>
297+
</plugin>
298+
</plugins>
299+
</build>
300+
</profile>
301+
233302
<profile>
234303
<id>release</id>
235304
<build>

proxy-wasm-java-host/pom.xml

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
<dependencies>
1717
<dependency>
1818
<groupId>com.dylibso.chicory</groupId>
19-
<artifactId>aot-experimental</artifactId>
19+
<artifactId>annotations</artifactId>
2020
<version>${chicory.version}</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.dylibso.chicory</groupId>
24-
<artifactId>host-module-annotations-experimental</artifactId>
24+
<artifactId>chicory-compiler-maven-plugin</artifactId>
2525
<version>${chicory.version}</version>
2626
</dependency>
2727
<dependency>
@@ -58,33 +58,6 @@
5858

5959
<build>
6060
<plugins>
61-
<plugin>
62-
<groupId>com.diffplug.spotless</groupId>
63-
<artifactId>spotless-maven-plugin</artifactId>
64-
<executions>
65-
<execution>
66-
<id>format</id>
67-
<goals>
68-
<goal>check</goal>
69-
</goals>
70-
<phase>process-sources</phase>
71-
</execution>
72-
</executions>
73-
</plugin>
74-
75-
<plugin>
76-
<groupId>org.apache.maven.plugins</groupId>
77-
<artifactId>maven-checkstyle-plugin</artifactId>
78-
<executions>
79-
<execution>
80-
<id>checkstyle</id>
81-
<goals>
82-
<goal>check</goal>
83-
</goals>
84-
<phase>validate</phase>
85-
</execution>
86-
</executions>
87-
</plugin>
8861

8962
<plugin>
9063
<groupId>org.apache.maven.plugins</groupId>
@@ -93,7 +66,7 @@
9366
<annotationProcessorPaths>
9467
<path>
9568
<groupId>com.dylibso.chicory</groupId>
96-
<artifactId>host-module-processor-experimental</artifactId>
69+
<artifactId>annotations-processor</artifactId>
9770
<version>${chicory.version}</version>
9871
</path>
9972
</annotationProcessorPaths>

proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/Plugin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,10 @@ public Builder withImportMemory(ImportMemory memory) {
301301
* The {@link Machine} controls the low-level execution of WASM instructions.
302302
* By default, an interpreter-based machine is used.
303303
* Providing a custom factory allows using alternative execution strategies, such as
304-
* Ahead-Of-Time (AOT) compilation to improve execution performance.
304+
* wasm to bytecode compilation to improve execution performance.
305305
*
306-
* <p>See the Chicory documentation (https://chicory.dev/docs/experimental/aot) for more details on Aot compilation.
306+
* <p>See the Chicory documentation (https://chicory.dev/docs/usage/runtime-compiler) for more details
307+
* on WASM to bytecode compilation and execution.
307308
*
308309
* @param machineFactory A function that takes a WASM {@link Instance} and returns a {@link Machine}.
309310
* @return this {@code Builder} instance for method chaining.

proxy-wasm-java-host/src/main/java/io/roastedroot/proxywasm/internal/ABI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import static io.roastedroot.proxywasm.internal.Helpers.split;
66
import static io.roastedroot.proxywasm.internal.Helpers.string;
77

8-
import com.dylibso.chicory.experimental.hostmodule.annotations.HostModule;
9-
import com.dylibso.chicory.experimental.hostmodule.annotations.WasmExport;
8+
import com.dylibso.chicory.annotations.HostModule;
9+
import com.dylibso.chicory.annotations.WasmExport;
1010
import com.dylibso.chicory.runtime.ExportFunction;
1111
import com.dylibso.chicory.runtime.Instance;
1212
import com.dylibso.chicory.runtime.Memory;

0 commit comments

Comments
 (0)