bastion-rs / bastion

Highly-available Distributed Fault-tolerant Runtime
https://www.bastion-rs.com
Apache License 2.0
2.78k stars 101 forks source link

Upgrade dependency `lasso` from version 0.6.0 to 0.7.2 #348

Open neoneye opened 9 months ago

neoneye commented 9 months ago

Problem

A few days ago ahash version 0.7.x was yanked from crates.io.

Now the ahash 0.7.6 crate shows this message:

This crate has been yanked, but it is still available for download for other crates that may be depending on it.

Bastion depends on lasso that depends on hashbrown that depends on ahash.

Solution

The file to be edited: https://github.com/bastion-rs/bastion/blob/master/src/bastion/Cargo.toml

Replace lasso dependency with a newer version https://crates.io/crates/lasso/versions

I guess the solution is to update from 0.6 to 0.7, so the line is going to be this:

lasso = { version = "0.7", features = ["multi-threaded"] }

I encountered this problem when I tried to build a docker image with my rust project.

My cargo.toml

bastion = { version = "0.4.5", features = ["tokio-runtime"] }

The error I'm getting:

 => [builder 2/7] WORKDIR /my_builddir                                                                                                                 0.2s
 => [builder 3/7] COPY ./loda-rust-core loda-rust-core                                                                                                 0.0s
 => [builder 4/7] COPY ./loda-rust-cli loda-rust-cli                                                                                                   0.0s
 => [builder 5/7] COPY ./loda-rust-web loda-rust-web                                                                                                   0.1s
 => [builder 6/7] COPY ./Cargo.toml Cargo.toml                                                                                                         0.0s
 => ERROR [builder 7/7] RUN cargo build --config net.git-fetch-with-cli=true --release -p loda-rust-cli                                                2.3s
------                                                                                                                                                      
 > [builder 7/7] RUN cargo build --config net.git-fetch-with-cli=true --release -p loda-rust-cli:                                                           
0.678     Updating crates.io index
2.318 error: failed to select a version for the requirement `ahash = "=0.7.4"`
2.318 candidate versions found which didn't match: 0.8.5, 0.8.4, 0.4.1, ...
2.318 location searched: crates.io index
2.318 required by package `loda-rust-cli v2023.10.23 (/my_builddir/loda-rust-cli)`
2.318 perhaps a crate was updated and forgotten to be re-vendored?
------
arc.Dockerfile:10
--------------------
   8 |     COPY ./loda-rust-web loda-rust-web
   9 |     COPY ./Cargo.toml Cargo.toml
  10 | >>> RUN cargo build --config net.git-fetch-with-cli=true --release -p loda-rust-cli
  11 |     
  12 |     ####################################################################################################
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --config net.git-fetch-with-cli=true --release -p loda-rust-cli" did not complete successfully: exit code: 101

My work around.

Update cargo.toml so it uses old versions.

ahash = "0.7.4" 
hashbrown = "0.11.2"
lasso = "0.6.0"

Make use of Cargo.lock when building my docker image. I inserted --locked into the cargo build command.