CosmWasm/optimizer

"missing field `workspace`" when running in docker

xmichael446 opened this issue · 6 comments

I have a cosmwasm contract and I'm running the optimizer via docker like this in the contract directory:

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 -e RUST_BACKTRACE=full   cosmwasm/workspace-optimizer:0.12.6

And it gives the following error:

1.60.0-x86_64-unknown-linux-musl (default)
cargo 1.60.0 (d1fd9fe2c 2022-03-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

The contract code is here

Facing the same issue similar to the issue above , and i have been struggling to overcome this issue. Please we need an urgent response to this situation.

If you compile a single contract project instead of a workspace, use cosmwasm/rust-optimizer instead of cosmwasm/workspace-optimizer

Thank you for your time and feedback. I stopped having that issue but another was introduced.
Error:
rust warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Try again; class=Net (12) error: failed to get cw-controllersas a dependency of packagecw4-group v1.1.0 (/code)`

Caused by:
failed to load source for dependency cw-controllers

Caused by:
Unable to update /packages/controllers

Caused by:
failed to read /packages/controllers/Cargo.toml

Caused by:
No such file or directory (os error 2)
`
And i checked all the files and folder but they where in the right position.
Your feedback will be appreciated again.

Please I need a Feedback.
How long does it take to get a reply.

Looks like network issues / wrong dependenciea sources maybe?

Do you know Google? It pretty good search engine is.

In the next update 0.15.0, the two images will be unified. See #143. With this change the original issue does not happen anymore since there is only one image that works for both single contract and workspace projects.