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

Build failure in openbrush examples #122

Open
joshua8321 opened this issue Aug 1, 2023 · 6 comments
Open

Build failure in openbrush examples #122

joshua8321 opened this issue Aug 1, 2023 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@joshua8321
Copy link

I'm trying to build psp34 metadata example from here, and it goes into failure with the following error:

...
Compiling my_psp34_metadata v4.0.0-beta (/tmp/cargo-contract_dCY6la)
Finished release [optimized] target(s) in 56.21s
[2/4] Post processing code
ERROR: Loading of original wasm failed

Caused by:
0: Loading of wasm module at '.../openbrush-contracts/examples/psp34_extensions/metadata/target/ink/wasm32-unknown-unknown/release/my_psp34_metadata.wasm' failed
1: Unknown opcode 192

I ran this command to build the example:
cargo +nightly contract build --release

here is the information of my toolchain:

rustc --version
rustc 1.73.0-nightly

rustup toolchain list
nightly-x86_64-unknown-linux-gnu (default)

@h4nsu
Copy link

h4nsu commented Aug 1, 2023

I'm getting the same error with the current stable toolchain. All other psp34 extenstion examples work, but the metadata one fails with the same "opcode 192" error.

@Artemka374
Copy link
Contributor

Hey! First of all, it should be built with stable toolchain, that's true, second thing - could you try using 1.69 version of stable? Sometimes there appear problems in ink! contracts with versions upper

@h4nsu
Copy link

h4nsu commented Aug 1, 2023

You're right, it works with 1.69 version. You need to add relevant rust-toolchain files to the repo and probably also mention it in the README. Using non-latest stable toolchain is a very unusual practice, it's hard to just guess this solution.

@beach-dev
Copy link

@Artemka374
Thanks for the information.
Could you guide me how to go back to version 1.69 and install necessary toolchain please?

@h4nsu
Copy link

h4nsu commented Aug 2, 2023

$ rustup install 1.69
$ rustup component add rust-src --toolchain 1.69
$ rustup target add wasm32-unknown-unknown --toolchain 1.69

$ cargo +1.69 contract build --release

@Artemka374 Artemka374 added the documentation Improvements or additions to documentation label Aug 3, 2023
@coreggon11
Copy link
Contributor

coreggon11 commented Aug 3, 2023

This is a problem with cargo contract, not OpenBrush. It is fixed in the latest cargo-contract v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

6 participants