-
Notifications
You must be signed in to change notification settings - Fork 360
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
Implement checks to identify dependencies that do not support no_std
#1250
Conversation
Update for |
|
Adding |
https://github.com/octopus-network/substrate/tree/dv-check-support-no-std I tested it here by switching to dv-check-support-no-std branch and running |
@soareschen What's the next step here? |
I think we can merge this so that we can track the support in the main branch. |
Part of #1158
Description
This PR adds new check scripts in the
no-std-check
sub-project to check for no_std and Substrate compliance for ibc-rs. Through the checks, I have identified the following dependencies that are not supported on no_std or Substrate:tonic
socket2
getrandom
serde
serde_json
ics23
regex
Check Scripts
I have implemented the following check scripts in Makefile to check for different modes of no_std compliance:
check-panic-conflict
- Check forno_std
compliance by installing a panic handler, and any other crate importingstd
will cause a conflict. Runs on default target.check-cargo-build-std
- Check forno_std
compliance using Cargo nightly'sbuild-std
feature. Runs on the targetx86_64-unknown-linux-gnu
.check-wasm
- Check for WebAssembly andno_std
compliance by building on the targetwasm32-unknown-unknown
and installing a panic handler.check-substrate
- Check for Substrate, WebAssembly, andno_std
compliance by importing Substrate crates and building onwasm32-unknown-unknown
. Any crate usingstd
will cause a conflict on the panic and out-of-memory (OOM) handlers installed bysp-io
.In particular, if we want to support ibc-rs on Substrate, then the
check-substrate
script must pass. There is additional complication that the check is done on Wasm target, and not all crate supports Wasm. In particular, theserde
crate passes theno_std
check when built on x86 and Wasm targets, but curiously fails the check when the Substrate runtime is linked.With the check scripts in place, our goal is fix the dependencies issue in several ways:
@DaviRain-Su if possible, we prefer the no_std support to be fixed upstream so that minimal changes need to be done on our side. Other than
tonic
, can you check with each of the listed projects and find out if there is any way to have those packages supported on no_std as well as Substrate?For contributor use:
unclog
.docs/
) and code comments.Files changed
in the Github PR explorer.