nervosnetwork / capsule

Capsule is an out-of-box development framework for creating smart contract on Nervos' CKB.
MIT License
60 stars 34 forks source link

[Help Wanted] What's the best practices to setup the local development environment ro capsule project? #110

Closed doitian closed 1 year ago

doitian commented 1 year ago

What's the best practices to setup the local development environment so that

My current approach:

This is not perfect, I still got errors like

found duplicate lang item `oom`
the lang item is first defined in crate `std` (which `test` depends on)
first definition in `std` loaded from /home/gitpod/.rustup/toolchains/nightly-2022-08-01-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-c28e44e30a7ed831.rlib
second definition in the local crate (`...`)

But at least, I have a working rustfmt and rust-analyzer in the project.

I know I should use the target riscv64-unknown-elf-gcc instead of the host default target, but I don't know how to setup all the required packages.

blckngm commented 1 year ago

Have you tried the latest develop branch? I have fixed rust-analyzer “duplicate lang item” errors by adding cfg(test). Running cargo clippy or cross clippy is also supported.

doitian commented 1 year ago

I tried develop branch. Rust-analyzer is green and rustfmt works. 👍