inejge / ldap3

A pure-Rust LDAP library using the Tokio stack
Apache License 2.0
220 stars 38 forks source link

lber update `0.1.7` breaks ldap3 `0.6.1` #44

Closed cetra3 closed 4 years ago

cetra3 commented 4 years ago

You can not compile ldap3 version 0.6.1 from a fresh project without munging around in cargo.lock.

lber 0.1.7 has bytes 0.5.x whereas lber 0.1.6 has bytes 0.4.x.

If you try to compile from cargo you will get the following error:

  --> /home/cetra/.cargo/registry/src/github.com-1ecc6299db9ec823/ldap3-0.6.1/src/controls_impl/assertion.rs:33:28
   |
33 |         write::encode_into(&mut buf, filter).expect("encoded");
   |                            ^^^^^^^^ expected struct `bytes::bytes_mut::BytesMut`, found struct `bytes::BytesMut`
   |
   = note: expected mutable reference `&mut bytes::bytes_mut::BytesMut`
              found mutable reference `&mut bytes::BytesMut`

error[E0308]: mismatched types
  --> /home/cetra/.cargo/registry/src/github.com-1ecc6299db9ec823/ldap3-0.6.1/src/controls_impl/paged_results.rs:46:28
   |
46 |         write::encode_into(&mut buf, cval).expect("encoded");
   |                            ^^^^^^^^ expected struct `bytes::bytes_mut::BytesMut`, found struct `bytes::BytesMut`
   |
   = note: expected mutable reference `&mut bytes::bytes_mut::BytesMut`
              found mutable reference `&mut bytes::BytesMut`

error[E0308]: mismatched types
   --> /home/cetra/.cargo/registry/src/github.com-1ecc6299db9ec823/ldap3-0.6.1/src/controls_impl/read_entry.rs:100:24
    |
100 |     write::encode_into(&mut buf, cval).expect("encoded");
    |                        ^^^^^^^^ expected struct `bytes::bytes_mut::BytesMut`, found struct `bytes::BytesMut`
    |
    = note: expected mutable reference `&mut bytes::bytes_mut::BytesMut`
               found mutable reference `&mut bytes::BytesMut`

error[E0308]: mismatched types
   --> /home/cetra/.cargo/registry/src/github.com-1ecc6299db9ec823/ldap3-0.6.1/src/protocol.rs:282:28
    |
282 |         write::encode_into(into, outstruct)?;
    |                            ^^^^ expected struct `bytes::bytes_mut::BytesMut`, found struct `bytes::BytesMut`
    |
    = note: expected mutable reference `&mut bytes::bytes_mut::BytesMut`
               found mutable reference `&mut bytes::BytesMut`

I have a fix in this branch: https://github.com/cetra3/ldap3/tree/lber_fix which you can use like so:

[dependencies]
...
ldap3 = { git = "https://github.com/cetra3/ldap3", branch = "lber_fix"}

I can submit a PR if needed

inejge commented 4 years ago

Right, one way is to fix the dependency to 0.1.6 as you've done, but I think I'm going to yank lber 0.1.7, bump the version of lber to 0.2.0, publish ldap 0.7.0-alpha.4 which will depend on the new lber, and yank ldap 0.7.0-alpha.3. I'd prefer to keep 0.6.1 as the final pre-async/await version.

inejge commented 4 years ago

Ok, lber 0.1.7 and ldap3 0.7.0-alpha.3 have been yanked. If you have a borked crate, do a cargo clean (or cargo update --package lber --precise 0.1.6) and see if it works. Please also report here.

cetra3 commented 4 years ago

Ah, cheers! I think that will solve it for now so I will close off this issue.