Skip to content

Commit

Permalink
chore: update third party and remove circular dep (infinyon#3241)
Browse files Browse the repository at this point in the history
- update sysinfo
- remove circular dep within fluvio protocol derive
  • Loading branch information
sehz authored and EstebanBorai committed May 10, 2023
1 parent c5a5c6c commit b511ca4
Show file tree
Hide file tree
Showing 53 changed files with 557 additions and 540 deletions.
133 changes: 67 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Expand Up @@ -85,6 +85,7 @@ directories = "5.0.0"
dirs = "5.0.0"
duct = { version = "0.13", default-features = false }
event-listener = "2.5.1"
eyre = { version = "0.6", default-features = false}
flate2 = { version = "1.0.25" }
futures = { version = "0.3.1" }
futures-util = { version = "0.3.6", default-features = false }
Expand All @@ -103,7 +104,7 @@ serde = { version = "1.0.144", default-features = false }
serde_json = "1.0.60"
serde_yaml = { version = "0.9.0", default-features = false }
siphasher = "0.3.5"
sysinfo = { version = "0.28.0", default-features = false }
sysinfo = { version = "0.29.0", default-features = false }
syn = "1.0"
static_assertions = "1.1.0"
tar = { version = "0.4.38", default-features = false }
Expand Down
11 changes: 11 additions & 0 deletions crates/fluvio-connector-common/Cargo.toml
Expand Up @@ -11,6 +11,11 @@ description = "Fluvio Connector Common SDK"
default = []
derive = ["fluvio-connector-derive"]

[[test]]
name = "derive-test"
path = "ui-test/mod.rs"
required-features = ["derive"]

[dependencies]
async-trait = { workspace = true }
async-net = { workspace = true }
Expand All @@ -28,3 +33,9 @@ fluvio-connector-package = { workspace = true }
fluvio-connector-derive = { path = "../fluvio-connector-derive/", optional = true}
fluvio-sc-schema = { workspace = true }
fluvio-smartengine = { workspace = true , features = [ "transformation"] }


[dev-dependencies]
trybuild = { version = "1.0" }
serde = { workspace = true, features = ["derive"]}
fluvio = { workspace = true }
13 changes: 13 additions & 0 deletions crates/fluvio-connector-common/ui-test/mod.rs
@@ -0,0 +1,13 @@
#[test]
fn ui() {
let t = trybuild::TestCases::new();
t.compile_fail("ui-test/ui/wrong_direction.rs");
t.compile_fail("ui-test/ui/wrong_input_len.rs");
t.compile_fail("ui-test/ui/wrong_rust_type.rs");
t.compile_fail("ui-test/ui/not_async.rs");
t.compile_fail("ui-test/ui/invalid_config_type.rs");
t.compile_fail("ui-test/ui/config_input_self.rs");
t.compile_fail("ui-test/ui/config_use_reserved_name_fluvio.rs");
t.compile_fail("ui-test/ui/config_use_reserved_name_transforms.rs");
t.compile_fail("ui-test/ui/struct_without_config.rs");
}
@@ -1,11 +1,11 @@
error: config input argument must not be self
--> tests/ui/config_input_self.rs:4:19
--> ui-test/ui/config_input_self.rs:4:19
|
4 | async fn start_fn(self, producer: ()) {}
| ^^^^

error[E0601]: `main` function not found in crate `$CRATE`
--> tests/ui/config_input_self.rs:4:41
--> ui-test/ui/config_input_self.rs:4:41
|
4 | async fn start_fn(self, producer: ()) {}
| ^ consider adding a `main` function to `$DIR/tests/ui/config_input_self.rs`
| ^ consider adding a `main` function to `$DIR/ui-test/ui/config_input_self.rs`
@@ -1,38 +1,38 @@
error: Custom config name conflicts with reserved names: 'meta' and 'transforms'
--> tests/ui/config_use_reserved_name_fluvio.rs:7:1
--> ui-test/ui/config_use_reserved_name_fluvio.rs:7:1
|
7 | struct CustomConfig {}
| ^^^^^^

error[E0412]: cannot find type `CustomConfig` in this scope
--> tests/ui/config_use_reserved_name_fluvio.rs:4:27
--> ui-test/ui/config_use_reserved_name_fluvio.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `CustomConfig`
--> tests/ui/config_use_reserved_name_fluvio.rs:4:27
--> ui-test/ui/config_use_reserved_name_fluvio.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ use of undeclared type `CustomConfig`

error[E0308]: mismatched types
--> tests/ui/config_use_reserved_name_fluvio.rs:3:1
--> ui-test/ui/config_use_reserved_name_fluvio.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `TopicProducer`
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| -------- arguments to this function are incorrect
|
note: function defined here
--> tests/ui/config_use_reserved_name_fluvio.rs:4:10
--> ui-test/ui/config_use_reserved_name_fluvio.rs:4:10
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^ ------------
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> tests/ui/config_use_reserved_name_fluvio.rs:3:20
--> ui-test/ui/config_use_reserved_name_fluvio.rs:3:20
|
3 | #[connector(source)]
| -------------------^
Expand All @@ -44,7 +44,7 @@ error[E0277]: the `?` operator can only be used in an async block that returns `
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> tests/ui/config_use_reserved_name_fluvio.rs:3:1
--> ui-test/ui/config_use_reserved_name_fluvio.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
Expand Down
@@ -1,38 +1,38 @@
error: Custom config name conflicts with reserved names: 'meta' and 'transforms'
--> tests/ui/config_use_reserved_name_transforms.rs:7:1
--> ui-test/ui/config_use_reserved_name_transforms.rs:7:1
|
7 | struct CustomConfig {}
| ^^^^^^

error[E0412]: cannot find type `CustomConfig` in this scope
--> tests/ui/config_use_reserved_name_transforms.rs:4:27
--> ui-test/ui/config_use_reserved_name_transforms.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `CustomConfig`
--> tests/ui/config_use_reserved_name_transforms.rs:4:27
--> ui-test/ui/config_use_reserved_name_transforms.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ use of undeclared type `CustomConfig`

error[E0308]: mismatched types
--> tests/ui/config_use_reserved_name_transforms.rs:3:1
--> ui-test/ui/config_use_reserved_name_transforms.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `TopicProducer`
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| -------- arguments to this function are incorrect
|
note: function defined here
--> tests/ui/config_use_reserved_name_transforms.rs:4:10
--> ui-test/ui/config_use_reserved_name_transforms.rs:4:10
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^ ------------
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> tests/ui/config_use_reserved_name_transforms.rs:3:20
--> ui-test/ui/config_use_reserved_name_transforms.rs:3:20
|
3 | #[connector(source)]
| -------------------^
Expand All @@ -44,7 +44,7 @@ error[E0277]: the `?` operator can only be used in an async block that returns `
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> tests/ui/config_use_reserved_name_transforms.rs:3:1
--> ui-test/ui/config_use_reserved_name_transforms.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
Expand Down
@@ -1,11 +1,11 @@
error: config type must valid path of owned type
--> tests/ui/invalid_config_type.rs:4:19
--> ui-test/ui/invalid_config_type.rs:4:19
|
4 | async fn start_fn(config: &[i32], producer: ()) {}
| ^^^^^^

error[E0601]: `main` function not found in crate `$CRATE`
--> tests/ui/invalid_config_type.rs:4:51
--> ui-test/ui/invalid_config_type.rs:4:51
|
4 | async fn start_fn(config: &[i32], producer: ()) {}
| ^ consider adding a `main` function to `$DIR/tests/ui/invalid_config_type.rs`
| ^ consider adding a `main` function to `$DIR/ui-test/ui/invalid_config_type.rs`
@@ -1,11 +1,11 @@
error: Connector function must be async
--> tests/ui/not_async.rs:4:1
--> ui-test/ui/not_async.rs:4:1
|
4 | fn start_fn() {}
| ^^

error[E0601]: `main` function not found in crate `$CRATE`
--> tests/ui/not_async.rs:4:17
--> ui-test/ui/not_async.rs:4:17
|
4 | fn start_fn() {}
| ^ consider adding a `main` function to `$DIR/tests/ui/not_async.rs`
| ^ consider adding a `main` function to `$DIR/ui-test/ui/not_async.rs`
@@ -1,38 +1,38 @@
error: struct must be annotated as config, e.g. '#[connector(config)]'
--> tests/ui/struct_without_config.rs:7:1
--> ui-test/ui/struct_without_config.rs:7:1
|
7 | struct CustomConfig {}
| ^^^^^^

error[E0412]: cannot find type `CustomConfig` in this scope
--> tests/ui/struct_without_config.rs:4:27
--> ui-test/ui/struct_without_config.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ not found in this scope

error[E0433]: failed to resolve: use of undeclared type `CustomConfig`
--> tests/ui/struct_without_config.rs:4:27
--> ui-test/ui/struct_without_config.rs:4:27
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^^^^^ use of undeclared type `CustomConfig`

error[E0308]: mismatched types
--> tests/ui/struct_without_config.rs:3:1
--> ui-test/ui/struct_without_config.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ expected `()`, found `TopicProducer`
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| -------- arguments to this function are incorrect
|
note: function defined here
--> tests/ui/struct_without_config.rs:4:10
--> ui-test/ui/struct_without_config.rs:4:10
|
4 | async fn start_fn(config: CustomConfig, producer: ()) {}
| ^^^^^^^^ ------------
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be used in an async block that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> tests/ui/struct_without_config.rs:3:20
--> ui-test/ui/struct_without_config.rs:3:20
|
3 | #[connector(source)]
| -------------------^
Expand All @@ -44,7 +44,7 @@ error[E0277]: the `?` operator can only be used in an async block that returns `
= note: this error originates in the attribute macro `connector` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> tests/ui/struct_without_config.rs:3:1
--> ui-test/ui/struct_without_config.rs:3:1
|
3 | #[connector(source)]
| ^^^^^^^^^^^^^^^^^^^^ the `?` operator cannot be applied to type `()`
Expand Down
@@ -1,11 +1,11 @@
error: Missing Connector type. Supported: '#[connector(source)]' and '#[connector(sink)]'
--> tests/ui/wrong_direction.rs:3:13
--> ui-test/ui/wrong_direction.rs:3:13
|
3 | #[connector(wrong)]
| ^^^^^

error[E0601]: `main` function not found in crate `$CRATE`
--> tests/ui/wrong_direction.rs:4:17
--> ui-test/ui/wrong_direction.rs:4:17
|
4 | fn start_fn() {}
| ^ consider adding a `main` function to `$DIR/tests/ui/wrong_direction.rs`
| ^ consider adding a `main` function to `$DIR/ui-test/ui/wrong_direction.rs`
@@ -1,11 +1,11 @@
error: Connector function must have two input arguments
--> tests/ui/wrong_input_len.rs:4:1
--> ui-test/ui/wrong_input_len.rs:4:1
|
4 | async fn start_fn() {}
| ^^^^^

error[E0601]: `main` function not found in crate `$CRATE`
--> tests/ui/wrong_input_len.rs:4:23
--> ui-test/ui/wrong_input_len.rs:4:23
|
4 | async fn start_fn() {}
| ^ consider adding a `main` function to `$DIR/tests/ui/wrong_input_len.rs`
| ^ consider adding a `main` function to `$DIR/ui-test/ui/wrong_input_len.rs`
11 changes: 11 additions & 0 deletions crates/fluvio-connector-common/ui-test/ui/wrong_rust_type.stderr
@@ -0,0 +1,11 @@
error: macro supports only functions and structs
--> ui-test/ui/wrong_rust_type.rs:4:1
|
4 | mod start {}
| ^^^

error[E0601]: `main` function not found in crate `$CRATE`
--> ui-test/ui/wrong_rust_type.rs:4:13
|
4 | mod start {}
| ^ consider adding a `main` function to `$DIR/ui-test/ui/wrong_rust_type.rs`
12 changes: 1 addition & 11 deletions crates/fluvio-connector-derive/Cargo.toml
Expand Up @@ -10,17 +10,7 @@ description = "Fluvio SmartConnector procedural macro"
[lib]
proc-macro = true

[package.metadata.cargo-udeps.ignore]
development = ["fluvio", "fluvio-connector-common"]

[dependencies]
syn = { version = "1.0", default-features = false, features = ["full", "parsing", "proc-macro", "derive", "printing"] }
quote = "1.0"
proc-macro2 = "1.0"


[dev-dependencies]
trybuild = { version = "1.0" }
serde = { workspace = true, features = ["derive"]}
fluvio = { workspace = true }
fluvio-connector-common = { path = "../fluvio-connector-common/", features = ["derive"] }
proc-macro2 = "1.0"
13 changes: 0 additions & 13 deletions crates/fluvio-connector-derive/tests/mod.rs

This file was deleted.

11 changes: 0 additions & 11 deletions crates/fluvio-connector-derive/tests/ui/wrong_rust_type.stderr

This file was deleted.

9 changes: 1 addition & 8 deletions crates/fluvio-protocol-derive/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fluvio-protocol-derive"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
authors = ["Fluvio Contributors <team@fluvio.io>"]
description = "Procedure macro to encode/decode fluvio protocol"
Expand All @@ -21,11 +21,4 @@ tracing = "0.1"
version = "1.0.0"
features = ["full"]

[dev-dependencies]
trybuild = { version = "1.0" }

# Local Crates
fluvio-protocol = { path = "../fluvio-protocol", features = ["derive", "api"] }

[package.metadata.cargo-udeps.ignore]
development = ["fluvio-protocol"] # Used only in doc-tests, which `cargo-udeps` cannot check
12 changes: 0 additions & 12 deletions crates/fluvio-protocol-derive/src/ast/container.rs
Expand Up @@ -6,18 +6,6 @@ pub struct ContainerAttributes {
pub varint: bool,
pub default: bool,

/// Encodes a numeric enum by the value of its discriminant
///
/// # Example
///
/// ```rust
/// #[derive(fluvio_protocol::derive::Encoder)]
/// #[fluvio(encode_discriminant)]
/// enum ValueEnum {
/// One = 1, // Encodes discriminant "1"
/// Two = 2, // Encodes discriminant "2"
/// }
/// ```
pub encode_discriminant: bool,
pub api_min_version: u16,
pub api_max_version: Option<u16>,
Expand Down

0 comments on commit b511ca4

Please sign in to comment.