CosmWasm / optimizer

Dockerfile and script to deterministically produce the smallest possible Wasm for your Rust contract
Apache License 2.0
123 stars 60 forks source link

Getting base16ct error #85

Closed mikedotexe closed 2 years ago

mikedotexe commented 2 years ago

I am not sure if this is my Rust setup, but I am consistently trying to run:

docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.3 ./contracts/*/

in the cw-contracts repo and getting:

error: failed to download `base16ct v0.1.1`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/base16ct-0.1.1/Cargo.toml`

Caused by:
  feature `edition2021` is required

  The package requires the Cargo feature called `edition2021`, but that feature is not stabilized in this version of Cargo (1.55.0 (32da73ab1 2021-08-23)).

and indeed, I see the manifest has this: https://github.com/RustCrypto/formats/blame/7cadd9d3696b6ec06b79281e08805625dd8f3187/base64ct/Cargo.toml#L16

edition = "2021"

but that's been there for 10 months, so maybe that's not as new as I'd think.

Anyway, writing this issue but again, not positive if it's my setup.

mikedotexe commented 2 years ago

Or maybe we just need to update the cargo version

webmaster128 commented 2 years ago

cosmwasm/rust-optimizer ships a version of Rust. The Rust version in 0.12.3 is too low to support Rust edition2021. You can just upgrade to the latest version 0.12.6. See https://github.com/CosmWasm/rust-optimizer/blob/main/CHANGELOG.md

webmaster128 commented 2 years ago

Closing as this is fixed in more recent versions of rust-optimizer/workspace-optimizer which ship more recent Rust versions. If you run into trouble with the latest version, please open a new ticket. Thanks!