ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
197 stars 35 forks source link

could not compile pnet_packet #21

Closed kjedamzik closed 4 years ago

kjedamzik commented 4 years ago

Thank you for this nice lib ❤️ Unfortunately I have problems getting it to work:

➜  hapfoo git:(master) ✗ cargo run
   Compiling hap v0.0.9
   Compiling pnet_packet v0.22.0
error[E0599]: no method named `to_primitive_values` found for type `pnet_base::MacAddr` in the current scope
   --> /Users/kofi/innoq/hapfoo/target/debug/build/pnet_packet-e7d624a3a67e0e17/out/ethernet.rs:442:24
    |
442 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `pnet_base::MacAddr`

error[E0599]: no method named `to_primitive_values` found for type `pnet_base::MacAddr` in the current scope
   --> /Users/kofi/innoq/hapfoo/target/debug/build/pnet_packet-e7d624a3a67e0e17/out/ethernet.rs:499:24
    |
499 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `pnet_base::MacAddr`

error[E0599]: no method named `to_primitive_values` found for type `pnet_base::MacAddr` in the current scope
   --> /Users/kofi/innoq/hapfoo/target/debug/build/pnet_packet-e7d624a3a67e0e17/out/arp.rs:776:24
    |
776 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `pnet_base::MacAddr`

error[E0599]: no method named `to_primitive_values` found for type `pnet_base::MacAddr` in the current scope
   --> /Users/kofi/innoq/hapfoo/target/debug/build/pnet_packet-e7d624a3a67e0e17/out/arp.rs:874:24
    |
874 |         let vals = val.to_primitive_values();
    |                        ^^^^^^^^^^^^^^^^^^^ method not found in `pnet_base::MacAddr`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `pnet_packet`.
warning: build failed, waiting for other jobs to finish...
error: build failed

I tried with hap v0.0.9: rustc 1.40.0 (73528e339 2019-12-16) on macOS and rustc 1.39.0 (4560ea788 2019-11-04) on arm

kjedamzik commented 4 years ago

cargo update -p pnet_base:0.23.0 --precise 0.22.0 helped 👉🏾 https://github.com/libpnet/libpnet/issues/391#issuecomment-551948684

crockpotveggies commented 4 years ago

@kjedamzik what version of rustc did you end up using? I tried with 1.40.0 and could not fix the issue.

crockpotveggies commented 4 years ago

this did the trick cargo update -p pnet_base:0.25.0 --precise 0.22.0