Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump bitvec dependency to 0.22.3 #297

Closed
wants to merge 1 commit into from

Conversation

ed255
Copy link

@ed255 ed255 commented Oct 29, 2021

There was a conflict between bitvec and a dependency of it (funty) that
caused a build failure. See:

Due to semver, when importing parity-scale-codec as a library and
resolving bitvec 0.20.1 dependencies, funty 0.12 is pulled, which causes
the aforementioned build failure. I believe this is not happening when
testing parity-scale-codec itself because Cargo.lock pins funty to
1.1.0, but when importing parity-scale-codec from another crate, this
pinning is sometimes not possible. Bumping bitvec to 0.22.3 solves this
issue, as it is compatible with funty 0.12.

@bkchr
Copy link
Member

bkchr commented Oct 29, 2021

Doesn't compile.

@ed255 ed255 marked this pull request as draft October 29, 2021 10:18
@ed255
Copy link
Author

ed255 commented Oct 29, 2021

Doesn't compile.

Yeah, sorry; let me look into it.

There was a conflict between bitvec and a dependency of it (funty) that
caused a build failure. See:
- ferrilab/bitvec#105
- ferrilab/funty#3

Due to semver, when importing parity-scale-codec as a library and
resolving bitvec 0.20.1 dependencies, funty 0.12 is pulled, which causes
the aforementioned build failure.  I believe this is not happening when
testing parity-scale-codec itself because Cargo.lock pins funty to
1.1.0, but when importing parity-scale-codec from another crate, this
pinning is sometimes not possible.  Bumping bitvec to 0.22.3 solves this
issue, as it is compatible with funty 0.12.
@ed255
Copy link
Author

ed255 commented Oct 29, 2021

Doesn't compile.

Fixed the compilation issues.

I've updated src/bit_vec.rs to compile with bitvec 0.22.3. The changes I made are:

  1. Use as_raw_slice for BitSlice instead of as_slice due to the function being renamed: See https://docs.rs/bitvec/0.20.4/src/bitvec/slice.rs.html#2472-2476 -> https://docs.rs/bitvec/0.22.3/src/bitvec/slice.rs.html#2421-2425
  2. Use ::BITS from view::BitViewSized trait as BitStore::Mem::BITS was removed in bitvec 0.21.0
  3. I've disabled the bitvec_u8 test for miri, as it failed like the other bitvec_u* do with:
   --> /home/dev/.cargo/registry/src/github.com-1ecc6299db9ec823/bitvec-0.22.3/src/ptr/span.rs:418:12
    |
418 |         unsafe { &*self.to_bitslice_ptr() }
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^ pointer to alloc1676214 was dereferenced after this allocation got freed

@ed255 ed255 marked this pull request as ready for review October 29, 2021 11:44
@gui1117
Copy link
Contributor

gui1117 commented Nov 1, 2021

if bitvec 0.20 which depends on funty version 1 cannot be compile with funty 1.2, then funty is breaking semver.
If the breaking is actually kind of minor, then they should release bitvec 0.20.5 to support funty 1.2, but instead they decided to make bitvec 0.20 depends on a pinned version of funty: 1.1

I already proposed the correct fix so that bitvec 0.20 is compatible with funty 1.2 ferrilab/bitvec#110
If you want this to happen then you should push for it in their repo.

I don't think it is a good idea to bump bitvec to 0.22 as this is a major breaking change and will force use to release parity-scale-codec version 3. And maybe some month later we will have 0.22 which only depends on funty 1.2 and incompatible with funty 1.3 and same story again.

If you want to be able to use funty 1.2 then try to release bitvec 0.20.5 with this fix: ferrilab/bitvec#110
Or try to yank funty 1.2 because it is a breaking change. But I don't think we can do anything on our side here.

@gui1117 gui1117 closed this Nov 1, 2021
@ed255
Copy link
Author

ed255 commented Nov 3, 2021

if bitvec 0.20 which depends on funty version 1 cannot be compile with funty 1.2, then funty is breaking semver. If the breaking is actually kind of minor, then they should release bitvec 0.20.5 to support funty 1.2, but instead they decided to make bitvec 0.20 depends on a pinned version of funty: 1.1

I already proposed the correct fix so that bitvec 0.20 is compatible with funty 1.2 bitvecto-rs/bitvec#110 If you want this to happen then you should push for it in their repo.

I don't think it is a good idea to bump bitvec to 0.22 as this is a major breaking change and will force use to release parity-scale-codec version 3. And maybe some month later we will have 0.22 which only depends on funty 1.2 and incompatible with funty 1.3 and same story again.

If you want to be able to use funty 1.2 then try to release bitvec 0.20.5 with this fix: bitvecto-rs/bitvec#110 Or try to yank funty 1.2 because it is a breaking change. But I don't think we can do anything on our side here.

Thank you so much for the detailed reply! And thanks for pointing me to the right solution for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants