Skip to content

Upgrade an existing project to capsule 0.10

Yin Guanhao edited this page May 9, 2023 · 2 revisions

In capsule 0.10, we have changed the rust recipe to build with cross (#84).

Here's how to upgrade an existing project to work with capsule 0.10:

  • Add a rust-toolchain file, specifying a recent nightly version, e.g. nightly-2023-04-20 (or a stable version if you are also upgrading ckb-std).

    (This replaces the toolchain option in capsule.toml.)

  • Add cross config file Cross.toml:

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

[target.riscv64imac-unknown-none-elf]
image = "nervos/ckb-riscv-gnu-toolchain:focal-20230214"

(This replaces the docker_image option in capsule.toml.)

  • Add strip = true in the [profile.release] section of Cargo.toml.

    (Previously this was accomplished by always passing -C link-arg=-s in RUSTFLAGS, now you are in control whether or how the release binary is stripped.)

  • Update version to 0.10.0 in capsule.toml.