Skip to content

Commit

Permalink
Update dependencies to make cargo install work
Browse files Browse the repository at this point in the history
Right now, you get an error trying to `cargo install agate`:

    error[E0277]: the trait bound `TlsAcceptor: From<Arc<ServerConfig>>` is not satisfied
      --> src/main.rs:91:8
       |
    91 |     Ok(TlsAcceptor::from(Arc::new(config)))
       |        ^^^^^^^^^^^^^^^^^ the trait `From<Arc<ServerConfig>>` is not implemented for `TlsAcceptor`
       |
       = help: the following implementations were found:
                 <TlsAcceptor as From<Arc<rustls::server::ServerConfig>>>
                 <TlsAcceptor as From<rustls::server::ServerConfig>>
       = note: required by `from`

This stems a recent point upgrade of async-tls.  The newest version
(0.10.2) now depends on rustls 0.19.  The previous version in agate's
lock file (0.10.0) depended on rustls 0.18.  Agate itself also depended
on rustls 0.18.

The default behavior of `cargo install` is to ignore the lock file and
run a `cargo update` before building and installing.  That causes agate
and async-tls to compile against different versions of rustls, causing
the compiler error above.

Arguably, async-tls's recent release should have been a breaking
release, to 0.11, but since that ship has sailed, we can bump agate's
requirements to the latest published versions.  Everything seems to
build correctly, and the server still seems to work fine.
  • Loading branch information
dcreager authored and mbrubeck committed Dec 8, 2020
1 parent cd5918e commit 838f3ad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 47 deletions.
83 changes: 38 additions & 45 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ license = "MIT/Apache-2.0"
edition = "2018"

[dependencies]
async-tls = { version = "0.10.0", default-features = false, features = ["server"] }
async-tls = { version = "0.10.2", default-features = false, features = ["server"] }
async-std = "1.5"
mime_guess = "2.0"
once_cell = "1.4"
rustls = "0.18.0"
rustls = "0.19.0"
url = "2.1"
log = "0.4"
env_logger = { version = "0.8", default-features = false, features = ["atty", "humantime", "termcolor"] }
Expand Down

0 comments on commit 838f3ad

Please sign in to comment.