- Added
nullness_annotationsconfig option to emit JSpecify@NullMarkedand@Nullableannotations in generated code. When enabled, RustOption<T>maps to@Nullable Tand all other types are non-null by default. Requiresorg.jspecify:jspecifyon the compile classpath.
- fix resolving callback trait implementations declared in submodules of the current crate. Previously, traits like
my_crate::metrics::MetricsRecorderfailed with "no interface with module_path" during code generation. - fix Java keyword collisions in generated callback helper class names. Callback methods named after Java keywords (e.g.,
record) no longer produce invalid nested type declarations. Thanks @criccomini for this and the above fix! - fix
libraryOverridesystem property to work with absolute paths. Previously, passing an absolute path via-Duniffi.component.<namespace>.libraryOverride=/path/to/lib.sowould fail because it was always passed toSystem.loadLibrary(). Now absolute paths are correctly routed toSystem.load().
- switched from JNA generated bindings to FFM ones. Benchmarked performance speedup (via upstream benchmark suite) is from 4.2x-426x.
- the "major" (pre-release) bump is primarily because the switch from JNA to FFM is so foundational.
- Java 22+ is required (though 21+ could work using preview features).
- remove spinlock where Java checks for Rust future completion (uses a thenCompose based CF chain to prevent unnecessary blocking)
- generate overloads for async functions that accept and use a custom Executor
- update to uniffi 0.31.0
- switched to the new BindgenPaths API for generation internally
- support methods on records and enums
- multiple bugfixes ported from Kotlin changes
- fully qualified all
java.langtype use in templates to simplify imports and avoid potential name collisions - added
omit_checksumsconfig option, see the kotlin doc about it. - support the
renameconfig option, see the docs. - Uniffi trait methods
- don't strip prefix on Error names #38
- method checksums change (since we skipped over 0.30.0 this is only theoretically breaking)
--lib-fileand--libraryCLI generator options removed, they're both now automatically detected by uniffi- Java callback interface implementations must now use primitive types (e.g.,
int,long,boolean) instead of boxed types (Integer,Long,Boolean) for non-optional primitive parameters and return types - use Java primitive types (
int,long,boolean, etc.) instead of boxed types (Integer,Long,Boolean) for non-optional primitive parameters, return types, and record fields. Optional primitives and primitives in generic contexts (e.g.,List<Integer>,CompletableFuture<Integer>) still use boxed types as required by Java. - use primitive arrays where possible (similar to how
Vec<u8> -> bytes[]). This should reduce GC pressure and speed up copies across the boundary viaAsBufferinstead of iteration. There's a potentially small ergonomic hit to those doing a lot of data transformation, not just passing values to and from the Rust side. If you're someone this negatively impacts, reach out and we can talk about adding ause_primitive_arraysconfig option.
- Fix
OptionalTemplatemissing potential imports ofjava.util.Listandjava.util.Map
- Update to uniffi 0.29.2
- Consumes a uniffi fix to Python bindgen that was affecting
ironcore-alloy(PR #2512)
Consumers will also need to update to uniffi 0.29.2.
- Update to uniffi 0.29.1
- Fix a potential memory leak in arrays and maps reported in uniffi proper. A similar fix to the one for Kotlin applied here.
Consumers will also need to update to uniffi 0.29.1, but there will be no changes required to their code.
Initial pre-release. This library will be used to provide Java bindings for IronCore Alloy. It will recieve frequent breaking changes initially as we find improvements through that libaries' usage of it.