jkelleyrtp / dw1000-rs

Rust driver crate for the Decawave DW1000 UWB transceiver
49 stars 11 forks source link

Update dependencies #124

Closed hannobraun closed 3 years ago

hannobraun commented 4 years ago

I tried and failed to upgrade to the latest version of the ieee802154 crate. The commit that does the upgrade introduces the following error when trying to build one of the dwm1001 examples:

$ cargo build --example blink --features=dev,rt
   Compiling dwm1001 v0.4.0 (/home/hanno/Projects/braun-embedded/dw1000/dwm1001)
error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait.

error: `#[alloc_error_handler]` function required, but not found

error: aborting due to 2 previous errors

error: could not compile `dwm1001`

To learn more, run the command again with --verbose.

My understanding is that this is caused by something in the dependency tree depending on alloc, either directly or through std. I wasn't able to figure out where that could happen, and if that's even the reason for this error. I can't spend any more time on this right now, so I'm stopping here.

I'm opening this as a draft, to document that I tried to do the update, and in case anyone has any insights or wants to pick this up.

perttierkkila commented 3 years ago

Stumbled to same problem, current version of rust-dw1000 doesn't work anymore.

Version 0.4.0 mac::frame uses bytes::BufMut https://github.com/braun-embedded/rust-ieee802.15.4/blob/master/src/mac/frame/mod.rs#L14 And what BufMut does inside: https://github.com/tokio-rs/bytes/blob/master/src/buf/buf_mut.rs#L7 Uses alloc...

Allowed versions should be pretty close to masters. Maybe this causes problems. Please fix Cargo.toml with ieee802154 = "=0.3.0" dependency definition.

hannobraun commented 3 years ago

Thanks for your comment, @perttierkkila. That the latest version of the ieee802154 crate depends on alloc is certainly bad.

Stumbled to same problem, current version of rust-dw1000 doesn't work anymore.

Could you expand on this? The latest released version of the dw1000 crate depends on ieee802154 0.3, and BufMut has been used since 0.4. So the latest published version, as well as the master branch, should work. If they don't it might be for a different version.

Allowed versions should be pretty close to masters. Maybe this causes problems. Please fix Cargo.toml with ieee802154 = "=0.3.0" dependency definition.

That shouldn't make a difference. Specifying ieee802154 = "0.3.0" (which is the same as ^0.3.0) only picks up other versions from the 0.3.x series, but no such versions exist. The next release of ieee802154 is 0.4.0, which Cargo considers incompatible with 0.3.x and thus doesn't pick up without a change to Cargo.toml.

hannobraun commented 3 years ago

I've managed to do the upgrade now (a new version of the ieee802154 crate has been released). I'm not set up to run the examples right now, but I figure it's better to get this merged and fix issues later, if they come up.

CI is not running (I've opened #128), but it builds for me locally.