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

sr-eth-primitives no_std support error? #117

Closed
hackfisher opened this issue Nov 26, 2019 · 8 comments
Closed

sr-eth-primitives no_std support error? #117

hackfisher opened this issue Nov 26, 2019 · 8 comments

Comments

@hackfisher
Copy link
Contributor

error: failed to run custom build command for `node-runtime v0.1.0 (/Users/denny/github.com/darwinia-network/darwinia/node/runtime)`

Caused by:
  process didn't exit successfully: `/Users/denny/github.com/darwinia-network/darwinia/target/release/build/node-runtime-f7eaf2f8b8370061/build-script-build` (exit code: 1)
--- stdout
Executing build command: "cargo" "build" "--target=wasm32-unknown-unknown" "--manifest-path=/Users/denny/github.com/darwinia-network/darwinia/target/release/wbuild/node-runtime/Cargo.toml" "--release"

--- stderr
   Compiling wasm-build-runner-impl v1.0.0 (/Users/denny/github.com/darwinia-network/darwinia/target/release/wbuild-runner/node-runtime)
    Finished release [optimized] target(s) in 0.29s
     Running `/Users/denny/github.com/darwinia-network/darwinia/target/release/wbuild-runner/node-runtime/target/release/wasm-build-runner-impl`
   Compiling keccak-hash v0.4.1
   Compiling sr-io v2.0.0 (https://github.com/darwinia-network/substrate.git?branch=darwinia-develop#d2c4b0db)
error[E0152]: duplicate lang item found: `panic_impl`.
   --> /Users/denny/.cargo/git/checkouts/substrate-a7fa553ead635512/d2c4b0d/core/sr-io/src/lib.rs:737:1
    |
737 | / pub fn panic(info: &core::panic::PanicInfo) -> ! {
738 | |     unsafe {
739 | |         let message = rstd::alloc::format!("{}", info);
740 | |         misc::print_utf8(message.as_bytes());
741 | |         core::intrinsics::abort()
742 | |     }
743 | | }
    | |_^
    |
    = note: first defined in crate `std` (which `parity_scale_codec` depends on).

error[E0152]: duplicate lang item found: `oom`.
   --> /Users/denny/.cargo/git/checkouts/substrate-a7fa553ead635512/d2c4b0d/core/sr-io/src/lib.rs:747:1
    |
747 | / pub extern fn oom(_: core::alloc::Layout) -> ! {
748 | |     static OOM_MSG: &str = "Runtime memory exhausted. Aborting";
749 | |
750 | |     unsafe {
...   |
753 | |     }
754 | | }
    | |_^
    |
    = note: first defined in crate `std` (which `parity_scale_codec` depends on).

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0152`.
error: could not compile `sr-io`.
@hackfisher
Copy link
Contributor Author

@AurevoirXavier
Copy link
Member

Yes. I mark them as FIXME in xavier-no_std-support-check.

@hackfisher
Copy link
Contributor Author

➜  sr-eth-primitives git:(denny_fixing_ethereum_bridge) ✗ cargo check --target thumbv7m-none-eabi
warning: /Users/denny/github.com/darwinia-network/darwinia/core/sr-eth-primitives/Cargo.toml: unused manifest key: dependencies.ethereum-types.default-feature
warning: /Users/denny/github.com/darwinia-network/darwinia/core/sr-eth-primitives/Cargo.toml: unused manifest key: dependencies.primitive-types.default-feature
    Checking rustc-hex v2.0.1
    Checking bitvec v0.15.2
    Checking byte-slice-cast v0.3.4
    Checking sr-std v2.0.0 (https://github.com/darwinia-network/substrate.git?branch=darwinia-develop#d2c4b0db)
    Checking c2-chacha v0.2.3
   Compiling crunchy v0.2.2
   Compiling tiny-keccak v2.0.1
    Checking getrandom v0.1.13
    Checking byteorder v1.3.2
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `sr-std`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `rustc-hex`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `byte-slice-cast`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `c2-chacha`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `crunchy`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
 --> /Users/denny/.cargo/registry/src/github.com-1ecc6299db9ec823/getrandom-0.1.13/src/error_impls.rs:8:1
  |
8 | extern crate std;
  | ^^^^^^^^^^^^^^^^^ can't find crate
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `getrandom`.
warning: build failed, waiting for other jobs to finish...
error: could not compile `byteorder`.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `std`
  |
  = note: the `thumbv7m-none-eabi` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `bitvec`.

To learn more, run the command again with --verbose.

@AurevoirXavier
Copy link
Member

why use thumbv7m-none-eabi toolchain?

@hackfisher
Copy link
Contributor Author

why use thumbv7m-none-eabi toolchain?

It seems that wasm32-unknown-unknown can also support std (from the doc, not sure):

https://users.rust-lang.org/t/solved-how-to-troubleshoot-why-and-prevent-cargo-rustc-links-in-crate-std-when-no-std-is-specified/25233/3

https://forge.rust-lang.org/release/platform-support.html

@hackfisher
Copy link
Contributor Author

hackfisher commented Nov 27, 2019

I made it get compiled under target wasm32-unknown-unknown in branch: denny_fixing_ethereum_bridge,

But this issue still occurs.

@sekisamu
Copy link
Contributor

yes, wasm32-unknown-unknown also supports std. @hackfisher could you merge your branch denny_fixing_ethereum_bridge into develop?

@hackfisher
Copy link
Contributor Author

yes, wasm32-unknown-unknown also supports std. @hackfisher could you merge your branch denny_fixing_ethereum_bridge into develop?

#118

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

3 participants