awslabs / awslabs/flowgger

Build fail with redis feature

Open
#71 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
879
Forks
61
PR merge metrics
No merged PRs in 30d

Description

Hi. I'm getting errors while trying to build `flowgger` with `--all-features` (rust 1.62.0) as pointed out in https://gitlab.alpinelinux.org/alpine/aports/-/issues/13952#note_243393.

Changing the declaration to `let mut ...` (like the log suggests) makes the build pass but I honestly don't know whether things will break. This seems to be happen after `redis-rs` 0.11.0-beta1 release (ref: https://github.com/redis-rs/redis-rs/blob/main/CHANGELOG.md#0110-beta1---2019-05-30)

```rust
warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:52:18
|
52 | decoder: Box,
| ^^^^^^^
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
52 - decoder: Box,
52 + decoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:53:18
|
53 | encoder: Box,
| ^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
53 - encoder: Box,
53 + encoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:29:22
|
29 | decoder: Box,
| ^^^^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
29 - decoder: Box,
29 + decoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:30:22
|
30 | encoder: Box,
| ^^^^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
30 - encoder: Box,
30 + encoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:52:18
|
52 | decoder: Box,
| ^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
52 - decoder: Box,
52 + decoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:53:18
|
53 | encoder: Box,
| ^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
53 - encoder: Box,
53 + encoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:29:22
|
29 | decoder: Box,
| ^^^^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
29 - decoder: Box,
29 + decoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:30:22
|
30 | encoder: Box,
| ^^^^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
30 - encoder: Box,
30 + encoder: Box,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:61:51
|
61 | "capnp" => Box::new(CapnpSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
61 - "capnp" => Box::new(CapnpSplitter) as Box>,
61 + "capnp" => Box::new(CapnpSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:62:49
|
62 | "line" => Box::new(LineSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
62 - "line" => Box::new(LineSplitter) as Box>,
62 + "line" => Box::new(LineSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:63:53
|
63 | "syslen" => Box::new(SyslenSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
63 - "syslen" => Box::new(SyslenSplitter) as Box>,
63 + "syslen" => Box::new(SyslenSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tcp/tcpco_input.rs:64:47
|
64 | "nul" => Box::new(NulSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
64 - "nul" => Box::new(NulSplitter) as Box>,
64 + "nul" => Box::new(NulSplitter) as Box>,
|

warning: use of deprecated associated function `may::Config::set_io_workers`: use `set_workers` only
--> src/flowgger/input/tls/tlsco_input.rs:33:23
|
33 | may::config().set_io_workers(tls_config.threads);
| ^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:68:51
|
68 | "capnp" => Box::new(CapnpSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
68 - "capnp" => Box::new(CapnpSplitter) as Box>,
68 + "capnp" => Box::new(CapnpSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:69:49
|
69 | "line" => Box::new(LineSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
69 - "line" => Box::new(LineSplitter) as Box>,
69 + "line" => Box::new(LineSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:70:53
|
70 | "syslen" => Box::new(SyslenSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
70 - "syslen" => Box::new(SyslenSplitter) as Box>,
70 + "syslen" => Box::new(SyslenSplitter) as Box>,
|

warning: trait objects without an explicit `dyn` are deprecated
--> src/flowgger/input/tls/tlsco_input.rs:71:47
|
71 | "nul" => Box::new(NulSplitter) as Box>,
| ^^^^^^^^^^^
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
= note: for more information, see
help: use `dyn`
|
71 - "nul" => Box::new(NulSplitter) as Box>,
71 + "nul" => Box::new(NulSplitter) as Box>,
|

error[E0596]: cannot borrow `redis_cnx` as mutable, as it is not declared as mutable
--> src/flowgger/input/redis_input.rs:105:46
|
99 | let redis_cnx = self.redis_cnx;
| --------- help: consider changing this to be mutable: `mut redis_cnx`
...
105 | let dummy: RedisResult = redis_cnx.rpoplpush(queue_key_tmp, queue_key);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `redis_cnx` as mutable, as it is not declared as mutable
--> src/flowgger/input/redis_input.rs:110:38
|
99 | let redis_cnx = self.redis_cnx;
| --------- help: consider changing this to be mutable: `mut redis_cnx`
...
110 | let line: String = match redis_cnx.brpoplpush(queue_key, queue_key_tmp, 0) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `redis_cnx` as mutable, as it is not declared as mutable
--> src/flowgger/input/redis_input.rs:117:40
|
99 | let redis_cnx = self.redis_cnx;
| --------- help: consider changing this to be mutable: `mut redis_cnx`
...
117 | let res: RedisResult = redis_cnx.lrem(queue_key_tmp as &str, 1, line as String);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

For more information about this error, try `rustc --explain E0596`.
warning: `flowgger` (lib) generated 17 warnings
error: could not compile `flowgger` due to 3 previous errors; 17 warnings emitted
```

Contributor guide

Open the contributing guide

Research direction

Start with src/flowgger/input/redis_input.rs around the redis_cnx declaration at line 99 and the failing Redis calls at lines 105, 110, and 117. Run the reported Rust 1.62.0 build with --all-features, then verify that the Redis feature builds successfully without changing its runtime behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
redis, rust
Domain
backend, databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.