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

build: update nixpkgs, cargo and crates #105

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "h2"]
path = h2
url = https://github.com/openebs/h2.git
branch = v0.3-auth-fix
branch = v0.4.x
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
41 changes: 20 additions & 21 deletions apis/events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,26 @@ edition = "2021"


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

[features]
default = ["rls-ring"]
rls-aws-lc-rs = ["async-nats/aws-lc-rs"]
rls-ring = ["async-nats/ring"]

[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 = { version = "0.37.0", default-features = false }
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}"));
}
3 changes: 1 addition & 2 deletions apis/events/src/event_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ use crate::event::{
SwitchOverEventDetails, SwitchOverStatus, Version,
};
use chrono::{DateTime, Utc};
use once_cell::sync::OnceCell;
use std::{str::FromStr, time::Duration};

/// Once cell static variable to store the component field of the event source.
static COMPONENT: OnceCell<Component> = OnceCell::new();
static COMPONENT: std::sync::OnceLock<Component> = std::sync::OnceLock::new();

/// Initialize the event source component with the service name.
pub fn initialize_source_component(comp: &str) {
Expand Down
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
21 changes: 7 additions & 14 deletions composer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
[package]
name = "composer"
version = "0.1.0"
authors = ["Tiago Castro <[email protected]>"]
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
15 changes: 7 additions & 8 deletions devinfo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[package]
name = "devinfo"
version = "1.0.0"
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
21 changes: 10 additions & 11 deletions event-publisher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name = "event-publisher"
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"
events-api = { path = "../apis/events" }
[features]
default = ["rls-ring"]
rls-aws-lc-rs = ["events-api/rls-aws-lc-rs"]
rls-ring = ["events-api/rls-ring"]

[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"
[dependencies]
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", default-features = false }
2 changes: 1 addition & 1 deletion h2
Submodule h2 updated 44 files
+6 −0 .github/workflows/CI.yml
+26 −6 CHANGELOG.md
+2 −2 CONTRIBUTING.md
+13 −8 Cargo.toml
+1 −1 README.md
+148 −0 benches/main.rs
+2 −12 examples/akamai.rs
+1 −1 fuzz/Cargo.toml
+29 −8 src/client.rs
+177 −18 src/frame/headers.rs
+0 −2 src/frame/stream_id.rs
+1 −1 src/hpack/encoder.rs
+1 −1 src/hpack/table.rs
+1 −1 src/hpack/test/fixture.rs
+24 −2 src/lib.rs
+24 −7 src/proto/connection.rs
+1 −1 src/proto/ping_pong.rs
+16 −2 src/proto/settings.rs
+4 −0 src/proto/streams/buffer.rs
+5 −5 src/proto/streams/counts.rs
+0 −3 src/proto/streams/mod.rs
+1 −4 src/proto/streams/prioritize.rs
+9 −5 src/proto/streams/recv.rs
+1 −1 src/proto/streams/send.rs
+1 −0 src/proto/streams/store.rs
+20 −1 src/proto/streams/stream.rs
+32 −5 src/proto/streams/streams.rs
+2 −8 src/server.rs
+4 −4 src/share.rs
+1 −1 tests/h2-fuzz/Cargo.toml
+1 −1 tests/h2-support/Cargo.toml
+9 −16 tests/h2-support/src/frames.rs
+137 −4 tests/h2-support/src/future_ext.rs
+16 −0 tests/h2-support/src/mock.rs
+1 −1 tests/h2-support/src/prelude.rs
+256 −7 tests/h2-tests/tests/client_request.rs
+0 −1 tests/h2-tests/tests/codec_read.rs
+0 −1 tests/h2-tests/tests/codec_write.rs
+0 −1 tests/h2-tests/tests/flow_control.rs
+0 −1 tests/h2-tests/tests/ping_pong.rs
+0 −1 tests/h2-tests/tests/prioritization.rs
+2 −3 tests/h2-tests/tests/push_promise.rs
+114 −26 tests/h2-tests/tests/server.rs
+1 −1 tests/h2-tests/tests/stream_states.rs
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

Loading
Loading