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

guest can't use serde #394

Open
sid-alluri opened this issue Jun 16, 2024 · 1 comment
Open

guest can't use serde #394

sid-alluri opened this issue Jun 16, 2024 · 1 comment

Comments

@sid-alluri
Copy link

I am trying to read some JSON files from the guest using serde_json, which is leading to an error. Instead of reading from the guest, I can read the data from the host and send it to the guest. I am using a custom struct to read the data and ideally would want to pass it to the guest (as it has many fields). But to do that, I need serde Serialize, Deserialize to make the struct serializable, which again causes the same error.

The error:

error[E0152]: found duplicate lang item `panic_impl`
  --> guest/src/lib.rs:44:1
   |
44 | #[jolt::provable]
   | ^^^^^^^^^^^^^^^^^
   |
   = note: the lang item is first defined in crate `std` (which `serde` depends on)
   = note: first definition in `std` loaded from /Users/alluri/.jolt/rust/build/host/stage2/lib/rustlib/riscv32i-jolt-zkvm-elf/lib/libstd-8cbddb4876a7be76.rlib
   = note: second definition in the local crate (`guest`)
   = note: this error originates in the attribute macro `jolt::provable` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0152`.
error: could not compile `guest` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

how can I resolve this? thanks.

@moodlezoup
Copy link
Collaborator

Is there a reason why you aren't passing the struct directly from host to guest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants