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

[BUG] check command logs a warning because a non fixed version of ink is set in templates dependencies #202

Open
3 tasks
ipapandinas opened this issue Jan 16, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ipapandinas
Copy link
Contributor

ipapandinas commented Jan 16, 2024

Description

The ink version (4.2.1) used in contract templates do not come prefixed with a "=" or "v".
This logs the warning below when running swanky check command.

[WARNING]Some of the ink dependencies do not have a fixed version.
      This can lead to accidentally installing version higher than supported by the node.
      Please use "=" to install a fixed version (Example: "=3.0.1")

Then, this error occurs when adding the "=" prefix manually to the ink version in the Cargo.toml of the flipper contract template.

swanky check                 
✔ Check Rust
✔ Check cargo
✔ Check cargo nightly
✔ Check cargo dylint
✔ Check cargo-contract
✔ Read ink dependencies

error:   UnknownError: Invalid Version: =4.2.1
Please report this bug at: https:/swankyhub/swanky-cli/issues
    at new SemVer (~/Documents/dev/astar/swanky-cli/node_modules/semver/classes/semver.js:38:13)
    at compare (~/Documents/dev/astar/swanky-cli/node_modules/semver/functions/compare.js:3:3)
    at Object.gt (~/Documents/dev/astar/swanky-cli/node_modules/semver/functions/gt.js:2:29)
    at file://~/Documents/dev/astar/swanky-cli/dist/commands/check/index.js:79:51
    at Array.forEach (<anonymous>)
    at Task.task [as taskFn] (file://~/Documents/dev/astar/swanky-cli/dist/commands/check/index.js:76:60)
    at Task.run (file://~/Documents/dev/astar/swanky-cli/node_modules/listr2/dist/index.js:1956:35)

To fix

  • Set fixed version on all contract templates dependencies.
  • Adjust the "Verify ink version" task to support "=" prefix.
  • Remove version.startsWith("v") since it is not a valid Rust prefix.

Steps to Reproduce

  1. swanky init test
  2. cd test
  3. swanky check

Expected vs. Actual Behavior

Expected: No warning logged.
Actual Behavior: Warning logged.

Environment

  • Operating system: Mac M1 darwin
  • Project version/tag: @astar-network/swanky-cli/3.1.0 darwin-arm64 node-v18.17.1
  • Rust version: rustc 1.72.1
  • Rust toolchain: 1.72-aarch64-apple-darwin
  • Node version: 18.17.1
@ipapandinas ipapandinas added bug Something isn't working good first issue Good for newcomers labels Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant