Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bindings] When running npm run build:update-bindings, misuse of FFI types from Rust causes warnings #1901

Open
Fizzixnerd opened this issue Nov 15, 2024 · 0 comments
Labels
low-priority Issues that specify low priority work

Comments

@Fizzixnerd
Copy link
Contributor

when run from nix develop o1js, there appears to be misuse/exporting of Rust-specific types in plonk_wasm.

Since the types are stored in ark_ff, it may be possible to avoid the warning by using a pointer instead of the actual field struct.

Feel free to close if this is just noise, but I thought I'd add it for completeness.

... <SNIP> ...

warning: unused manifest key: target.wasm32-unknown-unknown.rustflags
   Compiling plonk_wasm v0.1.0 (/home/fizzixnerd/src/o1js/_build/default/src/mina/src/lib/crypto/kimchi_bindings/wasm)
warning: `extern` fn uses type `ark_ff::Fp<MontBackend<FqConfig, 4>, 4>`, which is not FFI-safe
   --> src/projective.rs:130:9
    |
130 |         WasmPastaFp,
    |         ^^^^^^^^^^^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout
    = note: `#[warn(improper_ctypes_definitions)]` on by default

warning: `extern` fn uses type `ark_ff::Fp<MontBackend<FrConfig, 4>, 4>`, which is not FFI-safe
   --> src/projective.rs:128:9
    |
128 |         WasmPastaFq,
    |         ^^^^^^^^^^^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout

warning: `extern` fn uses type `ark_ff::Fp<MontBackend<FrConfig, 4>, 4>`, which is not FFI-safe
   --> src/projective.rs:149:9
    |
149 |         WasmPastaFq,
    |         ^^^^^^^^^^^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout

warning: `extern` fn uses type `ark_ff::Fp<MontBackend<FqConfig, 4>, 4>`, which is not FFI-safe
   --> src/projective.rs:147:9
    |
147 |         WasmPastaFp,
    |         ^^^^^^^^^^^ not FFI-safe
    |
    = help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
    = note: this struct has unspecified layout

warning: `plonk_wasm` (lib) generated 4 warnings

... <SNIP> ... 
@Fizzixnerd Fizzixnerd added the low-priority Issues that specify low priority work label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low-priority Issues that specify low priority work
Projects
None yet
Development

No branches or pull requests

1 participant