zerotier / zeronsd

A DNS server for ZeroTier users
https://zerotier.com
BSD 3-Clause "New" or "Revised" License
493 stars 57 forks source link

zeronsd does not compile due to cargo pulling incompatible version of zerotier-central-api #140

Closed jMasterkingswag closed 2 years ago

jMasterkingswag commented 2 years ago

it seems that cargo now pulls an incompatible version of zerotier-central-api when building zeronsd.

I had to use the following quick fix (super hacky... not a pro in Rust ;-)...) in my Cargo.toml:

[...]
zerotier-central-api = "<1.0.3"
[...]

to be able to compile.

Otherwise the compiler complains about a struct in utils.rs not being defined:

error[E0422]: cannot find struct, variant or union type `NetworkConfigDns` in module `zerotier_central_api::models`
   --> src/utils.rs:176:59
    |
176 |     let dns = Some(Box::new(zerotier_central_api::models::NetworkConfigDns {
    |                                                           ^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `NetworkConfig`
    |
   ::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/zerotier-central-api-1.0.3/src/models/network_config.rs:15:1
    |
15  | pub struct NetworkConfig {
    | ------------------------ similarly named struct `NetworkConfig` defined here

error[E0308]: mismatched types
   --> src/utils.rs:182:33
    |
182 |         zt_network_config.dns = dns;
    |                                 ^^^ expected struct `Dns`, found struct `Box`
    |
    = note: expected enum `std::option::Option<Dns>`
               found enum `std::option::Option<Box<_>>`

Some errors have detailed explanations: E0308, E0422.
For more information about an error, try `rustc --explain E0308`.
error: failed to compile `zeronsd v0.2.6 (/zeronsd)`, intermediate artifacts can be found at `/zeronsd/target`

Caused by:
  could not compile `zeronsd` due to 2 previous errors
erikh commented 2 years ago

Oops, that's because I published this crate prematurely last night apparently.

erikh commented 2 years ago

try 0.2.7. I fixed it here.