【问题标题】:How to use Apache Arrow's Datafusion 1.0.0-SNAPSHOT as a dependency in a Cargo project?如何在 Cargo 项目中使用 Apache Arrow 的 Datafusion 1.0.0-SNAPSHOT 作为依赖项?
【发布时间】:2020-07-01 02:59:57
【问题描述】:

在 Datafusion 的 git repository 上,它说将以下内容添加到 Cargo.toml 文件中以将其用作库:

[dependencies]
datafusion = "1.0.0-SNAPSHOT"

我在运行cargo build时得到这个输出

 Updating crates.io index
error: failed to select a version for the requirement `datafusion = "^1.0.0-SNAPSHOT"`
  candidate versions found which didn't match: 0.17.0, 0.16.0, 0.15.1, ...
  location searched: crates.io index
required by package `hello_cargo v0.1.0 (/Users/jay/Projects/hello_cargo)`

然后我尝试使用 0.17.0 并运行 cargo +nightly build:

error: failed to run custom build command for `arrow-flight v0.17.0`

    Caused by:
      process didn't exit successfully: `/Users/jay/Projects/hello_cargo/target/debug/build/arrow-flight-46000fbc5b8b474b/build-script-build` (exit code: 1)
    --- stderr
    Error: "Failed to locate format/Flight.proto in any parent directory"
    
    warning: build failed, waiting for other jobs to finish...
    error: build failed

当我使用 0.16.0 版本时它似乎可以工作

【问题讨论】:

  • Failed to locate format/Flight.proto 似乎可以合理地解释错误消息。
  • 似乎有效——所以...问题解决了吗?
  • 我想知道为什么 datafusion = "1.0.0-SNAPSHOT" 不起作用。感觉好像我错过了什么,希望有人能说明情况。
  • 因为datafusion haven't released version 1.0.0-SNAPSHOT yet。您正在查看未来版本的 README。
  • 有道理,谢谢!

标签: rust rust-cargo


【解决方案1】:

正如货物告诉你的那样:

candidate versions found which didn't match: 0.17.0, 0.16.0, 0.15.1, ...

此 crate 没有名为 1.0.0-SNAPSHOT 的版本发布到 crates.io。如果您希望使用 git 存储库中未发布的代码,您需要 use a git dependency:

[dependencies]
rand = { git = "https://github.com/apache/arrow/" }

另见:

【讨论】:

    猜你喜欢
    • 2010-09-19
    • 1970-01-01
    • 2014-08-15
    • 2015-08-24
    • 2016-09-30
    • 1970-01-01
    • 1970-01-01
    • 2012-06-02
    • 2012-07-23
    相关资源
    最近更新 更多