sharksforarms / deku

Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Apache License 2.0
1.14k stars 55 forks source link

Can't build due to outdated bitvec #296

Closed cfslpower closed 1 year ago

cfslpower commented 2 years ago

Latest version of Deku depends on bitvec = "0.22.1" which itself depends on funty = "1.2". This version of funty was yanked after bitvecto-rs/funty#3 and Deku no longer builds. Later versions of bitvec depend on the later (not yanked) versions instead.

It seems like #281 already exists to fix this, but as of a few hours ago that PR is probably necessary to build Deku again.

sharksforarms commented 2 years ago

Hi, I've release a version of deku 0.15.0 which updates to the latest bitvec, however, there are some breaking changes/performance impacts. See https://github.com/sharksforarms/deku/pull/281 and https://github.com/sharksforarms/deku/blob/master/CHANGELOG.md#0150---2022-11-16

vext01 commented 2 years ago

I was using BitSlice::as_raw_slice(), which they've removed.

I was converting the remaining bytes returned by a deku read() back into a &[u8]. Seems this is no longer possible.

The bitvec docs says to use BitSlice::domain(), but I don't see how that helps.

vext01 commented 2 years ago

Well I fixed it by just not going back to &[u8] and working on a BitSlice instead. It's kind of annoying, as it forces me to work at bit-level granularity, but at the time I was using as_raw_slice(), I knew the BitSlice was a multiple of 8-bits in length.

Oh well.

sharksforarms commented 2 years ago

Can you use .domain().region().unwrap().1? This is what deku uses, see: https://github.com/sharksforarms/deku/pull/281/files

vext01 commented 2 years ago

Ah, that's how it's done :P

hanusek commented 1 year ago

I have a problem with deku 0.13.0. I need compatibility with rust 1.54. Unfortunately, deku 15.0 an bitvec 1.0.0 have not. https://lib.rs/compat/bitvec https://lib.rs/compat/deku