terra-money / terrain

🛠 A Terra development environment for seamless smart contract development
https://docs.terra.money/develop/guides/initial
GNU General Public License v3.0
48 stars 38 forks source link

Terrain deploy counter sample will not build #19

Closed EyeOfEnigma closed 2 years ago

EyeOfEnigma commented 2 years ago

Fresh install of WSL2 Ubuntu, npm, rust, and localterra all installed to the latest version. When attempting to deploy the sample counter contract the build fails to parse manifest at /code/Cargo.toml and is caused by feature 'edition2021' is required.

I followed the cargo docs linked in the error to fix and migrate to edition2021 and updated the Cargo.toml file to reflect that but still get the same error.

The error also states that cargo version is 1.55.0, but as you can see below I have the latest cargo version installed (1.60.0). I was following terra docs exactly. Reinstalled ubuntu and tried again following the docs from every package instead with the same result.

version: cargo -V cargo 1.60.0 (d1fd9fe 2022-03-01)

command (npx has same results): npm terrain deploy counter --signer validatpr

error: npx terrain deploy counter --signer validator using pre-baked 'validator' wallet on localterra as signer Compiling hex v0.4.3 Compiling byteorder v1.4.3 Compiling uint v0.9.3 Compiling cosmwasm-std v0.16.7 Compiling cw-storage-plus v0.8.1 Compiling cosmwasm-storage v0.16.0 Compiling cw2 v0.8.1 Compiling counter v0.1.0 (/home/stevenjacobs/developer/test-dapp/contracts/counter) Finished release [optimized] target(s) in 6.50s Running script 'optimize': '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:0.12.3 ' 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 ... error: failed to parse manifest at `/code/Cargo.toml

Caused by: feature 'edition2021' is required

The package requires the Cargo feature called 'edition2021', but that feature is not stabilized in this version of Cargo (1.55.0 (32da73ab1 2021-08-23)). Consider trying a newer version of Cargo (this may require the nightly release). See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#edition-2021 for more information about the status of this feature. Finished, status of exit status: 101 Error: ENOENT: no such file or directory, open 'artifacts/counter.wasm' Code: ENOENT`

emidev98 commented 2 years ago

Thanks for submitting the issue @SteveDaMonsta. There is a release that is being tested actively that includes a fix for the issue.

For now is still experimental but if you want use the main branch to "npm link" and deploy the project in your local it should work.

There is a plan to release a new version of the library soon.

🍻!

RylandCapital commented 2 years ago

same exact issue. just letting you know. I was following terra academy course and got stuck on this step unfortunately. image

dan-turner commented 2 years ago

Hi @emidev98 are you able to please provide some more specific instructions? How exactly can we leverage npm link to make it work?

I just tried installing the package via github:

npm uninstall -g @terra-money/terrain
npm install -g github:terra-money/terrain#main

But it's failing for another reason:

› terrain deploy counter --signer test1           

 ›   Error: command deploy not found
dan-turner commented 2 years ago

terrain --help also doesn't work?

› terrain --help                                
    Error: Unable to load configured help class "./src/lib/help", failed with message:
    Cannot find module '/Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/t
    errain/src/lib/help'
    Require stack:
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/node_module
    s/@oclif/help/lib/util.js
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/node_module
    s/@oclif/help/lib/command.js
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/node_module
    s/@oclif/help/lib/index.js
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/node_module
    s/@oclif/command/lib/command.js
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/node_module
    s/@oclif/command/lib/index.js
    - /Users/dan/.nvm/versions/node/v16.14.2/lib/node_modules/@terra-money/terrain/bin/run
emidev98 commented 2 years ago

Hello @dan-turner, the command terrain --help is not working. A fix will be on going soon. If you find another issue which is not directly related to the one on the main post please open a new issue (terrain repo here) that way we do not mix topics, thanks.

emidev98 commented 2 years ago

Hello @dan-turner and @RylandCapital,

Here you can find a guide which is not yet reviewed but it will help you to figure out how to use npm link with the main branch. If you find something that is not working as expected please let me know.

To give you a little bit more context of the issue you're facing please find this pr with the fix contextualized.

Thanks for submitting the issues!

RylandCapital commented 2 years ago

@emidev98 thank you for the help! will you post in here when the "edition2021" fix has been released?

emidev98 commented 2 years ago

You're welcome, for sure I will keep you updated!

emidev98 commented 2 years ago

A new release is available. Thanks for helping spotting this bugs.

@dan-turner the fix for new command will probably be included in the next release.