ameliatastic / seahorse-lang

Write Anchor-compatible Solana programs in Python
Apache License 2.0
320 stars 46 forks source link

Seahorse init version conflict #108

Closed maycuatroi closed 6 months ago

maycuatroi commented 6 months ago

I encountered a version conflict issue when using seahorse init <project_name>. I believe this issue arises from conflicting versions.

My installed version

solana-cli 1.18.4 (src:356c6a38; feat:3352961542, client:SolanaLabs)
cargo 1.77.0 (3fe68eabf 2024-02-29)
anchor-cli 0.29.0
Seahorse 0.2.7
(base) binhna@DESKTOP-D9VLB13:/mnt/d/learn-solana/evocean_sol$ seahorse build
⠴ Compiling evocean_sol... (note: if this is your first time building, it might take a few minutes)^C
(base) binhna@DESKTOP-D9VLB13:/mnt/d/learn-solana/evocean_sol$ ^C
(base) binhna@DESKTOP-D9VLB13:/mnt/d/learn-solana/evocean_sol$ ^C
(base) binhna@DESKTOP-D9VLB13:/mnt/d/learn-solana/evocean_sol$ ^C
(base) binhna@DESKTOP-D9VLB13:/mnt/d/learn-solana/evocean_sol$ seahorse build
✗ Compiling evocean_sol...
Error: anchor build -p evocean_sol failed:

This is most likely a bug in the Seahorse compiler!

If you want to help the project, you can report this:
  - on the Seahorse Discord (http://discord.gg/4sFzH5pus8)
  - or as a Github issue (https://github.com/ameliatastic/seahorse-lang/issues).

Thanks!

[2024-03-22T20:28:51.306502632Z ERROR cargo_build_sbf] Failed to obtain package metadata: `cargo metadata` exited with an error:     Updating crates.io index
    error: failed to select a version for `solana-program`.
        ... required by package `pyth-sdk-solana v0.7.2`
        ... which satisfies dependency `pyth-sdk-solana = "^0.7.2"` of package `evocean_sol v0.1.0 (/mnt/d/learn-solana/evocean_sol/programs/evocean_sol)`
    versions that meet the requirements `>=1.9, <=1.15` are: 1.14.29, 1.14.28, 1.14.27, 1.14.26, 1.14.25, 1.14.24, 1.14.23, 1.14.22, 1.14.21, 1.14.20, 1.14.19, 1.14.18, 1.14.17, 1.14.16, 1.14.15, 1.14.14, 1.14.13, 1.14.12, 1.14.11, 1.14.10, 1.1
4.9, 1.14.8, 1.14.7, 1.14.6, 1.14.5, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14.0, 1.13.7, 1.13.6, 1.13.5, 1.13.4, 1.13.3, 1.13.2, 1.13.1, 1.13.0, 1.11.10, 1.11.8, 1.11.7, 1.11.6, 1.11.5, 1.11.4, 1.11.3, 1.11.2, 1.11.1, 1.11.0, 1.10.41, 1.10.40, 1.10
.39, 1.10.38, 1.10.35, 1.10.34, 1.10.33, 1.10.32, 1.10.31, 1.10.30, 1.10.29, 1.10.28, 1.10.27, 1.10.26, 1.10.25, 1.10.24, 1.10.23, 1.10.22, 1.10.21, 1.10.20, 1.10.19, 1.10.18, 1.10.17, 1.10.16, 1.10.15, 1.10.14, 1.10.13, 1.10.12, 1.10.11, 1.10.
10, 1.10.9, 1.10.8, 1.10.7, 1.10.6, 1.10.5, 1.10.4, 1.10.3, 1.10.2, 1.10.1, 1.10.0, 1.9.29, 1.9.28, 1.9.26, 1.9.25, 1.9.24, 1.9.23, 1.9.22, 1.9.21, 1.9.20, 1.9.19, 1.9.18, 1.9.17, 1.9.16, 1.9.15, 1.9.14, 1.9.13, 1.9.12, 1.9.11, 1.9.10, 1.9.9, 1
.9.8, 1.9.7, 1.9.6, 1.9.5, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9.0

    all possible versions conflict with previously selected packages.

      previously selected package `solana-program v1.16.13`
        ... which satisfies dependency `solana-program = "^1.16"` of package `anchor-lang v0.29.0`
        ... which satisfies dependency `anchor-lang = "^0.29.0"` of package `evocean_sol v0.1.0 (/mnt/d/learn-solana/evocean_sol/programs/evocean_sol)`

    failed to select a version for `solana-program` which could resolve this conflict
jakub-mezey commented 6 months ago

Hi try this config in cargo.toml inside /programs/yourproject folder

[dependencies] anchor-lang = "0.28.0" anchor-spl = "0.28.0" pyth-sdk-solana = { version = "0.10.1", optional = true }

Seems like new version of anchor stuff is not supported by seahorse (project seems to be dead). But i still try to use it as you 👯