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

Issue with subtle dependency #612

Open
de-ltd opened this issue Apr 5, 2024 · 6 comments
Open

Issue with subtle dependency #612

de-ltd opened this issue Apr 5, 2024 · 6 comments

Comments

@de-ltd
Copy link

de-ltd commented Apr 5, 2024

stdout : error: failed to select a version for subtle.
... required by package rustls v0.22.0
... which satisfies dependency rustls = "^0.22" of package tokio-rustls v0.25.0
... which satisfies dependency tokio-rustls = "^0.25" of package jsonrpsee-client-transport v0.21.0
... which satisfies dependency jsonrpsee-client-transport = "^0.21.0" of package jsonrpsee-ws-client v0.21.0
... which satisfies dependency jsonrpsee-ws-client = "^0.21.0" of package jsonrpsee v0.21.0
... which satisfies dependency jsonrpsee = "^0.21.0" (locked to 0.21.0) of package prog v0.1.0 versions that meet the requirements ^2.5.0` are: 2.5.0

all possible versions conflict with previously selected packages.

previously selected package subtle v2.4.1
... which satisfies dependency subtle = "^2.2.1" (locked to 2.4.1) of package curve25519-dalek v3.2.1 (https://github.com/solana-labs/curve25519-dalek.git?rev=c14774464c4d38de553c6ef2f48a10982c1b4801#c1477446)
... which satisfies dependency curve25519-dalek = "^3.2.1" (locked to 3.2.1) of package solana-program v1.18.9
... which satisfies dependency solana-program = "^1.18.9" (locked to 1.18.9) of package `prog v0.1.0

failed to select a version for subtle which could resolve this conflict

@ivs
Copy link

ivs commented Jun 3, 2024

Hey! Google brought me here:)

I figured out this problem by tracking down rustls deps in solana and reqwest version:
https://github.com/solana-labs/solana/blob/27eff8408b7223bb3c4ab70523f8a8dca3ca6645/Cargo.toml#L289
https://crates.io/crates/reqwest/0.11.27/dependencies

This one worked for me:
reqwest = { version = "0.11.27", default-features = false, features = ["json", "rustls-tls"] }

It's important to disable default-features, otherwise reqwest still linked to openssl.
With rustls app can be build from scratch docker image, without openssl dependency hell:

FROM lukemathwalker/cargo-chef:latest-rust-alpine as chef
WORKDIR /app

FROM chef AS planner
COPY ./Cargo.toml ./Cargo.lock ./
COPY ./src ./src
RUN cargo chef prepare

FROM chef AS builder
COPY --from=planner /app/recipe.json .
RUN cargo chef cook --release
COPY . .
RUN cargo build --release
RUN cp ./target/release/pools ./app
RUN ls -lah ./app

FROM scratch AS runtime
WORKDIR /
ENV RUST_LOG=info
COPY --from=builder /app/app /
ENTRYPOINT ["/app"]

Just 80mb image.

@ivs
Copy link

ivs commented Jun 8, 2024

Addition of tokio-tungstenite forced me to patch deps, at least zeroize to 1.6.0
Precise versions + patched deps:

reqwest = { version = "0.11.27", default-features = false, features = ["json", "rustls-tls"] }
tokio-tungstenite = { version = "0.20.1", features = ["rustls"] }

[patch.crates-io]
curve25519-dalek = { git = 'https://github.com/ivs/curve25519-dalek', branch='rustls-dep-hell' }
aes-gcm-siv = { git = 'https://github.com/ivs/AEADs', branch='rustls-dep-hell' }

Also solana-zk-token-sdk should be explicitly set to solana-client/sdk version.

And solana-zk-token-sdk is exactly the root cause of rustls dephell, it would be nice to update versions:
aes-gcm-siv to have subtle >=2.5.0 and zeroize >=1.6.0
curve25519-dalek to have zeroize >=1.6.0

It will unlock rustls 22.1.* deps, and it looks like zeroize >= 1.7.0 will help with 22.2.*.

@ohaddahan
Copy link

reqwest

Hi @ivs tried you solution but it didn't work for me.
Odd this, regular cargo build or even cargo tauri dev works fine.
But cargo tauri ios dev fails with the following:

error: failed to select a version for `subtle`.
    ... required by package `rustls v0.22.2`
    ... which satisfies dependency `rustls = "^0.22.2"` of package `reqwest v0.12.4`
    ... which satisfies dependency `reqwest = "^0.12"` (locked to 0.12.4) of package `tauri v2.0.0-beta.23`
    ... which satisfies dependency `tauri = "^2.0.0-beta"` (locked to 2.0.0-beta.23) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`
versions that meet the requirements `^2.5.0` are: 2.6.1, 2.5.0

all possible versions conflict with previously selected packages.

  previously selected package `subtle v2.4.1`
    ... which satisfies dependency `subtle = "^2.4"` (locked to 2.4.1) of package `digest v0.10.7`
    ... which satisfies dependency `digest = "^0.10.7"` (locked to 0.10.7) of package `solana-sdk v1.18.19`
    ... which satisfies dependency `solana-sdk = "^1.18.2"` (locked to 1.18.19) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`

It's on this branch block-mesh/block-mesh-monorepo#289 , I'm willing to put a $100 bounty to resolve this.

@ivs
Copy link

ivs commented Jul 26, 2024

reqwest

Hi @ivs tried you solution but it didn't work for me. Odd this, regular cargo build or even cargo tauri dev works fine. But cargo tauri ios dev fails with the following:

error: failed to select a version for `subtle`.
    ... required by package `rustls v0.22.2`
    ... which satisfies dependency `rustls = "^0.22.2"` of package `reqwest v0.12.4`
    ... which satisfies dependency `reqwest = "^0.12"` (locked to 0.12.4) of package `tauri v2.0.0-beta.23`
    ... which satisfies dependency `tauri = "^2.0.0-beta"` (locked to 2.0.0-beta.23) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`
versions that meet the requirements `^2.5.0` are: 2.6.1, 2.5.0

all possible versions conflict with previously selected packages.

  previously selected package `subtle v2.4.1`
    ... which satisfies dependency `subtle = "^2.4"` (locked to 2.4.1) of package `digest v0.10.7`
    ... which satisfies dependency `digest = "^0.10.7"` (locked to 0.10.7) of package `solana-sdk v1.18.19`
    ... which satisfies dependency `solana-sdk = "^1.18.2"` (locked to 1.18.19) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`

It's on this branch block-mesh/block-mesh-monorepo#289 , I'm willing to put a $100 bounty to resolve this.

@ohaddahan in your recent commit I see you have figured it out? I did the same, just fork a repo and update deps there, then last solana-sdk conflicted with reqwest itself, but I just froze reqwest version. Almost always it works fine, I think only for old base64 lib I have patched raydium program to switch to a newer api. BTW why are you on 1.8.* version? 1.7 is considered to be stable, 1.8 has market stable just two days ago.

@ohaddahan
Copy link

Can you ping me, you have no contact details here.
See my profile info for contact info.
Would love to resolve this and pay the reward I promised.

@ohaddahan
Copy link

reqwest

Hi @ivs tried you solution but it didn't work for me. Odd this, regular cargo build or even cargo tauri dev works fine. But cargo tauri ios dev fails with the following:

error: failed to select a version for `subtle`.
    ... required by package `rustls v0.22.2`
    ... which satisfies dependency `rustls = "^0.22.2"` of package `reqwest v0.12.4`
    ... which satisfies dependency `reqwest = "^0.12"` (locked to 0.12.4) of package `tauri v2.0.0-beta.23`
    ... which satisfies dependency `tauri = "^2.0.0-beta"` (locked to 2.0.0-beta.23) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`
versions that meet the requirements `^2.5.0` are: 2.6.1, 2.5.0

all possible versions conflict with previously selected packages.

  previously selected package `subtle v2.4.1`
    ... which satisfies dependency `subtle = "^2.4"` (locked to 2.4.1) of package `digest v0.10.7`
    ... which satisfies dependency `digest = "^0.10.7"` (locked to 0.10.7) of package `solana-sdk v1.18.19`
    ... which satisfies dependency `solana-sdk = "^1.18.2"` (locked to 1.18.19) of package `blockmesh_tauri v0.0.108 (/Users/ohaddahan/RustroverProjects/block-mesh-monorepo/libs/blockmesh-bin/src-tauri)`

It's on this branch block-mesh/block-mesh-monorepo#289 , I'm willing to put a $100 bounty to resolve this.

@ohaddahan in your recent commit I see you have figured it out? I did the same, just fork a repo and update deps there, then last solana-sdk conflicted with reqwest itself, but I just froze reqwest version. Almost always it works fine, I think only for old base64 lib I have patched raydium program to switch to a newer api. BTW why are you on 1.8.* version? 1.7 is considered to be stable, 1.8 has market stable just two days ago.

Can you specify with which exact changes it worked for you?
Also can skip cargo tauri io dev if you just add rustls to tauri features, then cargo build will have the same failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants