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

Issue running wasm compilation out-of-the-box #545

Closed
jonbae opened this issue Nov 11, 2021 · 5 comments · Fixed by #595
Closed

Issue running wasm compilation out-of-the-box #545

jonbae opened this issue Nov 11, 2021 · 5 comments · Fixed by #595
Assignees
Milestone

Comments

@jonbae
Copy link

jonbae commented Nov 11, 2021

when running the docker command to compile

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/workspace-optimizer:0.12.3

I get a error of

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 20, kind: NotADirectory, message: "Not a directory" }', src/main.rs:58:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I have done npm install in the root directory on all the necessary packages for base-helpers.ts to run.

I have also run the command RUSTFLAGS="-C link-arg=-s" cargo build --release --target=wasm32-unknown-unknown --locked as suggested to debug but all of the contracts compile fine.

currently stuck and would appreciate help.

Rust: rustc 1.56.1
OS: windows subsystem for linux

@jonbae jonbae changed the title Issue running wasm compilation Issue running wasm compilation out-of-the-box Nov 11, 2021
@wojtczal
Copy link

I assume you're seeing a log such as Building "contracts/base-helpers.ts" ... right before what you pasted as an error. This happens because in the contracts directory which rust is trying to compile there is a typescript file. This is a recent change made by @findolor - maybe he can shed more light on it ;)

@findolor
Copy link
Contributor

Thanks for bringing this up! You are right this is expecting every item to be a directory in contracts.
Opened a PR to fix this one.

@webmaster128
Copy link
Member

Thank you for the report. This is a missing is directory check in https://github.com/CosmWasm/rust-optimizer/blob/v0.12.3/build_workspace/src/main.rs#L28-L32

@maurolacy could you look into this?

@ethanfrey
Copy link
Member

I believe this has since been fixed.
Both in a more robust rust-optimiser as well as in removing the base_helpers.ts file.

Can this be closed?

@webmaster128
Copy link
Member

webmaster128 commented Dec 14, 2021

True, fixed in 0.12.4 with this function: https://github.com/CosmWasm/rust-optimizer/blob/v0.12.4/build_workspace/src/main.rs#L22-L31.

I think it can be closed once all references to workspace-optimizer in this project are updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants