chore(uniffi): Fully switch to uniffi proc macros#370
Open
Stackmator (stackmator) wants to merge 11 commits intomasterfrom
Open
chore(uniffi): Fully switch to uniffi proc macros#370Stackmator (stackmator) wants to merge 11 commits intomasterfrom
Stackmator (stackmator) wants to merge 11 commits intomasterfrom
Conversation
f0fb75a to
96d21a8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
15f3356 to
d67d4fd
Compare
This comment was marked as resolved.
This comment was marked as resolved.
1 similar comment
|
Codex Review: Didn't find any major issues. Can't wait for the next one! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback". |
|
Codex (@codex) review |
|
Codex Review: Didn't find any major issues. 🚀 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback". |
Hardcoded fallbacks diverged from defaults::ITERATIONS=2 (was 3), which would silently change derived keys for callers relying on builder defaults. Route all fallbacks through argon2parameters_defaults so bindings stay in sync with the core crate.
The autogenerated DevolutionsCryptoSwift.swift was removed, leaving the directory untracked. generate.sh copies the freshly generated bindings into Sources/DevolutionsCryptoSwift/ and Package.swift references that path as the target source — both break when the directory is absent after checkout.
The previous setup had two scaffolding calls — one in the core crate (emitting devolutions_crypto.*) and one in the wrapper crate (emitting devolutions_crypto_uniffi.*). Swift generate.sh only copied the former, silently dropping all wrapper Object types (Argon2Parameters, Ciphertext, SigningKeyPair, ...) from the Swift package. Revert all uniffi derives and scaffolding from the core crate, then re-declare the shared enums and Error in the wrapper crate via #[uniffi::remote(...)]. Single scaffolding, single namespace (devolutions_crypto_uniffi), all types in one module. Rename the Swift systemLibrary target directory, modulemaps, and generate.sh filename references to match.
The imports referenced a package that does not exist under the current bindgen config (uniffi.toml sets package_name = org.devolutions.crypto). The tests live in that same package, so no import is needed: - DataType resolves locally - bare Exception resolves to kotlin.Exception, which still catches DevolutionsCryptoException (the generated flat error).
The builder macro was replaced by hand-written Arc<Mutex<...>> builders in the wrapper crate, leaving the macro crate unreferenced.
2e50d22 to
e1c337e
Compare
Sébastien Duquette (sduquette-devolutions)
approved these changes
Apr 24, 2026
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.
Summary
build.rsscaffolding, the UDL file, and the in-treeuniffi-builder-macro.devolutions_crypto_uniffi). The coredevolutions-cryptocrate stays free of any UniFFI dep, feature, or derive; shared types (version enums,Error) are re-exposed in the wrapper crate via#[uniffi::remote(...)].Test plan
cargo check --workspaceandcargo clippy --workspacecleanwrappers/wasm/wasm_build.shproduces the four wasm-pack targets (bundler/nodejs/web/no-modules)wrappers/swift/generate.shemitsdevolutions_crypto_uniffi.swift+ matching.h/.modulemap, andswift testpasses on macOS./gradlew :lib:testpasses