AmbireTech / adex-validator-stack-rust

The Ambire AdEx Validator Stack implemented in Rust: sentry, validator worker, adapter, adview manager
https://adex.network
GNU Affero General Public License v3.0
11 stars 10 forks source link

(UPDATE to 1.48 when released) Rust 1.46 breaks the build, while 1.45 works just fine #330

Closed elpiel closed 3 years ago

elpiel commented 4 years ago

Build Error on Sentry, Rust 1.46:

elpiel@kracho:~/PROJECTS/AdEx/rust-adex-validator-stack$ cargo build -p sentry
   Compiling primitives v0.1.0 (/home/elpiel/PROJECTS/AdEx/rust-adex-validator-stack/primitives)
   Compiling adapter v0.1.0 (/home/elpiel/PROJECTS/AdEx/rust-adex-validator-stack/adapter)
   Compiling sentry v0.1.0 (/home/elpiel/PROJECTS/AdEx/rust-adex-validator-stack/sentry)
error: reached the type-length limit while instantiating `std::future::from_generator::<[s...pter::DummyAdapter>]>>, ()}]>}]>`
  --> /home/elpiel/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/future/mod.rs:59:1
   |
59 | / pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
60 | | where
61 | |     T: Generator<ResumeTy, Yield = ()>,
62 | | {
...  |
85 | |     GenFuture(gen)
86 | | }
   | |_^
   |
   = note: consider adding a `#![type_length_limit="1269353"]` attribute to your crate

error: aborting due to previous error

error: could not compile `sentry`.

To learn more, run the command again with --verbose.

:heavy_check_mark: Revert it Rust 1.45

For now the solution is to revert Rust version to 1.45.2 and upgrade later

TODO: Update to 1.48 when released and see this issue is fixed

Related merged PR: rust-lang/rust#78410

Related Rust bugs:

elpiel commented 4 years ago

rust-lang/rust#75992 was resolved by reverting some commits in https://github.com/rust-lang/rust/pull/78410

For now we are waiting for the next Rust release, probably 1.48 that will be released this(?) week

shirshak55 commented 3 years ago

@elpiel its released yesterday so should be fixed.

elpiel commented 3 years ago

Thank you for letting me know! I'm already working on updating to it.

Edit: clippy is panicing on the sentry's chain function that handles middlewares, I've opened an issue in clippy that can be found here: https://github.com/rust-lang/rust-clippy/issues/6350

shirshak55 commented 3 years ago

@elpiel I don't think we should be blocked in clippy. Its just a linting tool.

elpiel commented 3 years ago

I am looking for s way to simplify our middleware chain function and maybe clippy will be fixed by then. This is not a high priority actually, since it was a compiler regression in the first place.

If clippy is fixed before the fix, I will also upgrade it