use-ink / cargo-contract

Setup and deployment tool for developing Wasm based smart contracts via ink!
GNU General Public License v3.0
249 stars 120 forks source link

Getting error while installing the cargo contract #1305

Closed deepsea514 closed 1 year ago

deepsea514 commented 1 year ago

Describe the bug I am getting error while installing cargo contract v3.0.1 with rust 1.70.0

To Reproduce cargo install cargo-contract --version 3.0.1 --force

Environment (please complete the following information):

Additional context Updating crates.io index Installing cargo-contract v3.0.1 Compiling proc-macro2 v1.0.66 Compiling unicode-ident v1.0.11 Compiling cfg-if v1.0.0 Compiling libc v0.2.147 Compiling version_check v0.9.4 Compiling serde v1.0.188 Compiling autocfg v1.1.0 Compiling typenum v1.16.0 Compiling once_cell v1.18.0 Compiling generic-array v0.14.7 Compiling syn v1.0.109 Compiling quote v1.0.33 Compiling jobserver v0.1.26 Compiling syn v2.0.29 Compiling cc v1.0.83 Compiling equivalent v1.0.1 Compiling hashbrown v0.14.0 Compiling winnow v0.5.15 Compiling indexmap v2.0.0 Compiling toml_datetime v0.6.3 Compiling anyhow v1.0.75 Compiling futures-core v0.3.28 Compiling getrandom v0.2.10 Compiling toml_edit v0.19.14 Compiling memchr v2.6.0 Compiling thiserror v1.0.47 Compiling bytes v1.4.0 Compiling arrayvec v0.7.4 Compiling slab v0.4.9 Compiling pin-project-lite v0.2.13 Compiling ppv-lite86 v0.2.17 Compiling subtle v2.4.1 Compiling proc-macro-crate v1.3.1 Compiling byte-slice-cast v1.2.2 Compiling futures-channel v0.3.28 Compiling value-bag v1.4.1 Compiling futures-task v0.3.28 Compiling log v0.4.20 Compiling rand_core v0.6.4 Compiling rand_chacha v0.3.1 Compiling radium v0.7.0 Compiling rand v0.8.5 Compiling tap v1.0.1 Compiling wyz v0.5.1 Compiling serde_derive v1.0.188 Compiling thiserror-impl v1.0.47 Compiling tracing-attributes v0.1.26 Compiling futures-macro v0.3.28 Compiling parity-scale-codec-derive v3.6.4 Compiling impl-trait-for-tuples v0.2.2 Compiling derive_more v0.99.17 Compiling scale-info-derive v2.9.0 Compiling funty v2.0.0 Compiling byteorder v1.4.3 Compiling bitvec v1.0.1 Compiling fnv v1.0.7 Compiling itoa v1.0.9 Compiling cpufeatures v0.2.9 Compiling ring v0.16.20 Compiling tracing-core v0.1.31 Compiling futures-io v0.3.28 Compiling serde_json v1.0.105 Compiling digest v0.9.0 Compiling num-traits v0.2.16 Compiling ryu v1.0.15 Compiling tokio-macros v2.1.0 Compiling num_cpus v1.16.0 Compiling crc32fast v1.3.2 Compiling tinyvec_macros v0.1.1 Compiling tinyvec v1.6.0 Compiling tracing v0.1.37 Compiling ahash v0.7.6 Compiling smallvec v1.11.0 Compiling unicode-normalization v0.1.22 Compiling block-buffer v0.10.4 Compiling parity-scale-codec v3.6.4 Compiling crypto-common v0.1.6 Compiling digest v0.10.7 Compiling impl-serde v0.4.0 Compiling unicode-bidi v0.3.13 Compiling futures-sink v0.3.28 Compiling scale-info v2.9.0 Compiling io-lifetimes v1.0.11 Compiling static_assertions v1.1.0 Compiling percent-encoding v2.3.0 Compiling form_urlencoded v1.2.0 Compiling idna v0.4.0 Compiling hashbrown v0.12.3 Compiling block-buffer v0.9.0 Compiling indexmap v1.9.3 Compiling getrandom v0.1.16 Compiling pin-utils v0.1.0 Compiling futures-util v0.3.28 Compiling opaque-debug v0.3.0 Compiling crunchy v0.2.2 Compiling url v2.4.1 Compiling rustix v0.37.23 Compiling strsim v0.10.0 Compiling ident_case v1.0.1 Compiling bitflags v1.3.2 Compiling darling_core v0.14.4 Compiling zeroize_derive v1.4.2 Compiling linux-raw-sys v0.3.8 Compiling rand_core v0.5.1 Compiling paste v1.0.14 Compiling zeroize v1.6.0 Compiling darling_macro v0.14.4 Compiling lazy_static v1.4.0 Compiling hex v0.4.3 Compiling keccak v0.1.4 Compiling aho-corasick v1.0.4 Compiling num-integer v0.1.45 Compiling regex-syntax v0.7.5 Compiling rustc-hex v2.1.0 Compiling rustc-hash v1.1.0 Compiling darling v0.14.4 Compiling sp-std v7.0.0 Compiling arrayref v0.3.7 Compiling rustls v0.21.7 Compiling fallible-iterator v0.2.0 Compiling target-lexicon v0.12.11 Compiling stable_deref_trait v1.2.0 Compiling futures-executor v0.3.28 Compiling gimli v0.26.2 Compiling wasmparser v0.100.0 Compiling cranelift-entity v0.93.2 Compiling regex-automata v0.3.7 Compiling num-bigint v0.4.4 Compiling memoffset v0.6.5 Compiling rustix v0.36.15 Compiling base64 v0.13.1 Compiling regex-syntax v0.6.29 Compiling wasmtime-types v6.0.2 Compiling regex-automata v0.1.10 Compiling regex v1.9.4 Compiling futures v0.3.28 Compiling fixed-hash v0.8.0 Compiling uint v0.9.5 Compiling object v0.29.0 Compiling impl-codec v0.6.0 Compiling sha2 v0.10.7 Compiling wasmtime-runtime v6.0.2 Compiling generic-array v0.12.4 Compiling num-rational v0.4.1 Compiling libm v0.2.7 Compiling rustc-demangle v0.1.23 Compiling async-trait v0.1.73 Compiling linux-raw-sys v0.1.4 Compiling cpp_demangle v0.3.5 Compiling libsecp256k1-core v0.3.0 Compiling Inflector v0.11.4 Compiling wasmtime-environ v6.0.2 Compiling primitive-types v0.12.1 Compiling memfd v0.6.3 Compiling sha3 v0.10.8 Compiling psm v0.1.21 Compiling wasmtime-jit-debug v6.0.2 Compiling wasmtime-asm-macros v6.0.2 Compiling event-listener v2.5.3 Compiling parity-wasm v0.45.0 Compiling rustversion v1.0.14 Compiling byte-tools v0.3.1 Compiling ref-cast v1.0.20 Compiling block-padding v0.1.5 Compiling digest v0.8.1 Compiling addr2line v0.17.0 Compiling tracing-log v0.1.3 Compiling sharded-slab v0.1.4 Compiling sha2 v0.9.9 Compiling blake2 v0.10.6 Compiling bincode v1.3.3 Compiling ref-cast-impl v1.0.20 Compiling socket2 v0.5.3 Compiling wasmtime-jit-icache-coherence v6.0.2 Compiling mio v0.8.8 Compiling thread_local v1.1.7 Compiling iana-time-zone v0.1.57 Compiling wasmtime v6.0.2 Compiling downcast-rs v1.2.0 Compiling memory_units v0.4.0 Compiling spin v0.5.2 Compiling untrusted v0.7.1 Compiling wasmicore v0.2.1 Compiling chrono v0.4.26 Compiling tokio v1.32.0 Compiling wasmtime-jit v6.0.2 Compiling wasmi-validation v0.5.0 error[E0004]: non-exhaustive patterns: `Instruction::SignExt()` not covered --> /home/odmin/.cargo/registry/src/github.com-1ecc6299db9ec823/wasmi-validation-0.5.0/src/func.rs:174:15 174 match *instruction { ^^^^^^^^^^^^ pattern Instruction::SignExt(_) not covered
note: Instruction defined here --> /home/odmin/.cargo/registry/src/github.com-1ecc6299db9ec823/parity-wasm-0.45.0/src/elements/ops.rs:308:2 111 pub enum Instruction {
... 308 SignExt(SignExtInstruction), ^^^^^^^ not covered = note: the matched value is of type Instruction help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown

785 ~ } 786 + Instruction::SignExt(_) => todo!() |

For more information about this error, try rustc --explain E0004. error: could not compile wasmi-validation due to previous error warning: build failed, waiting for other jobs to finish... error: failed to compile cargo-contract v3.0.1, intermediate artifacts can be found at /tmp/cargo-installfBtEDY

SkymanOne commented 1 year ago

cargo-contract v3.0.1 is incompatible with rusc 1.68 or newer. You should use cargo-contract v3.2.0 which is a successor of 3.0.1 and addresses the issue.

ascjones commented 1 year ago

Installing with --locked should fix this:

cargo install cargo-contract --version 3.0.1 --force --locked

However as @SkymanOne points out, it won't work for building contracts with the 1.70 toolchain, so we recommend installing 3.2.0 instead.