a bit new in MultiversX building.
Using WSL2 on Windows, and rustc version is:
:~/multiversx/smart_contracts/crowdfunding$ rustc -V rustc 1.70.0 (90c541806 2023-05-31)
All this tools are new for me. I am following the Crowdfunding tutorial (https://docs.multiversx.com/developers/tutorials/crowdfunding-p1/). When it comes to build the contract, I get the issue:
~/multiversx/smart_contracts/crowdfunding$ mxpy contract build
INFO:projects.core:build_project.directory: /home/dev/multiversx/smart_contracts/crowdfunding
INFO:projects.core:build_project.debug: False
INFO:modules:install: key=rust, tag=nightly, overwrite=False
INFO:myprocess:run_process: ['rustc', '--version'], in folder: None
INFO:myprocess:Successful run. Output:
rustc 1.72.0-nightly (839e9a6e1 2023-07-02)
INFO:modules:Already exists. Skip install.
INFO:ProjectRust:wasm-opt is installed.
Updating crates.io index
Compiling proc-macro2 v1.0.63====> ] 93.33%, (68/75) resolving deltas
Compiling autocfg v1.1.0
Compiling quote v1.0.29
Compiling unicode-ident v1.0.9
Compiling memchr v2.5.0
Compiling once_cell v1.18.0
Compiling cfg-if v1.0.0
Compiling rustix v0.38.2
Compiling syn v1.0.109 ] 0/109: proc-macro2(build.rs), once_cell, quote(build.rs), unicode-ident, memchr(build.rs), rustix(build.rs), autocfg, cfg-if
Compiling version_check v0.9.4 ] 1/109: proc-macro2(build.rs), once_cell, quote(build.rs), unicode-ident, memchr(build.rs), syn(build.rs), rustix(build.rs), autocfg
Compiling linux-raw-sys v0.4.3 ] 2/109: proc-macro2(build.rs), once_cell, quote(build.rs), memchr(build.rs), syn(build.rs), version_check, rustix(build.rs), autocfg
Compiling num-traits v0.2.15 ] 3/109: proc-macro2(build.rs), quote(build.rs), memchr(build.rs), syn(build.rs), version_check, linux-raw-sys, rustix(build.rs), autocfg
Compiling num-integer v0.1.45 ] 4/109: proc-macro2(build.rs), num-traits(build.rs), quote(build.rs), memchr(build.rs), syn(build.rs), version_check, linux-raw-sys, rustix(build.rs)
Compiling bitflags v2.3.3 ] 5/109: proc-macro2(build.rs), num-traits(build.rs), quote(build.rs), memchr(build.rs), syn(build.rs), num-integer(build.rs), linux-raw-sys, rustix(build.rs)
Compiling ahash v0.8.3 ] 6/109: proc-macro2(build.rs), num-traits(build.rs), quote(build.rs), bitflags, memchr(build.rs), syn(build.rs), num-integer(build.rs), rustix(build.rs)
Compiling num-bigint v0.4.3 ] 14/109: num-traits(build.rs), num-integer(build), ahash(build.rs), memchr, proc-macro2(build), rustix(build), quote(build), syn(build)
Compiling smallvec v1.10.0 ] 15/109: num-traits(build.rs), ahash(build.rs), memchr, proc-macro2(build), num-bigint(build.rs), rustix(build), quote(build), syn(build)
Compiling utf8parse v0.2.1 ] 18/109: proc-macro2, num-traits(build), memchr, num-bigint(build.rs), smallvec, rustix(build), quote(build), syn(build)
Compiling hex v0.4.3 ] 19/109: proc-macro2, num-traits(build), utf8parse, memchr, num-bigint(build.rs), smallvec, rustix(build), syn(build)
Compiling regex-syntax v0.7.2 ] 21/109: proc-macro2, hex, num-traits(build), utf8parse, memchr, num-bigint(build.rs), smallvec, rustix
Compiling libc v0.2.147 ] 22/109: proc-macro2, hex, regex-syntax, num-traits(build), memchr, num-bigint(build.rs), smallvec, rustix
Compiling nibble_vec v0.1.0 ] 24/109: proc-macro2, libc(build.rs), num-traits, hex, regex-syntax, memchr, num-bigint(build.rs), rustix
Compiling anstyle-parse v0.2.1 ] 25/109: proc-macro2, libc(build.rs), num-traits, regex-syntax, memchr, num-bigint(build.rs), nibble_vec, rustix
Compiling anstyle v1.0.1 ] 29/109: proc-macro2, libc(build.rs), num-traits, ahash(build), regex-syntax, quote, memchr, rustix
Compiling syn v2.0.23 ] 30/109: proc-macro2, libc(build.rs), num-traits, regex-syntax, quote, anstyle, memchr, rustix
Compiling aho-corasick v1.0.2 ] 31/109: proc-macro2, num-traits, regex-syntax, quote, syn, anstyle, memchr, rustix
Compiling is-terminal v0.4.8 ] 33/109: proc-macro2, num-traits, regex-syntax, syn, syn, memchr, aho-corasick, rustix
Compiling colorchoice v1.0.0 ] 35/109: num-traits, regex-syntax, syn, syn, memchr, aho-corasick, libc(build), rustix
Compiling endian-type v0.1.2 ] 36/109: num-traits, regex-syntax, syn, syn, aho-corasick, libc(build), colorchoice, rustix
Compiling anstyle-query v1.0.0 ] 37/109: num-traits, regex-syntax, syn, syn, aho-corasick, libc(build), endian-type, rustix
Compiling lazy_static v1.4.0 ] 39/109: num-integer, num-traits, regex-syntax, syn, syn, aho-corasick, endian-type, rustix
Compiling serde v1.0.165 ] 40/109: num-integer, lazy_static, num-traits, regex-syntax, syn, syn, aho-corasick, rustix
Compiling radix_trie v0.2.1 ] 41/109: num-integer, num-traits, regex-syntax, syn, syn, serde(build.rs), aho-corasick, rustix
Compiling anstream v0.3.2 ] 42/109: num-integer, num-traits, regex-syntax, syn, syn, serde(build.rs), aho-corasick, radix_trie
Compiling aho-corasick v0.7.20 ] 46/109: serde(build), anstream, regex-syntax, syn, syn, libc, aho-corasick, num-bigint
Compiling bstr v1.5.0> ] 47/109: anstream, regex-syntax, syn, syn, aho-corasick, libc, aho-corasick, num-bigint
Compiling regex v1.8.4 ] 48/109: regex-syntax, syn, syn, bstr, aho-corasick, libc, aho-corasick, num-bigint
Compiling indexmap v1.9.3 ] 50/109: regex, ahash, regex-syntax, syn, syn, libc, aho-corasick, num-bigint
Compiling same-file v1.0.6 ] 51/109: regex, ahash, regex-syntax, syn, syn, indexmap(build.rs), aho-corasick, num-bigint
Compiling log v0.4.19=> ] 52/109: regex, regex-syntax, syn, syn, indexmap(build.rs), aho-corasick, same-file, num-bigint
Compiling anyhow v1.0.71 ] 53/109: regex, regex-syntax, syn, syn, log, indexmap(build.rs), aho-corasick, num-bigint
Compiling semver v1.0.17 ] 54/109: regex, regex-syntax, syn, syn, log, indexmap(build.rs), anyhow(build.rs), aho-corasick
Compiling clap_lex v0.5.0 ] 55/109: regex, regex-syntax, syn, syn, indexmap(build.rs), anyhow(build.rs), aho-corasick, semver(build.rs)
Compiling heck v0.4.1==> ] 56/109: regex, regex-syntax, syn, syn, anyhow(build.rs), aho-corasick, semver(build.rs), clap_lex
Compiling arrayvec v0.7.4 ] 57/109: regex, regex-syntax, syn, syn, anyhow(build.rs), semver(build.rs), clap_lex, heck
Compiling fnv v1.0.7===> ] 58/109: regex, arrayvec, regex-syntax, syn, syn, anyhow(build.rs), semver(build.rs), heck
Compiling strsim v0.10.0> ] 59/109: regex, arrayvec, regex-syntax, syn, syn, anyhow(build.rs), semver(build.rs), fnv
Compiling globset v0.4.10 ] 61/109: regex, arrayvec, regex-syntax, syn, syn, strsim, semver(build.rs), anyhow(build)
Compiling clap_builder v4.3.10 ] 62/109: regex, arrayvec, regex-syntax, syn, syn, strsim, semver(build.rs), globset
Compiling walkdir v2.3.3=> ] 65/109: regex, regex-syntax, syn, syn, strsim, indexmap(build), globset, clap_builder
Compiling hashbrown v0.13.2 ] 66/109: regex, regex-syntax, syn, syn, walkdir, strsim, globset, clap_builder
Compiling atty v0.2.14===> ] 67/109: regex, syn, syn, walkdir, hashbrown, strsim, globset, clap_builder
Compiling thread_local v1.1.7 ] 68/109: regex, atty, syn, syn, walkdir, hashbrown, globset, clap_builder
Compiling hex-literal v0.3.4 ] 69/109: regex, thread_local, syn, syn, walkdir, hashbrown, globset, clap_builder
Compiling serde_json v1.0.99 ] 70/109: regex, syn, syn, walkdir, hashbrown, hex-literal, globset, clap_builder
Compiling hashbrown v0.12.3 ] 71/109: regex, syn, syn, serde_json(build.rs), hashbrown, hex-literal, globset, clap_builder
Compiling bitflags v1.3.2==> ] 72/109: regex, syn, syn, serde_json(build.rs), hex-literal, hashbrown, globset, clap_builder
Compiling ignore v0.4.20===> ] 74/109: regex, serde_json(build), syn, syn, hex-literal, hashbrown, globset, clap_builder
Compiling colored v2.0.1====> ] 76/109: regex, ignore, indexmap, syn, syn, hex-literal, globset, clap_builder
Compiling Inflector v0.11.4=> ] 79/109: regex, ignore, colored, syn, syn, semver, anyhow, clap_builder
Compiling unicode-segmentation v1.10.1 80/109: regex, ignore, syn, syn, semver, Inflector, anyhow, clap_builder
Compiling ryu v1.0.13========> ] 81/109: regex, ignore, unicode-segmentation, syn, syn, Inflector, anyhow, clap_builder
Compiling itoa v1.0.7========> ] 82/109: ignore, unicode-segmentation, syn, syn, ryu, Inflector, anyhow, clap_builder
Compiling rustc_version v0.4.0 ] 83/109: ignore, unicode-segmentation, syn, syn, ryu, Inflector, itoa, clap_builder
Compiling common-path v1.0.0==> ] 84/109: ignore, rustc_version, unicode-segmentation, syn, syn, Inflector, itoa, clap_builder
Compiling pathdiff v0.2.1=====> ] 85/109: ignore, rustc_version, unicode-segmentation, syn, syn, itoa, common-path, clap_builder
Compiling convert_case v0.6.0=> ] 88/109: ignore, rustc_version, unicode-segmentation, syn, syn, clap_builder
Compiling serde_derive v1.0.165> ] 91/109: ignore, syn, syn, clap_builder
Compiling clap_derive v4.3.2===> ] 92/109: ignore, syn, serde_derive, clap_builder
Compiling multiversx-sc-codec-derive v0.17.29: clap_derive, syn, serde_derive, clap_builder
Compiling multiversx-sc-derive v0.41.3 94/109: clap_derive, multiversx-sc-codec-derive, serde_derive, clap_builder
error[E0554]: `#![feature]` may not be used on the stable release channel-sc-codec-derive, multiversx-sc-derive, serde_derive
--> /home/dev/multiversx-sdk/vendor-rust/registry/src/github.com-1ecc6299db9ec823/multiversx-sc-derive-0.41.3/src/lib.rs:4:12
|
4 | #![feature(proc_macro_quote)]
| ^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0554`.
error: could not compile `multiversx-sc-derive` due to previous error
warning: build failed, waiting for other jobs to finish...
CRITICAL:cli:Build error: None.=====> ] 98/109: clap_derive
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Build error: None.
As it says
:~/multiversx/smart_contracts/crowdfunding$ rustc --explain E0554
Feature attributes are only allowed on the nightly release channel. Stable or
beta compilers will not comply.
Erroneous code example:
``
#![feature(lang_items)] // error: `#![feature]` may not be used on the
// stable release channel
``
If you need the feature, make sure to use a nightly release of the compiler
(but be warned that the feature may be removed or altered in the future).
I tried to install the nightly version according to https://github.com/casbin/casbin-rs/issues/215
rustup install nightly
Do you have any idea to help me? Thanks a lot
--[EDIT] For those who have the same issue:
Try mxpy contract build --no-wasm-opt Instead of mxpy contract build
Thanks bluedragon1120 from https://github.com/multiversx/mx-ping-pong-sc/issues/5
Most likely, the rust installation used by your mxpy is somehow on stable release channel instead of nightly. In order to change it to a nightly release you have to download the desired nightly release like so:
Then switch the installation to the downloaded release:
Please make sure that you are changing the rust installation used by mxpy, because one might have another installation besides the one installed and used by mxpy, so if you're switching your "global" installation, mxpy will not see it.
A note here would be that by default, mxpy uses the rust installation located in
${HOME}/multiversx-sdk/vendor-rust.To make sure that the effects of your changes go to the correct installation, you can always try
mxpy deps check rustto see what's mxpy using.