2

For some reason when trying to compile a project having both sqlx and solana-program I get an error on package version mismatches, which is strange, because those should come from different crates and are unreleated? Is there anything I can do to use newer sqlx version, or am I stuck with 0.6.3?

Here are the exerts:

solana-program = "1.18.2"
sqlx = { version = "0.7.3", features = ["postgres", "runtime-tokio-rustls", "time", "macros", "bigdecimal"] }
error: failed to select a version for `zeroize`.
    ... required by package `rsa v0.9.0`
    ... which satisfies dependency `rsa = "^0.9"` of package `sqlx-mysql v0.7.3`
    ... which satisfies dependency `sqlx-mysql = "=0.7.3"` of package `sqlx v0.7.3`
    ... which satisfies dependency `sqlx = "^0.7.3"` of package `solana-program-pain v0.1.0 (/home/sheep/LinksDevices/Space/home/_Work/solana-program-pain)`
versions that meet the requirements `^1.5` are: 1.7.0, 1.6.0, 1.5.7, 1.5.6, 1.5.5, 1.5.4, 1.5.3

all possible versions conflict with previously selected packages.

  previously selected package `zeroize v1.0.0`
    ... which satisfies dependency `zeroize = ">=1, <1.4"` of package `curve25519-dalek v3.2.1`
    ... which satisfies dependency `curve25519-dalek = "^3.2.1"` of package `solana-program v1.18.2`
    ... which satisfies dependency `solana-program = "^1.18.2"` of package `solana-program-pain v0.1.0 (/home/sheep/LinksDevices/Space/home/_Work/solana-program-pain)`

failed to select a version for `zeroize` which could resolve this co

1 Answer 1

3

It's a bit annoying, but it's possible to fix this if you patch a few crates in your Cargo.toml. There's a PR out to do that in the Solana monorepo at https://github.com/solana-labs/solana/pull/33853. In your case, you'll need:

[patch.crates-io.aes-gcm-siv]
git = "https://github.com/RustCrypto/AEADs"
rev = "6105d7a5591aefa646a95d12b5e8d3f55a9214ef"

[patch.crates-io.curve25519-dalek]
git = "https://github.com/solana-labs/curve25519-dalek.git"
rev = "c14774464c4d38de553c6ef2f48a10982c1b4801"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.