Rust-rocksdb: 无法在 beta 上编译 librocksdb-sys

创建于 2019-09-27  ·  7评论  ·  资料来源: rust-rocksdb/rust-rocksdb

我正在尝试将 rust-rocksdb 包含到使用 tokio 0.2(因此异步等待)的应用程序中,并尝试使用 1.39.0-beta.1 进行编译,但出现以下错误:

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

我也试过 nightly 并且我遇到了同样的问题,使用 nightly 2019-09-20 和 2019-09-10 代替它编译得很好。

抱歉,如果这不是 librocksdb-sys 问题(可能是 bingen 问题),但我是 Rust 的初学者,所以我不是 100% 确定如何检查。

最有用的评论

ZOMG吧编译! 感谢您的答复。 真的不知道该怎么做。 谢谢。

所有7条评论

你好! 感谢您创建问题。 我们意识到了这个问题,因此我们被迫在 Travis 上禁用beta频道。
但是,我可以向您建议的唯一解决方案是切换到stable编译器。
根据https://doc.rust-lang.org/nightly/src/core/array.rs.html#385 ,原因是这个问题永远不会出现在稳定版中

[不稳定(功能=“const_generic_impls_guard”,问题=“0”,

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

@vitvakatu哦,好的,谢谢! 我将使用每晚工作直到 1.39 稳定,因为我仍然需要等待/异步。
我将关闭此问题,因为您对此无能为力。

我无法在 MacOS Mojave、Xcode 11.1(我有 MacPorts,而不是 brew)上构建 librocksdb-sys 测试版(我也需要异步/等待测试版)。

我收到此错误:

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

请指教?

@cculianu是的。 这是一个已知问题。 尝试使用librocksdb-sys master librocksdb-sys master

我知道了。 那么它会起作用吗?

道歉但是:我对 Rust 世界一窍不通——我实际上只是想编译一个我的合作者创建的项目,这样我就可以让它在我的 macos 系统上工作(他在做服务器端,我在做客户使用完全不同的语言)。 我只想编译他的服务器,这样我就可以在这里运行它……而不必使用 Linux VM(在 Linux 中它可以完美编译)。

我知道我可以用谷歌搜索这个,但它很吓人——Rust 世界对我来说真的很陌生。 我是 C++ 开发人员。 :) 如何让他的构建规范使用 master 而不是下载它想要的板条箱? 当我在他的项目的源目录中执行cargo build时,它会下载 crate 并尝试构建它。 我可以覆盖吗?

也许我应该问他.. :)

我想我想通了 - 我将他的 Rocksdb 依赖项指向您的存储库,而不是 0.12.4。

现在正在建设中...

ZOMG吧编译! 感谢您的答复。 真的不知道该怎么做。 谢谢。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

valeriansaliou picture valeriansaliou  ·  4评论

iSynaptic picture iSynaptic  ·  31评论

f41gh7 picture f41gh7  ·  4评论

mvines picture mvines  ·  10评论

iSynaptic picture iSynaptic  ·  11评论