fluffysquirrels / mqtt-async-client-rs

An MQTT client written in Rust
MIT License
40 stars 16 forks source link

Dependencies #18

Closed marcelbuesing closed 4 years ago

marcelbuesing commented 4 years ago

Hi, just wanted to let you it has been a great experience to use this crate, by far the best mqtt client rust crate i have used so far.

I noticed that some dependencies can be made optional by moving them to dev dependencies. Had to move the bin to the example folder for this. Furthermore I added a tls feature but made it part of the default features. So people can opt out if they want to.

Before:

├── bytes v0.4.12
│   ├── byteorder v1.3.2
│   └── iovec v0.1.4
│       └── libc v0.2.66
├── env_logger v0.7.1
│   ├── atty v0.2.14
│   │   └── libc v0.2.66
│   ├── humantime v1.3.0
│   │   └── quick-error v1.2.3
│   ├── log v0.4.8
│   │   └── cfg-if v0.1.10
│   ├── regex v1.3.3
│   │   ├── aho-corasick v0.7.6
│   │   │   └── memchr v2.3.0
│   │   ├── memchr v2.3.0
│   │   ├── regex-syntax v0.6.13
│   │   └── thread_local v1.0.1
│   │       └── lazy_static v1.4.0
│   └── termcolor v1.1.0
├── futures-core v0.3.1
├── futures-util v0.3.1
│   ├── futures-core v0.3.1
│   ├── futures-macro v0.3.1
│   │   ├── proc-macro-hack v0.5.11
│   │   │   ├── proc-macro2 v1.0.8
│   │   │   │   └── unicode-xid v0.2.0
│   │   │   ├── quote v1.0.2
│   │   │   │   └── proc-macro2 v1.0.8 (*)
│   │   │   └── syn v1.0.13
│   │   │       ├── proc-macro2 v1.0.8 (*)
│   │   │       ├── quote v1.0.2 (*)
│   │   │       └── unicode-xid v0.2.0
│   │   ├── proc-macro2 v1.0.8 (*)
│   │   ├── quote v1.0.2 (*)
│   │   └── syn v1.0.13 (*)
│   ├── futures-task v0.3.1
│   ├── pin-utils v0.1.0-alpha.4
│   ├── proc-macro-hack v0.5.11 (*)
│   ├── proc-macro-nested v0.1.3
│   └── slab v0.4.2
├── log v0.4.8 (*)
├── maplit v1.0.2
├── mqttrs v0.2.0
│   └── bytes v0.4.12 (*)
├── rustls v0.16.0
│   ├── base64 v0.10.1
│   │   └── byteorder v1.3.2
│   ├── log v0.4.8 (*)
│   ├── ring v0.16.9
│   │   ├── lazy_static v1.4.0
│   │   ├── libc v0.2.66
│   │   ├── spin v0.5.2
│   │   └── untrusted v0.7.0
│   │   [build-dependencies]
│   │   └── cc v1.0.50
│   ├── sct v0.6.0
│   │   ├── ring v0.16.9 (*)
│   │   └── untrusted v0.7.0
│   └── webpki v0.21.0
│       ├── ring v0.16.9 (*)
│       └── untrusted v0.7.0
├── structopt v0.3.7
│   ├── clap v2.33.0
│   │   ├── ansi_term v0.11.0
│   │   ├── atty v0.2.14 (*)
│   │   ├── bitflags v1.2.1
│   │   ├── strsim v0.8.0
│   │   ├── textwrap v0.11.0
│   │   │   └── unicode-width v0.1.7
│   │   ├── unicode-width v0.1.7
│   │   └── vec_map v0.8.1
│   └── structopt-derive v0.4.0
│       ├── heck v0.3.1
│       │   └── unicode-segmentation v1.6.0
│       ├── proc-macro-error v0.4.4
│       │   ├── proc-macro-error-attr v0.4.3
│       │   │   ├── proc-macro2 v1.0.8 (*)
│       │   │   ├── quote v1.0.2 (*)
│       │   │   ├── rustversion v1.0.1
│       │   │   │   ├── proc-macro2 v1.0.8 (*)
│       │   │   │   ├── quote v1.0.2 (*)
│       │   │   │   └── syn v1.0.13 (*)
│       │   │   ├── syn v1.0.13 (*)
│       │   │   └── syn-mid v0.4.0
│       │   │       ├── proc-macro2 v1.0.8 (*)
│       │   │       ├── quote v1.0.2 (*)
│       │   │       └── syn v1.0.13 (*)
│       │   ├── proc-macro2 v1.0.8 (*)
│       │   ├── quote v1.0.2 (*)
│       │   └── syn v1.0.13 (*)
│       │   [build-dependencies]
│       │   └── rustversion v1.0.1 (*)
│       ├── proc-macro2 v1.0.8 (*)
│       ├── quote v1.0.2 (*)
│       └── syn v1.0.13 (*)
├── tokio v0.2.9
│   ├── bytes v0.5.3
│   ├── fnv v1.0.6
│   ├── iovec v0.1.4 (*)
│   ├── lazy_static v1.4.0
│   ├── memchr v2.3.0
│   ├── mio v0.6.21
│   │   ├── cfg-if v0.1.10
│   │   ├── iovec v0.1.4 (*)
│   │   ├── libc v0.2.66
│   │   ├── log v0.4.8 (*)
│   │   ├── net2 v0.2.33
│   │   │   ├── cfg-if v0.1.10
│   │   │   └── libc v0.2.66
│   │   └── slab v0.4.2
│   ├── pin-project-lite v0.1.2
│   ├── slab v0.4.2
│   └── tokio-macros v0.2.3
│       ├── quote v1.0.2 (*)
│       └── syn v1.0.13 (*)
├── tokio-rustls v0.12.2
│   ├── futures-core v0.3.1
│   ├── rustls v0.16.0 (*)
│   ├── tokio v0.2.9 (*)
│   └── webpki v0.21.0 (*)
└── webpki-roots v0.18.0
    └── webpki v0.21.0 (*)

After (without tls feature):

├── bytes v0.4.12
│   ├── byteorder v1.3.4
│   └── iovec v0.1.4
│       └── libc v0.2.80
├── futures-core v0.3.7
├── futures-util v0.3.7
│   ├── futures-core v0.3.7
│   ├── futures-macro v0.3.7
│   │   ├── proc-macro-hack v0.5.19
│   │   ├── proc-macro2 v1.0.24
│   │   │   └── unicode-xid v0.2.1
│   │   ├── quote v1.0.7
│   │   │   └── proc-macro2 v1.0.24 (*)
│   │   └── syn v1.0.48
│   │       ├── proc-macro2 v1.0.24 (*)
│   │       ├── quote v1.0.7 (*)
│   │       └── unicode-xid v0.2.1
│   ├── futures-task v0.3.7
│   │   └── once_cell v1.4.1
│   ├── pin-project v1.0.1
│   │   └── pin-project-internal v1.0.1
│   │       ├── proc-macro2 v1.0.24 (*)
│   │       ├── quote v1.0.7 (*)
│   │       └── syn v1.0.48 (*)
│   ├── pin-utils v0.1.0
│   ├── proc-macro-hack v0.5.19
│   ├── proc-macro-nested v0.1.6
│   └── slab v0.4.2
├── log v0.4.11
│   └── cfg-if v0.1.10
├── maplit v1.0.2
├── mqttrs v0.2.0
│   └── bytes v0.4.12 (*)
└── tokio v0.2.22
    ├── bytes v0.5.6
    ├── fnv v1.0.7
    ├── iovec v0.1.4 (*)
    ├── lazy_static v1.4.0
    ├── memchr v2.3.4
    ├── mio v0.6.22
    │   ├── cfg-if v0.1.10
    │   ├── iovec v0.1.4 (*)
    │   ├── libc v0.2.80
    │   ├── log v0.4.11 (*)
    │   ├── net2 v0.2.35
    │   │   ├── cfg-if v0.1.10
    │   │   └── libc v0.2.80
    │   └── slab v0.4.2
    ├── pin-project-lite v0.1.11
    ├── slab v0.4.2
    └── tokio-macros v0.2.5
        ├── proc-macro2 v1.0.24 (*)
        ├── quote v1.0.7 (*)
        └── syn v1.0.48 (*)
fluffysquirrels commented 4 years ago

Thanks for your kind words, I'm happy that you've found this crate useful.

This is a nice change: disabling tls saves 22s (37%) off the initial compile on my machine.

Can you add a line to the lib.rs doc comment (https://github.com/fluffysquirrels/mqtt-async-client-rs/blob/9a0e03c3688a24b3d793368bd76c6aca46610cd5/src/lib.rs#L1-L9) explaining the feature that you've added? I.e. that tls is a feature, enabled by default, which supports connections over TLS with rustls? Thanks!

marcelbuesing commented 4 years ago

Thanks for your kind words, I'm happy that you've found this crate useful.

This is a nice change: disabling tls saves 22s (37%) off the initial compile on my machine.

Can you add a line to the lib.rs doc comment (

https://github.com/fluffysquirrels/mqtt-async-client-rs/blob/9a0e03c3688a24b3d793368bd76c6aca46610cd5/src/lib.rs#L1-L9 ) explaining the feature that you've added? I.e. that tls is a feature, enabled by default, which supports connections over TLS with rustls? Thanks!

Just added it. It also makes cross compiling significantly easier if TLS is not required. Otherwise ring apparently needs some specific setup. E.g. you can reproduce this via:

cargo build --target armv7-unknown-linux-musleabihf --release --example mqttc
failed to run custom build command for `ring v0.16.15`
fluffysquirrels commented 4 years ago

This is great, thanks!