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

unresolved import cosmwasm_std::testing #681

Closed
albertchon opened this issue Mar 21, 2022 · 5 comments
Closed

unresolved import cosmwasm_std::testing #681

albertchon opened this issue Mar 21, 2022 · 5 comments

Comments

@albertchon
Copy link

Upon running

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-arm64:0.12.5
Info: RUSTC_WRAPPER=sccache
Info: sccache stats before build
Compile requests                      0
Compile requests executed             0
Cache hits                            0
Cache misses                          0
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                  0
Cache errors                          0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 0
Unsupported compiler calls            0
Average cache write               0.000 s
Average cache read miss           0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "/root/.cache/sccache"
Cache size                            0 bytes
Max cache size                       10 GiB
Building contract in /code ...
   Compiling cw-storage-plus v0.13.0 (/code/packages/storage-plus)
   Compiling cw2 v0.13.0 (/code/packages/cw2)
   Compiling cw4 v0.13.0 (/code/packages/cw4)
   Compiling cw-controllers v0.13.0 (/code/packages/controllers)
   Compiling cw-multi-test v0.13.0 (/code/packages/multi-test)
error[E0432]: unresolved import `cosmwasm_std::testing`
 --> packages/multi-test/src/app.rs:5:19
  |
5 | use cosmwasm_std::testing::{mock_env, MockApi, MockStorage};
  |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

error[E0432]: unresolved import `cosmwasm_std::testing`
  --> packages/multi-test/src/wasm.rs:24:19
   |
24 | use cosmwasm_std::testing::mock_wasmd_attr;
   |                   ^^^^^^^ could not find `testing` in `cosmwasm_std`

warning: ignoring -C extra-filename flag due to -o flag

For more information about this error, try `rustc --explain E0432`.
warning: `cw-multi-test` (lib) generated 1 warning
error: could not compile `cw-multi-test` due to 2 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
error: build failed
@ethanfrey
Copy link
Member

Odd... can you share the Cargo.toml file of the project?

@ethanfrey
Copy link
Member

Does it work with cargo build and just not with the rust-optimzier (if so, best to post on the rust-optimiser repo)

@albertchon
Copy link
Author

The Cargo.toml is from this repo, cw-plus v0.13.0. Note, I'm using rust-optimizer-arm64:0.12.5

cargo build indeed works fine. Issue created on rust-optimizer CosmWasm/optimizer#78

@ueco-jb
Copy link
Contributor

ueco-jb commented Mar 25, 2022

@albertchon could you share why did you close the ticket? Does that work in the end, was something fixed?

@albertchon
Copy link
Author

It works with the workspace-optimizer, see the discussion here CosmWasm/optimizer#78

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

3 participants