ameliatastic / seahorse-lang

Write Anchor-compatible Solana programs in Python
Apache License 2.0
313 stars 43 forks source link

Encounted error upon run seahorse build #110

Open 371bohdan opened 3 months ago

371bohdan commented 3 months ago

seahorse build ✗ Compiling test2... (note: if this is your first time building, it might take a few minutes) Error: anchor build -p test2 failed:

This is most likely a bug in the Seahorse compiler!

If you want to help the project, you can report this:

Thanks!

[2024-03-31T22:07:11.737876806Z ERROR cargo_build_sbf] Failed to obtain package metadata: cargo metadata exited with an error: warning: virtual workspace defaulting to resolver = "1" despite one or more workspace members being on edition 2021 which implies resolver = "2" note: to keep the current resolver, specify workspace.resolver = "1" in the workspace root's manifest note: to use the edition 2021 resolver, specify workspace.resolver = "2" in the workspace root's manifest note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions Updating crates.io index error: failed to select a version for spl-associated-token-account. ... required by package anchor-spl v0.29.0 ... which satisfies dependency anchor-spl = "^0.29.0" of package test2 v0.1.0 (/mnt/d/test_Seahorse/test2/programs/test2) versions that meet the requirements ^2.2 are: 2.3.1, 2.3.0, 2.2.0

all possible versions conflict with previously selected packages.

  previously selected package `test2 v0.1.0 (/mnt/d/test_Seahorse/test2/programs/test2)`

  previously selected package `pyth-sdk-solana v0.7.1`
    ... which satisfies dependency `pyth-sdk-solana = "^0.7.0"` of package `test2 v0.1.0 (/mnt/d/test_Seahorse/test2/programs/test2)`

failed to select a version for `spl-associated-token-account` which could resolve this conflict
orientearlgrey commented 2 months ago

Got this to work by bumping up the pyth-sdk-solana version in the Cargo.toml dependencies to the latest version. But now I'm getting a different error:

error: no such command: `+solana`

        Cargo does not handle `+toolchain` directives.
        Did you mean to invoke `cargo` through `rustup` instead?
DecMeads commented 2 weeks ago

I'm also getting this issue when testing out the basic fizzbuzz contract. I'm on ubuntu 22.04 and even tried a dockerized 22.04 instance to rule out any conflicts with my pre-existing cargo installs but no luck, Steps to reproduce are: seahorse init fizzbuzz, copy contract code over to fizzbuzz.py and then seahorse build yields:

    ... required by package pyth-sdk-solana v0.8.0
    ... which satisfies dependency pyth-sdk-solana = "^0.8.0" of package fizzbuzz v0.1.0 (/mnt/data/code/fizzbuzz/programs/fizzbuzz)
versions that meet the requirements >=1.9, <=1.16 are: 1.16.27, 1.16.25, 1.16.24, 1.16.23, 1.16.22, 1.16.21, 1.16.20, 1.16.19, 1.16.18, 1.16.17, 1.16.16, 1.16.15, 1.16.14, 1.16.13, 1.16.12, 1.16.11, 1.16.10, 1.16.9, 1.16.8, 1.16.7, 1.16.6, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16.0, 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.14.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.17.3
    ... which satisfies dependency solana-program = "^1.17.3" of package anchor-lang v0.30.1
    ... which satisfies dependency anchor-lang = "^0.30.1" of package fizzbuzz v0.1.0 (/mnt/data/code/fizzbuzz/programs/fizzbuzz)

failed to select a version for solana-program which could resolve this conflict

I've tried running cargo update -p <package> --precise <version> to set the version of each package mentioned in the error but it just returns the same error. When i try and override the version via Cargo.tom [dependencies], i get: this virtual manifest specifies adependenciessection, which is not allowed.