Skip to content

Commit

Permalink
build: update nixpkgs, cargo and crates
Browse files Browse the repository at this point in the history
Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Oct 30, 2024
1 parent d627f01 commit e3e3545
Show file tree
Hide file tree
Showing 23 changed files with 97 additions and 111 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: nixpkgs-fmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: trailing-whitespace
- repo: local
Expand Down
36 changes: 15 additions & 21 deletions apis/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@ edition = "2021"


[build-dependencies]
tonic-build = "0.10.2"
tonic-build = "0.12.3"

[dependencies]
async-nats = "0.32.1"
bytes = "1.5.0"
serde = "1.0.188"
serde_json = "1.0.107"
tokio = "1.32.0"
tracing = "0.1.37"
uuid = { version = "1.4.1", features = ["v4"] }
async-trait = "0.1.73"
futures = "0.3.28"
snafu = "0.7.5"
tonic = "0.10.2"
prost = "0.12.1"
chrono = "0.4.31"
once_cell = "1.18.0"
async-nats = "0.37.0"
bytes = "1.8.0"
serde = "1.0.214"
serde_json = "1.0.132"
tokio = "1.41.0"
tracing = "0.1.40"
uuid = { version = "1.11.0", features = ["v4"] }
async-trait = "0.1.83"
futures = "0.3.31"
snafu = "0.8.5"
tonic = "0.12.3"
prost = "0.13.3"
chrono = "0.4.38"
once_cell = "1.20.2"
prost-extend = { path = "../../prost-extend" }

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
2 changes: 1 addition & 1 deletion apis/events/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ fn main() {
.type_attribute(".", "#[derive(serde::Deserialize, serde::Serialize)]")
.extern_path(".google.protobuf.Timestamp", "::prost_extend::Timestamp")
.extern_path(".google.protobuf.Duration", "::prost_extend::Duration")
.compile(&["protobuf/v1/event.proto"], &["protobuf/"])
.compile_protos(&["protobuf/v1/event.proto"], &["protobuf/"])
.unwrap_or_else(|e| panic!("event v1 protobuf compilation failed: {e}"));
}
26 changes: 10 additions & 16 deletions apis/io-engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ version = "1.0.0"
edition = "2021"

[build-dependencies]
tonic-build = "0.10.2"
prost-build = "0.12.1"
tonic-build = "0.12.3"
prost-build = "0.13.3"

[dependencies]
tonic = "0.10.2"
bytes = "1.5.0"
prost = "0.12.1"
prost-derive = "0.12.1"
tonic = "0.12.3"
bytes = "1.8.0"
prost = "0.13.3"
prost-derive = "0.13.3"
prost-extend = { path = "../../prost-extend" }
prost-types = "0.12.1"
serde = { version = "1.0.188", features = ["derive"] }
serde_derive = "1.0.188"
serde_json = "1.0.107"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
prost-types = "0.13.3"
serde = { version = "1.0.214", features = ["derive"] }
serde_derive = "1.0.214"
serde_json = "1.0.132"
4 changes: 2 additions & 2 deletions apis/io-engine/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn main() {
.build_server(true)
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.extern_path(".google.protobuf.Timestamp", "::prost_extend::Timestamp")
.compile(&["protobuf/mayastor.proto"], &["protobuf"])
.compile_protos(&["protobuf/mayastor.proto"], &["protobuf"])
.unwrap_or_else(|e| panic!("io-engine protobuf compilation failed: {}", e));

tonic_build::configure()
Expand All @@ -19,7 +19,7 @@ fn main() {
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.extern_path(".google.protobuf.Timestamp", "::prost_extend::Timestamp")
.extern_path(".google.protobuf.Duration", "::prost_extend::Duration")
.compile(
.compile_protos(
&[
"protobuf/v1/bdev.proto",
"protobuf/v1/json.proto",
Expand Down
1 change: 1 addition & 0 deletions apis/io-engine/src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ mod pb {
// Include Rust sources generated by protobuf.
#![allow(unknown_lints)]
#![allow(clippy::derive_partial_eq_without_eq)]
#![allow(clippy::doc_lazy_continuation)]
tonic::include_proto!("mayastor.v1");
}

Expand Down
20 changes: 7 additions & 13 deletions composer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = { version = "1.32.0", features = [ "full" ] }
futures = "0.3.28"
tracing = "0.1.37"
once_cell = "1.18.0"
tokio = { version = "1.41.0", features = [ "full" ] }
futures = "0.3.31"
tracing = "0.1.40"
once_cell = "1.20.2"
ipnetwork = "0.20.0"
bollard = "0.15.0"
strum = "0.25"
strum_macros = "0.25"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
bollard = "0.17.1"
strum = "0.26"
strum_macros = "0.26"
6 changes: 2 additions & 4 deletions composer/src/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1782,13 +1782,11 @@ impl ComposeTest {
tracing::trace!("Stopping {name:?}/{id}");
self.stop_id(&id)
.await
.map_err(|error| {
.inspect_err(|_| {
tracing::trace!("Failed to stop {name:?}/{id}");
error
})
.map(|ok| {
.inspect(|_| {
tracing::trace!("Stopped {name:?}/{id}");
ok
})
})
.collect::<Vec<_>>();
Expand Down
14 changes: 7 additions & 7 deletions devinfo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ authors = ["Jeffry Molanus <[email protected]>"]
edition = "2018"

[dependencies]
nix = { version = "0.27.1", default-features = false, features = [ "feature" ] }
semver = "1.0.20"
snafu = "0.7.5"
url = "2.4.1"
uuid = { version = "1.4.1", features = ["v4"] }
nix = { version = "0.29.0", default-features = false, features = [ "feature" ] }
semver = "1.0.23"
snafu = "0.8.5"
url = "2.5.2"
uuid = { version = "1.11.0", features = ["v4"] }
[build-dependencies]
bindgen = "0.68.1"
bindgen = "0.70.1"

[target.'cfg(target_os="linux")'.dependencies]
udev = "0.8.0"
udev = "0.9.1"
1 change: 0 additions & 1 deletion devinfo/src/mountinfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ impl FromStr for MountInfo {

impl MountInfo {
/// Attempt to parse a `/proc/mounts`-like line.
fn fetch_from_disk_by_path(path: &str) -> io::Result<PathBuf> {
PartitionID::from_disk_by_path(path)
.map_err(|why| Error::new(ErrorKind::InvalidData, format!("{path}: {why}")))?
Expand Down
14 changes: 4 additions & 10 deletions event-publisher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]
tracing-subscriber = { version = "0.3.17", features = [ "env-filter" ] }
tokio = { version = "1.32.0"}
tracing = "0.1.37"
serde_json = "1.0.107"
tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] }
tokio = { version = "1.41.0"}
tracing = "0.1.40"
serde_json = "1.0.132"
events-api = { path = "../apis/events" }

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
12 changes: 6 additions & 6 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "35f9f5784eb50cabac4db09c8c11035dacf36411",
"sha256": "1gq4ajsmg2f5jdmbdhdavcnlg32bzynvvidvb4648pk4gdcnr49h",
"rev": "b06ca0fab3185980a7501d7db273bb9f864580d4",
"sha256": "08pvwij6855wyxq6giyjwj3mdbrl118zzvbr7xdynmb7w9r9lv0l",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/35f9f5784eb50cabac4db09c8c11035dacf36411.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/b06ca0fab3185980a7501d7db273bb9f864580d4.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"rust-overlay": {
Expand All @@ -17,10 +17,10 @@
"homepage": "",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d064703dc0657a49a17671c74b1a15ea7433e753",
"sha256": "06g1c1ys8ihd3vsjswqrkl8nv9lypizzgivbvwz1aycm34i3ib4z",
"rev": "7509d76ce2b3d22b40bd25368b45c0a9f7f36c89",
"sha256": "12gh5a0clc11b219xrvh08f35v959wnnmm089ys1cmqfdxx9v77n",
"type": "tarball",
"url": "https://github.com/oxalica/rust-overlay/archive/d064703dc0657a49a17671c74b1a15ea7433e753.tar.gz",
"url": "https://github.com/oxalica/rust-overlay/archive/7509d76ce2b3d22b40bd25368b45c0a9f7f36c89.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}
File renamed without changes.
18 changes: 9 additions & 9 deletions nvmeadm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ version = "1.0.0"
edition = "2021"

[dependencies]
derive_builder = "0.12.0"
enum-primitive-derive = "0.2.2"
derive_builder = "0.20.2"
enum-primitive-derive = "0.3.0"
glob = "0.3.1"
ioctl-gen = "0.1.1"
libc = "0.2.148"
nix = { version = "0.27.1", default-features = false, features = [ "ioctl" ] }
num-traits = "0.2.16"
once_cell = "1.18.0"
snafu = "0.7.5"
uuid = { version = "1.4.1", features = ["v4"] }
url = "2.4.1"
libc = "0.2.161"
nix = { version = "0.29.0", default-features = false, features = [ "ioctl" ] }
num-traits = "0.2.19"
once_cell = "1.20.2"
snafu = "0.8.5"
uuid = { version = "1.11.0", features = ["v4"] }
url = "2.5.2"
1 change: 0 additions & 1 deletion nvmeadm/src/nvmf_discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,6 @@ impl ConnectArgs {
/// ```rust
/// let num_disconnects = nvmeadm::nvmf_discovery::disconnect("mynqn");
/// ```
pub fn disconnect(nqn: &str) -> Result<usize, NvmeError> {
let subsys: Result<Vec<Subsystem>, NvmeError> = NvmeSubsystems::new()?
.filter_map(Result::ok)
Expand Down
3 changes: 2 additions & 1 deletion nvmeadm/tests/discovery_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ fn disconnect_test() {
fn test_against_real_target() {
// Disconnect all pre-existing NVMe connections to make sure new controller
// always gets id = 0.
let _nvme_disconnect = Command::new("nvme")
Command::new("nvme")
.arg("disconnect-all")
.spawn()
.and_then(|mut child| child.wait())
.expect("Failed to cleanup NVMe connections !");

// Start an SPDK-based nvmf target
Expand Down
14 changes: 4 additions & 10 deletions prost-extend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@ description = "A thinner prost-wkt fork with just the bits we need"


[build-dependencies]
tonic-build = "0.10.2"
tonic-build = "0.12.3"

[dependencies]
chrono = "0.4.26"
serde = { version = "1.0.183", features = [ "derive" ] }
prost = "0.12.1"

[dev-dependencies.serde]
# v1.0.198 introduces a breaking change by making use of unstable feature saturating_int_impl!
# Let's ensure we don't use v.1.0.198 or newer until we upgrade the compiler!
# https://github.com/serde-rs/serde/issues/2734
version = ">=1.0.188,<1.0.198"
chrono = "0.4.38"
serde = { version = "1.0.214", features = [ "derive" ] }
prost = "0.13.3"
2 changes: 1 addition & 1 deletion prost-extend/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ fn main() {
"google.protobuf.Duration",
"#[derive(serde::Serialize, serde::Deserialize)] #[serde(default)]",
)
.compile(&["protobuf/v1/pb_time.proto"], &["protobuf/"])
.compile_protos(&["protobuf/v1/pb_time.proto"], &["protobuf/"])
.unwrap_or_else(|e| panic!("prost-extend v1 protobuf compilation failed: {e}"));
}
2 changes: 1 addition & 1 deletion prost-extend/src/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const NANOS_MAX: i32 = NANOS_PER_SECOND - 1;

impl fmt::Display for Duration {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut d = self.clone();
let mut d = *self;
d.normalize();
if self.seconds < 0 && self.nanos < 0 {
write!(f, "-")?;
Expand Down
4 changes: 2 additions & 2 deletions prost-extend/src/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl TryFrom<Timestamp> for DateTime<Utc> {
/// Converts proto timestamp to chrono's DateTime<Utc>.
impl Timestamp {
fn date_time_utc(&self) -> DateTime<Utc> {
DateTime::<Utc>::try_from(self.clone()).expect("invalid or out-of-range datetime")
DateTime::<Utc>::try_from(*self).expect("invalid or out-of-range datetime")
}
}

Expand Down Expand Up @@ -114,7 +114,7 @@ impl<'de> Deserialize<'de> for Timestamp {
{
struct TimestampVisitor;

impl<'de> Visitor<'de> for TimestampVisitor {
impl Visitor<'_> for TimestampVisitor {
type Value = Timestamp;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
10 changes: 10 additions & 0 deletions scripts/rust/for_each.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -euo pipefail

for d in `find -maxdepth 3 -name Cargo.toml -printf '%h\n' | grep -v "^./h2"`; do
pushd $d
$@
popd
done

14 changes: 11 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ profile ? "nightly", version ? "2024-02-06" }:
{ profile ? "nightly", version ? "2024-10-30" }:
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
Expand Down Expand Up @@ -35,7 +35,15 @@ pkgs.mkShell {
NODE_PATH = "${nodePackages."@commitlint/config-conventional"}/lib/node_modules";

shellHook = ''
pre-commit install
pre-commit install --hook commit-msg
if [ -z "$CI" ] && [ "$IN_NIX_SHELL" = "impure" ]; then
pre-commit install
pre-commit install --hook commit-msg
fi
if [ -d ~/.cargo/bin ]; then
# Adding ~/.cargo/bin to the path let's us carry on using rustup but it lowers its
# priority: https://github.com/rust-lang/cargo/pull/11023
export PATH=$PATH:~/.cargo/bin
fi
'';
}
2 changes: 1 addition & 1 deletion tracing-filter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tracing-subscriber = { version = "0.3.17", features = [ "env-filter" ] }
tracing-subscriber = { version = "0.3.18", features = [ "env-filter" ] }

0 comments on commit e3e3545

Please sign in to comment.