-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: Added CI back for check_no_std
with compilation to wasm32
#9347
Conversation
@mattsse after this PR is merged, I can work on making |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this currently does not compile without default features because we need to use this combo:
thiserror-no-std = { workspace = true, default-features = false }
std = ["thiserror-no-std/std"]
@@ -33,7 +33,8 @@ secp256k1 = { workspace = true, features = [ | |||
"global-context", | |||
"recovery", | |||
"rand", | |||
] } | |||
], optional = true } | |||
k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need this if we're not using it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool! It would be great to have this in CI
# reth-revm | ||
) | ||
|
||
for package in "${no_std_packages[@]}"; do | ||
cmd="cargo +stable build -p $package --target riscv32imac-unknown-none-elf --no-default-features" | ||
cmd="cargo +stable build -p $package --target wasm32-wasi --no-default-features" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd="cargo +stable build -p $package --target wasm32-wasi --no-default-features" | |
cmd="cargo +stable build -p $package --target wasm32-wasip1 --no-default-features" |
wasm32-wasi
is being renamed to wasm32-wasip1
and will be removed
rust-lang/compiler-team#607
Previously the CI check for
check_no_std
was commented out, as theriscv32imac-unknown-none-elf
target doesn't come withstd
and there are many dependencies inreth
that don't supportno_std
, making it difficult to compile to this target.However, there are several embedded environments (namely zkVMs like SP1) that do support
std
, but do not (easily) support crates with embedded C++ dependencies (like secp256k1, or blst or z-std) and also do not support networking crates like socket. The zkVM embedded environment is therefore similar to a target likewasm32-wasi
which comes withstd
, but also does not support crates like secp256k1, blst and does not support networking crates.This PR adds back the
no_std
CI check but with thewasm32-wasi
target, which should be significantly easier to support within Reth and also will ensure that all relevant packages that might be used in a zkVM context can compile.With this PR,
reth-codecs
andreth-primitives-traits
compiles withno-default-features
towasm32-wasi
.reth-primitives
almost compiles withno-default-features
, but I'm running into this weird error that I was hoping @JackG-eth could help with since I saw he did the replacement ofthiserror_no_std::Error
everywhere.