inejge / ldap3

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

lber: v0.4.0 doesn't compile on armv7 #99

Closed nitnelave closed 1 year ago

nitnelave commented 1 year ago

I updated to lber v0.4.0 (by updating ldap3_proto), but it seems to break the armv7-unknown-linux-gnueabihf build:

error[E0277]: the trait bound `u64: ToUsize` is not satisfied
   --> /__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/lber-0.4.0/src/parse.rs:52:37
    |
52  |             let (j, content) = take(len)(i)?;
    |                                ---- ^^^ the trait `ToUsize` is not implemented for `u64`
    |                                |
    |                                required by a bound introduced by this call
    |
    = help: the following other types implement trait `ToUsize`:
              u16
              u32
              u8
              usize
note: required by a bound in `nom::bytes::streaming::take`
   --> /__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-7.1.3/src/bytes/streaming.rs:416:6
    |
416 |   C: ToUsize,
    |      ^^^^^^^ required by this bound in `nom::bytes::streaming::take`

error[E0277]: the trait bound `u64: ToUsize` is not satisfied
   --> /__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/lber-0.4.0/src/parse.rs:58:41
    |
58  |             let (j, mut content) = take(len)(i)?;
    |                                    ---- ^^^ the trait `ToUsize` is not implemented for `u64`
    |                                    |
    |                                    required by a bound introduced by this call
    |
    = help: the following other types implement trait `ToUsize`:
              u16
              u32
              u8
              usize
note: required by a bound in `nom::bytes::streaming::take`
   --> /__w/lldap/lldap/${GITHUB_WORKSPACE}/.cargo/registry/src/github.com-1ecc6299db9ec823/nom-7.1.3/src/bytes/streaming.rs:416:6
    |
416 |   C: ToUsize,
    |      ^^^^^^^ required by this bound in `nom::bytes::streaming::take`

That's probably because the platform is 32 bits, so going from u64 to usize (32 bits) isn't supported.