nervosnetwork / capsule

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

Consider building rust contracts with cross #84

Closed blckngm closed 1 year ago

blckngm commented 1 year ago

Pros:

~It mostly already works, I had to make one small change to cross:~

~https://github.com/cross-rs/cross/commit/c632612f99f7387d18d8eac0550b2a96596e1f2e~

Add this configuration (Cross.toml) to a capsule project:

[build]
default-target = "riscv64imac-unknown-none-elf"

[target.riscv64imac-unknown-none-elf]
# Both image works
# image = "thewawar/ckb-capsule:2022-08-01"
image = "nervos/ckb-riscv-gnu-toolchain:focal-20230214"

Then I can cross +nightly build -p some_contract

blckngm commented 1 year ago

Shouldn't break reproducible build as long as the same rust version, options and image is used.

blckngm commented 1 year ago

Cons:

blckngm commented 1 year ago

It works with cross main branch now.

blckngm commented 1 year ago

Cross also supports path deps outside of the project dir.