The GitHub Actions job "Fory CI" on fory.git/main has succeeded.
Run started by GitHub user chaokunyang (triggered by chaokunyang).

Head commit for run:
fb311aa0609480199ffaec3ca56a8001453dd0fb / Shawn Yang <[email protected]>
feat(java): support Fory JSON in GraalVM native image (#3846)

## Why?

Fory JSON generates codecs from each `ForyJsonBuilder` configuration.
Those configurations affect
field discovery, naming, null handling, custom codecs, and generated
source, so one codec generated
during Native Image construction cannot represent every runtime builder.
Native executables also
cannot run the existing runtime compiler.

This change supports the complete interpreted JSON codec path in GraalVM
Native Image while keeping
ordinary JVM code generation enabled and unchanged.

## What does this PR do?

- adds the non-inherited `@JsonType` marker for reachable native JSON
object models;
- adds an automatically activated MR-JAR Native Image Feature that
registers the reflection,
constructor, unsafe-field, record, container, built-in, and
annotation-codec metadata used by the
  interpreted path;
- supports declaration, inherited, nested type-use, record, accessor,
and creator `@JsonCodec`
  locations without constructing codecs at image build time;
- disables JSON runtime code generation and asynchronous compilation
only inside native images;
- preserves every other `ForyJsonBuilder` option for independently
configured runtime instances;
- adds classpath and JPMS GraalVM acceptance coverage, MR-JAR/source-JAR
verification, and user
  documentation.

The hosted scanner reuses the existing Fory core metadata owner and the
effective JSON-member
classification owned by `ObjectCodecBuilder`. Hosted work does not enter
serialization or
deserialization hot paths, and the ordinary-JDK builder loop remains
unchanged.

## Related issues

None.

## AI Contribution Checklist

## Does this PR introduce any user-facing change?

- [x] Does this PR introduce any public API change? Adds `@JsonType`.
- [ ] Does this PR introduce any binary protocol compatibility change?

## Validation

- `cd java && ENABLE_FORY_DEBUG_OUTPUT=1 mvn -T8 -pl fory-core,fory-json
-am test`
  - Fory core: 2,184 tests, 0 failures
  - Fory JSON: 593 tests, 0 failures
- GraalVM 21 classpath native package/run: passed, `Fory JSON succeed`
- GraalVM 21 JPMS native package/run: passed, `Fory JSON succeed`
- GraalVM 25 classpath native package/run: passed, `Fory JSON succeed`
- GraalVM 25 JPMS native package/run: passed, `Fory JSON succeed`
- Fory JSON MR-JAR and source-JAR verification: passed
- Java and integration Spotless checks: passed
- Markdown Prettier and `git diff --check`: passed

## Benchmark

Not applicable. The change adds Native Image hosted metadata discovery
and native-only builder
resolution. It does not change ordinary JVM
serialization/deserialization hot paths, and no new
runtime allocation is introduced there.

Report URL: https://github.com/apache/fory/actions/runs/29385190200

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to