Upgrade to uniffi 0.32.0 - #98
Open
kixelated wants to merge 1 commit into
Open
Conversation
kixelated
commented
Aug 20, 2026
| impl_code_type_for_compound!(SequenceCodeType, "[]{}", "Sequence{}"); | ||
| // Go has no set type, so a `HashSet<T>` becomes the idiomatic `map[T]struct{}`. Rust's | ||
| // `Hash + Eq` is wider than Go's comparable types, so an inner type rendering as a slice | ||
| // or map produces Go that does not compile. `MapCodeType` keys have the same bound and |
Author
There was a problem hiding this comment.
specifically, HashSet<Vec<u8>> is problematic in Go.
The metadata encoding changed in uniffi 0.32 even though the contract version
did not, so v0.7.1+v0.31.0 cannot read a 0.32-built cdylib at all: it fails with
"Invalid string data" while extracting the first constructor's metadata.
Three things needed porting:
- Config now loads through `GlobalConfig` (uniffi #2866). `--config` takes a
global config file with `[defaults]`, `[crates.<name>]`, and `[crate-roots]`
sections rather than a flat `uniffi.toml`-shaped override, and
`BindgenLoader::new` takes the parsed config. `fixtures/uniffi.toml` moves to
the new shape.
- `Type::Set` is new. Go has no set type, so a `HashSet<T>` renders as the
idiomatic `map[T]struct{}`; the wire format is identical to a sequence.
- `Type::Box` is new. It exists only for scaffolding, so it renders as its
inner type.
The uniffi example and fixture crates move to the v0.32.0 tag so the fixture
library carries one metadata version rather than a 0.31/0.32 mix.
The generator's own `toml` dependency widens to `>=0.9, <2`, matching what
uniffi_bindgen declares. That range spans two semver-incompatible majors, so a
narrower range here lets cargo resolve a second `toml` and `toml::Value` stops
being one type. This is what a `cargo install` without `--locked` hits, and it
is the `new_config` build error reported in NordSecurity#96 rather than an API change.
MSRV goes to 1.91, which uniffi 0.32 requires.
Signed-off-by: Luke Curley <kixelated@gmail.com>
|
For what it's worth, I tested this out and nothing seems to be broken: Though we don't use any of the new types. |
maksym-neboha
added a commit
to UTEXO-Protocol/rgb-lib-go
that referenced
this pull request
Sep 3, 2026
- Switch uniffi-bindgen-go to kixelated's fork (uniffi 0.32 support, NordSecurity/uniffi-bindgen-go#98) while upstream hasn't released +v0.32.0 - Add SSH host-alias setup with IdentitiesOnly so Cargo fetches rgb-consensus-s-bfa, rgb-ops-s-bfa, rgb-schemas-s-bfa using the correct per-repo deploy key (no key ambiguity) - Rewrite HTTPS BFA URLs to SSH aliases via git url.insteadOf - Set CARGO_NET_GIT_FETCH_WITH_CLI=true so system git respects SSH config
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(AI generated, human reviewed)
The metadata encoding changed in uniffi 0.32 even though the contract version did not, so v0.7.1+v0.31.0 cannot read a 0.32-built cdylib at all: it fails with "Invalid string data" while extracting the first constructor's metadata.
Three things needed porting:
GlobalConfig(uniffi #2866).--configtakes a global config file with[defaults],[crates.<name>], and[crate-roots]sections rather than a flatuniffi.toml-shaped override, andBindgenLoader::newtakes the parsed config.fixtures/uniffi.tomlmoves to the new shape.Type::Setis new. Go has no set type, so aHashSet<T>renders as the idiomaticmap[T]struct{}; the wire format is identical to a sequence.Type::Boxis new. It exists only for scaffolding, so it renders as its inner type.The uniffi example and fixture crates move to the v0.32.0 tag so the fixture library carries one metadata version rather than a 0.31/0.32 mix.
MSRV goes to 1.91, which uniffi 0.32 requires.