Skip to content

Building contracts failed #117

@toschdev

Description

@toschdev

On current master branch I tried to build with

sudo 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.10.3

and got

error[E0593]: function is expected to take 3 arguments, but it takes 2 arguments
   --> contracts/cw1-whitelist/src/lib.rs:9:1
    |
9   |   cosmwasm_std::create_entry_points!(contract);
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected function that takes 3 arguments
    | 
   ::: contracts/cw1-whitelist/src/contract.rs:125:1
    |
125 | / pub fn query<S: Storage, A: Api, Q: Querier>(
126 | |     deps: &Extern<S, A, Q>,
127 | |     msg: QueryMsg,
128 | | ) -> StdResult<Binary> {
...   |
132 | |     }
133 | | }
    | |_- takes 2 arguments
    |
    = note: required for the cast to the object type `dyn for<'r> std::ops::Fn(&'r cosmwasm_std::Extern<cosmwasm_std::ExternalStorage, cosmwasm_std::ExternalApi, cosmwasm_std::ExternalQuerier>, cosmwasm_std::Env, _) -> std::result::Result<cosmwasm_std::Binary, _>`
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
For more information about this error, try `rustc --explain E0593`.
error: could not compile `cw1-whitelist`.
To learn more, run the command again with --verbose.
Traceback (most recent call last):
  File "/usr/local/bin/optimize_workspace.py", line 45, in <module>
    subprocess.check_call(cmd, cwd=contract)
  File "/usr/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cargo', '-Z=unstable-options', 'build', '--release', '--target=wasm32-unknown-unknown', '--locked', '--out-dir=/tmp/contracts/cw1-whitelist']' returned non-zero exit status 101.

My versions

> rustc --version
rustc 1.48.0-nightly (5099914a1 2020-09-08)
> cargo --version
cargo 1.48.0-nightly (126907a7c 2020-08-31)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions