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

Fails to build on latest #263

Open
mooman219 opened this issue Oct 16, 2019 · 3 comments
Open

Fails to build on latest #263

mooman219 opened this issue Oct 16, 2019 · 3 comments
Labels

Comments

@mooman219
Copy link

~/Local/laminar (master) $ cargo bench
    Updating crates.io index
  Downloaded bincode v1.2.0
  Downloaded quickcheck v0.9.0
  Downloaded rand v0.7.2
  Downloaded either v1.5.3
  Downloaded libc v0.2.64
  Downloaded crossbeam-channel v0.3.9
  Downloaded bitflags v1.2.1
  Downloaded arrayvec v0.4.12
  Downloaded quickcheck_macros v0.8.0
  Downloaded ryu v1.0.2
  Downloaded env_logger v0.6.2
  Downloaded nodrop v0.1.14
  Downloaded regex v1.3.1
  Downloaded regex-syntax v0.6.12
  Downloaded aho-corasick v0.7.6
   Compiling semver-parser v0.7.0
   Compiling libc v0.2.64
   Compiling arrayvec v0.4.12
   Compiling getrandom v0.1.12
   Compiling winapi v0.3.8
   Compiling nodrop v0.1.14
   Compiling lazy_static v1.4.0
   Compiling byteorder v1.3.2
   Compiling proc-macro2 v1.0.5
   Compiling cfg-if v0.1.10
   Compiling memchr v2.2.1
   Compiling serde v1.0.101
   Compiling scopeguard v1.0.0
   Compiling ryu v1.0.2
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.2.0
   Compiling bitflags v1.2.1
   Compiling log v0.4.8
   Compiling unicode-xid v0.1.0
   Compiling ppv-lite86 v0.2.5
   Compiling syn v1.0.5
   Compiling autocfg v0.1.6
   Compiling build_const v0.2.1
   Compiling rayon-core v1.6.0
   Compiling unicode-width v0.1.6
   Compiling syn v0.15.44
   Compiling itoa v0.4.4
   Compiling regex-syntax v0.6.12
   Compiling either v1.5.3
   Compiling cast v0.2.2
   Compiling thread_local v0.3.6
   Compiling crossbeam-utils v0.6.6
   Compiling semver v0.9.0
   Compiling textwrap v0.11.0
   Compiling crc v1.8.1
   Compiling itertools v0.8.0
   Compiling c2-chacha v0.2.2
   Compiling num-traits v0.2.8
   Compiling bincode v1.2.0
   Compiling num_cpus v1.10.1
   Compiling rand_core v0.5.1
   Compiling crossbeam-queue v0.1.2
   Compiling crossbeam-channel v0.3.9
   Compiling regex-automata v0.1.8
   Compiling rustc_version v0.2.3
   Compiling criterion-plot v0.4.0
   Compiling clap v2.33.0
   Compiling aho-corasick v0.7.6
   Compiling csv-core v0.1.6
   Compiling rand_chacha v0.2.1
   Compiling rand_os v0.2.2
   Compiling rand_pcg v0.2.0
   Compiling rand_xoshiro v0.3.1
   Compiling memoffset v0.5.1
   Compiling quote v1.0.2
   Compiling winapi-util v0.1.2
   Compiling atty v0.2.13
   Compiling rand v0.7.2
   Compiling quote v0.6.13
   Compiling same-file v1.0.5
   Compiling crossbeam-epoch v0.7.2
   Compiling walkdir v2.2.9
   Compiling bstr v0.2.8
   Compiling serde_json v1.0.41
   Compiling laminar v0.3.2 (C:\Users\Mooma\Local\laminar)
   Compiling crossbeam-deque v0.7.1
   Compiling csv v1.1.1
   Compiling regex v1.3.1
   Compiling rayon v1.2.0
   Compiling tinytemplate v1.0.2
   Compiling serde_derive v1.0.101
   Compiling env_logger v0.6.2
   Compiling quickcheck v0.9.0
   Compiling quickcheck_macros v0.8.0
   Compiling criterion v0.3.0
error[E0432]: unresolved imports `laminar::DeliveryMethod`, `laminar::ProtocolVersion`, `laminar::VirtualConnection`
 --> benches\packet_processing.rs:6:23
  |
6 | use laminar::{Config, DeliveryMethod, ProtocolVersion, VirtualConnection};
  |                       ^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^ no `VirtualConnection` in the root
  |                       |               |
  |                       |               no `ProtocolVersion` in the root
  |                       |               help: a similar name exists in the module: `protocol_version`
  |                       no `DeliveryMethod` in the root

warning: unused import: `ReadBytesExt`
 --> benches\packet_processing.rs:3:28
  |
3 | use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
  |                            ^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `laminar`.
warning: build failed, waiting for other jobs to finish...
error: build failed
~/Local/laminar (master) $ rustup show
Default host: x86_64-pc-windows-gnu

installed toolchains
--------------------

stable-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-msvc

active toolchain
----------------

stable-x86_64-pc-windows-msvc (default)
rustc 1.36.0 (a53f9df32 2019-07-03)

@TimonPost
Copy link
Owner

Ahh. That can be right, we don't do much with benchmarks. So it is probably obsolete code by now. Those benches can fixed is just a matter of changing some imports.

@cedric-h
Copy link

cedric-h commented Oct 25, 2019

I tried to fix this, but unfortunately, I've found that this isn't as easy as just tweaking some imports.

The benches subcrate is treated as... just that, a subcrate, which means that it can't access any private interfaces. Apparently this has arisen as a problem for the bench in the past, there are notes like this in places:

/// This is mimicking the `HeaderParser for AckedPacketHeader` implementation which is no longer
/// visible externally

As the crate has been added onto and reorganized, many more of the things that this bench is depending on have become private.

Really, the bench is intended to test the speed of one simple internal interface. It tests how long it takes Laminar to process a packet. The benches crate can no longer access these functions though, because they've become private.

I can think of two ways to fix this. Either I go and make the functions and types it relies on public, or I somehow move this benchmark somewhere inside the limits of the library, so that it has direct access to these interfaces.

Which is preferable in the eyes of the Laminar developers and maintainers?

@TimonPost
Copy link
Owner

TimonPost commented Oct 26, 2019

Laminar supports sinds a few weeks a fake socket which uses in-memory transport instead of via UDP example of that can be found here. I think we can use that for those benchmarks. Secondly, we have the /bin folder, can't we use that for this somehow? I think it is better to rely on public interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants