< 返回版块

trybye 发表于 2024-07-19 13:56

Tags:依赖,冲突

error: failed to select a version for `zeroize`.
    ... required by package `curve25519-dalek v3.2.1`
    ... which satisfies dependency `curve25519-dalek = "^3.2.1"` of package `solana-program v1.18.0`
    ... which satisfies dependency `solana-program = "=1.18.0"` of package `solana-sdk v1.18.0`
    ... which satisfies dependency `solana-sdk = "=1.18.0"` of package `solana-clap-utils v1.18.0`
    ... which satisfies dependency `solana-clap-utils = "^1.18"` of package `sol_utils v0.1.0 (/Users/rust/axum-learn/sol_utils)`
    ... which satisfies path dependency `sol_utils` (locked to 0.1.0) of package `axum-learn v0.1.0 (/Users/rust/axum-learn)`
versions that meet the requirements `>=1, <1.4` are: 1.3.0, 1.2.0, 1.1.1, 1.1.0, 1.0.0

all possible versions conflict with previously selected packages.

  previously selected package `zeroize v1.5.3`
    ... which satisfies dependency `zeroize = "^1.5"` of package `rsa v0.9.0`
    ... which satisfies dependency `rsa = "^0.9"` of package `sqlx-mysql v0.7.0`
    ... which satisfies dependency `sqlx-mysql = "=0.7.0"` of package `sqlx v0.7.0`
    ... which satisfies dependency `sqlx = "^0.7"` of package `sea-orm v0.12.2`
    ... which satisfies dependency `sea-orm = "^0.12.1"` of package `sea-orm-migration v0.12.1`
    ... which satisfies dependency `sea-orm-migration = "^0.12.0"` of package `migration v0.1.0 (/Users/rust/axum-learn/migration)`
    ... which satisfies path dependency `migration` (locked to 0.1.0) of package `api v0.1.0 (/Users/rust/axum-learn/api)`
    ... which satisfies path dependency `api` (locked to 0.1.0) of package `axum-learn v0.1.0 (/Users/rust/axum-learn)`

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

引入的sea-orm和solana相关的依赖冲突了,网上搜了没找到比较好的解决方法,一般这种怎么解决

评论区

写评论
作者 trybye 2024-07-20 07:59

用patch,是需要吧源码拉下来,自己改源码,使之兼容2个版本,这种代价有点大,还要改别人写的东西

--
👇
Cupnfish: https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

作者 trybye 2024-07-20 07:50

rust的解决方案操作其他是不是比其他语言繁琐好多😭

👇
fjchen7: 这是能做到的,但需要reexport间接依赖。比如你的Cargo.toml引用了依赖foo和bar 1.2,然后foo自身又依赖了bar 1.1,并且reexport出来了,那你是可以在项目里同时使用bar 1.2和bar1.1的。

--
👇
trybye: 如果rust允许不同版本的依赖是不是最优解

--
👇
Cupnfish: https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

作者 trybye 2024-07-19 19:31

用了workspace能解决这个问题吗

--
👇
Cupnfish: https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

fjchen7 2024-07-19 19:25

这是能做到的,但需要reexport间接依赖。比如你的Cargo.toml引用了依赖foo和bar 1.2,然后foo自身又依赖了bar 1.1,并且reexport出来了,那你是可以在项目里同时使用bar 1.2和bar1.1的。

--
👇
trybye: 如果rust允许不同版本的依赖是不是最优解

--
👇
Cupnfish: https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

作者 trybye 2024-07-19 18:10

如果rust允许不同版本的依赖是不是最优解

--
👇
Cupnfish: https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

Cupnfish 2024-07-19 17:29

https://github.com/solana-labs/solana/issues/26688

里面有解决方案,要么降低一个版本,要么使用patch

jellybobbin 2024-07-19 17:23

或者手动 拉下来一层一层改依赖版本,但是要处理可能编译失败的情况。

--
👇
jellybobbin: 降低 sea-orm 的版本试试

jellybobbin 2024-07-19 17:17

降低 sea-orm 的版本试试

1 共 8 条评论, 1 页