inkdevhub / swanky-cli

The all-in-one developer environment for Parity pallet-contracts based smart contracts!
https://docs.astar.network/docs/build/wasm/swanky-suite/cli/
MIT License
70 stars 29 forks source link

[BUG] psp22 contract error compile #169

Closed xxxijustwei closed 1 year ago

xxxijustwei commented 1 year ago

Description

Use swanky-cli to create a psp22 contract template that cannot be compiled

Steps to Reproduce

ignore

Expected vs. Actual Behavior

ignore

Environment

owner@justwei psp22 % swanky check
✔ Check Rust
✔ Check cargo
✔ Check cargo nightly
✔ Check cargo dylint
✔ Check cargo-contract
✔ Read ink dependencies
✔ Verify ink version
{
  tools: {
    rust: 'rustc 1.69.0 (84c898d65 2023-04-16)',
    cargo: 'cargo 1.69.0 (6e9a83356 2023-04-12)',
    cargoNightly: 'cargo 1.71.0-nightly (64fb38c97 2023-05-23)',
    cargoDylint: 'cargo-dylint 2.1.9',
    cargoContract: 'cargo-contract-contract 2.2.1-unknown-aarch64-apple-darwin'
  },
  contracts: { psp22: {} }
}
owner@justwei psp22 % swanky version
@astar-network/swanky-cli/2.2.3 darwin-arm64 node-v18.2.0
owner@justwei psp22 % rustup show
Default host: aarch64-apple-darwin
rustup home:  /Users/owner/.rustup

installed toolchains
--------------------

stable-aarch64-apple-darwin (default)
nightly-aarch64-apple-darwin

active toolchain
----------------

stable-aarch64-apple-darwin (default)
rustc 1.69.0 (84c898d65 2023-04-16)

owner@justwei psp22 % node --version
v18.16.0

Logs, Errors or Screenshots

owner@justwei psp22 % swanky contract compile --all -v
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/owner/Desktop/dev/test/psp22/contracts/psp22/Cargo.toml
workspace: /Users/owner/Desktop/dev/test/psp22/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/owner/Desktop/dev/test/psp22/contracts/psp22/Cargo.toml
workspace: /Users/owner/Desktop/dev/test/psp22/Cargo.toml
 [1/*] Building cargo project
    Updating crates.io index
    Updating git repository `https://github.com/727-Ventures/openbrush-contracts`
    Updating git repository `https://github.com/727-ventures/pallet-assets-chain-extension`
    Updating git repository `https://github.com/727-Ventures/obce`
    Finished release [optimized] target(s) in 4.53s
 [2/*] Generating metadata
    Updating crates.io index
    Updating git repository `https://github.com/727-Ventures/openbrush-contracts`
    Updating git repository `https://github.com/727-ventures/pallet-assets-chain-extension`
    Updating git repository `https://github.com/727-Ventures/obce`
   Compiling openbrush_contracts v3.1.1 (https://github.com/727-Ventures/openbrush-contracts#73783af2)
error[E0554]: `#![feature]` may not be used on the stable release channel
  --> /Users/owner/.cargo/git/checkouts/openbrush-contracts-4c291f7aab99c37d/73783af/contracts/src/lib.rs:23:1
   |
23 | #![feature(min_specialization)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0554`.
error: could not compile `openbrush_contracts` due to previous error
ERROR: `cd "/Users/owner/Desktop/dev/test/psp22/contracts/psp22" && "/Users/owner/.rustup/toolchains/stable-aarch64-apple-darwin/bin/cargo" "run" "--package" "metadata-gen" "--manifest-path=/private/var/folders/pp/qt_5f02x5pd6jtyh5xy2c6gw0000gp/T/cargo-contract_rf9CFH/contracts/psp22/Cargo.toml" "--target-dir" "/Users/owner/Desktop/dev/test/psp22/target/ink/psp22" "--release"` failed with exit code: Some(101)
✖ Error Compiling psp22 contract

Additional Information

none

xxxijustwei commented 1 year ago

use rust nightly-2023-01-01 toolchain.

$ rustup toolchain install nightly-2023-01-01
$ rustup default nightly-2023-01-01
$ rustup component add rust-src --toolchain nightly-2023-01-01