Rust-rocksdb: Impossible de compiler librocksdb-sys en version bêta

Créé le 27 sept. 2019  ·  7Commentaires  ·  Source: rust-rocksdb/rust-rocksdb

J'essaie d'inclure rust-rocksdb dans une application qui utilise tokio 0.2 (donc async wait) et j'essaie de compiler en utilisant 1.39.0-beta.1 J'obtiens ces erreurs :

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

J'ai également essayé avec nightly et j'ai le même problème, en utilisant nightly 2019-09-20 et 2019-09-10 à la place, il compile très bien.

Désolé si ce n'est pas un problème de librocksdb-sys (c'est peut-être un problème de bingen) mais je suis un débutant en rouille donc je ne suis pas sûr à 100% de savoir comment le vérifier.

Commentaire le plus utile

ZOMG c'est compilé ! MERCI POUR LA RÉPONSE. Je ne savais littéralement pas quoi faire. Merci.

Tous les 7 commentaires

Salut! Merci d'avoir créé un problème. Nous sommes conscients de ce problème et nous sommes obligés de désactiver le canal beta sur Travis à cause de cela.
Cependant, la seule solution que je peux vous proposer est de passer au compilateur stable .
La raison en est que ce problème n'apparaîtra jamais dans stable, selon https://doc.rust-lang.org/nightly/src/core/array.rs.html#385

[unstable(feature = "const_generic_impls_guard", issue = "0",

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

@vitvakatu oh d'accord, merci ! J'utiliserai le travail nocturne jusqu'à ce que 1.39 passe à stable car j'ai toujours besoin d'attendre/async.
Je clos ce sujet car vous ne pouvez rien y faire.

Je ne peux pas construire librocksdb-sys sur la version bêta (j'ai également besoin de la version bêta pour les trucs async/wait) ni sur MacOS Mojave, Xcode 11.1 (j'ai MacPorts, pas de brassage).

J'obtiens cette erreur :

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`.

S'il vous plaît donnez votre avis?

@cculianu Oui. C'est un problème connu. Essayez d'utiliser librocksdb-sys partir de master .

Je vois. Alors ça marchera ?

Mes excuses mais : je suis un nœud dans le monde de la rouille - j'essaie littéralement de compiler un projet qu'un de mes collaborateurs a créé afin que je puisse le faire fonctionner sur mon système macos (il s'occupe du côté serveur et je fais le client dans une langue totalement différente). Je veux juste que son serveur compile pour que je puisse l'exécuter ici... sans avoir à utiliser une machine virtuelle Linux (sous Linux, il compile parfaitement).

Je sais que je peux rechercher cela sur Google, mais c'est intimidant - le monde de Rust est littéralement très nouveau pour moi. Je suis un développeur C++. :) Comment faire en sorte que sa spécification de construction utilise le maître et ne télécharge pas la caisse qu'il veut ? Lorsque je fais cargo build dans le répertoire source de son projet, il télécharge le crate et essaie de le construire. Puis-je passer outre ?

Je devrais peut-être lui demander.. :)

Je pense avoir compris - je pointe sa dépendance rocksdb vers votre référentiel ici plutôt que 0.12.4.

C'est en train de se construire maintenant...

ZOMG c'est compilé ! MERCI POUR LA RÉPONSE. Je ne savais littéralement pas quoi faire. Merci.

Cette page vous a été utile?
0 / 5 - 0 notes

Questions connexes

iSynaptic picture iSynaptic  ·  5Commentaires

valeriansaliou picture valeriansaliou  ·  4Commentaires

cetra3 picture cetra3  ·  9Commentaires

eupn picture eupn  ·  3Commentaires

elichai picture elichai  ·  6Commentaires