-
Notifications
You must be signed in to change notification settings - Fork 338
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 fails to build crossbeam due to atomics #444
Labels
rust guest workarounds
A rust crate is not working on the guest
Comments
SchmErik
added
the
rust guest workarounds
A rust crate is not working on the guest
label
Mar 16, 2023
Running into a similar issue from the Radium 0.7.0 crate:
|
This is a separate issue and I wrote a work around here #549 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Crate Name:
crossbeam
https://crates.io/crates/crossbeamDescription of Error
Rust's
crossbeam
crate is used for concurrent programming. Because the zkvm is single threaded, it's likely that users do not depend on crossbeam directly. However, the are crates such as bevy-ecs depend on thecrossbeam-utils
orcrossbeam-channels
. When trying to build these crates you may see errors like this:This occurs because crossbeam makes an assumption that risc0 zkvm supports 64 bit atomics (which it does not).
Workarounds
As a temporary workaround, when using crates that depend on
crossbeam-utils
orcrossbeam-channels
, use risc0's fork of crossbeam by adding the following line under the[patch.crates-io]
section in yourCargo.toml
file.After adding this patch, run
cargo update
inside the guest directory to update the dependencies!Long term solution(s)
Add the risc0 zkvm target triple to upstream rustc. crossbeam uses rustc to dump all supported targets and their configurations to determine the max atomic support. Note: risc0's zkvm is single-threaded, non-preemptive, and does not reorder instructions so we don't need atomics instructions or fence instructions.
The text was updated successfully, but these errors were encountered: