Rust-rocksdb: No se puede compilar librocksdb-sys en beta

Creado en 27 sept. 2019  ·  7Comentarios  ·  Fuente: rust-rocksdb/rust-rocksdb

Estoy tratando de incluir rust-rocksdb en una aplicación que usa tokio 0.2 (async await) y tratando de compilar usando 1.39.0-beta.1 obtengo estos errores:

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:243:5
    |
243 |     pub __opaque: [libc::c_char; 56usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:282:5
    |
282 |     pub __opaque: [libc::c_char; 40usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 40]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 40]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 40]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:364:5
    |
364 |     pub __opaque: [libc::c_char; 56usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:487:5
    |
487 |     pub __opaque: [libc::c_char; 192usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 192]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 192]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 192]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /my-app/target/debug/build/librocksdb-sys-a3849244a8784e5d/out/bindings.rs:572:5
    |
572 |     pub __opaque: [libc::c_char; 8176usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 8176]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 8176]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 8176]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error: aborting due to 5 previous errors

También probé con nightly y tengo el mismo problema, usando nightly 2019-09-20 y 2019-09-10 en su lugar, se compila bien.

Lo siento si esto no es un problema de librocksdb-sys (tal vez sea un problema de bingen) pero soy un principiante en el óxido, así que no estoy 100% seguro de cómo verificar eso.

Comentario más útil

¡ZOMG lo compiló! GRACIAS POR LA RESPUESTA. Literalmente no tenía idea de qué hacer. Gracias.

Todos 7 comentarios

¡Hola! Gracias por crear un problema. Somos conscientes de este problema y nos obligamos a deshabilitar el canal beta en Travis debido a ello.
Sin embargo, la única solución que puedo sugerirle es cambiar al compilador stable .
La razón es que este problema nunca aparecerá en estable, según https://doc.rust-lang.org/nightly/src/core/array.rs.html#385

[inestable (característica = "const_generic_impls_guard", problema = "0",

reason = "will never be stable, just a temporary step until const generics are stable")]

@vitvakatu oh ok, gracias! Usaré el trabajo todas las noches hasta que 1.39 se establezca ya que todavía necesito await / async.
Cerraré este problema ya que no hay nada que pueda hacer al respecto.

No puedo construir librocksdb-sys en beta (también necesito beta para las cosas async / await) ni en MacOS Mojave, Xcode 11.1 (tengo MacPorts, no brew).

Recibo este error:

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:243:5
    |
243 |     pub __opaque: [libc::c_char; 56usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:282:5
    |
282 |     pub __opaque: [libc::c_char; 40usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 40]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 40]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 40]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:364:5
    |
364 |     pub __opaque: [libc::c_char; 56usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 56]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 56]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 56]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:487:5
    |
487 |     pub __opaque: [libc::c_char; 192usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 192]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 192]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 192]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error[E0277]: arrays only have std trait implementations for lengths 0..=32
   --> /Users/calin/src/ec/photon/target/release/build/librocksdb-sys-d77172d3d1e61d8b/out/bindings.rs:572:5
    |
572 |     pub __opaque: [libc::c_char; 8176usize],
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[i8; 8176]`
    |
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `[i8; 8176]`
    = note: required because of the requirements on the impl of `std::fmt::Debug` for `&[i8; 8176]`
    = note: required for the cast to the object type `dyn std::fmt::Debug`

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0277`.

¿Por favor avise?

@cculianu Sí. Es un problema conocido. Intente usar librocksdb-sys de master .

Veo. Entonces, ¿funcionará?

Disculpas, pero soy un nudo en el mundo de rust; literalmente estoy tratando de compilar un proyecto creado por un colaborador mío para que pueda hacerlo funcionar en mi sistema macos (él está haciendo el lado del servidor y yo estoy haciendo el cliente en un idioma completamente diferente). Solo quiero que su servidor se compile para poder ejecutarlo aquí ... sin tener que usar una máquina virtual Linux (en Linux se compila perfectamente).

Sé que puedo buscarlo en Google, pero es intimidante: el mundo de Rust es, literalmente, muy nuevo para mí. Soy un desarrollador de C ++. :) ¿Cómo consigo que su especificación de compilación use master y no descargue la caja que quiere? Cuando hago cargo build en el directorio de origen de su proyecto, descarga la caja e intenta construirla. ¿Puedo anular eso?

Quizás debería preguntarle ... :)

Creo que lo descubrí: estoy señalando su dependencia de rocksdb a su repositorio aquí en lugar de 0.12.4.

Está construyendo ahora ...

¡ZOMG lo compiló! GRACIAS POR LA RESPUESTA. Literalmente no tenía idea de qué hacer. Gracias.

¿Fue útil esta página
0 / 5 - 0 calificaciones