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

thread 'main' panicked at 'called `Result::unwrap() #867

Closed
dev573 opened this issue Apr 10, 2023 · 1 comment
Closed

thread 'main' panicked at 'called `Result::unwrap() #867

dev573 opened this issue Apr 10, 2023 · 1 comment

Comments

@dev573
Copy link

dev573 commented Apr 10, 2023

While running the command

  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/workspace-optimizer:0.12.8

in cw2-base smart contract getting error

cargo 1.63.0 (fd9c4297c 2022-07-01)
Building artifacts in workspace...
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { inner: ErrorInner { kind: Custom, line: None, col: 0, message: "missing field `workspace`", key: [] } }', src/main.rs:35:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Git Branch: main

@hashedone
Copy link
Contributor

You don't run workspace optimizer on the smart contract level - instead, you execute it in the root folder so you build all contracts in the workspace. If you want to build only a single contract, you don't use workspace optimizer, but rust optimizer:

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.13

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

2 participants