CosmWasm / optimizer

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

error: could not find Cargo.toml #77

Open EzrielS opened 2 years ago

EzrielS commented 2 years ago

Hello,

I tryed rust-optimizer after compiling the template from cw-template but when I executed it I get error: could not find Cargo.toml in /code or any parent directory

For information I'm working on wsl, i don't know if that can help. Thanks in advance !

andqk00 commented 2 years ago

any update on this issue?

webmaster128 commented 2 years ago

Which command do you use to call rust-optimizer?

daharon commented 2 years ago

I had the same problem running this in Fedora with Podman.
The culprit was SELinux.

There's no need to disable SELinux.
Just run it like so:

-docker run \
+podman run \
   --rm \
-  -v "$(pwd)":/code \
+  -v "$(pwd)":/code:z \
   --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.6