为什么我的rust可执行文件无法在Raspbian上运行?

时间:2019-05-09 07:07:29

标签: rust raspberry-pi travis-ci

我正在尝试构建一个可以在所有主要平台上运行的Rust应用程序(可以在https://github.com/Riduidel/rrss2imap上找到源代码)。我使用TravisCI构建此应用程序的发行版。我试图在Raspberry 3上运行发行版。因此,我从资源库中下载了rrss2imap-armv7-unknown-linux-gnueabihf可执行文件,使其在Raspberry上可运行,然后尝试运行它。但是失败了!

./rrss2imap-armv7-unknown-linux-gnueabihf
-bash: ./rrss2imap-armv7-unknown-linux-gnueabihf: cannot execute binary file: Exec format error

文件似乎不是ARM可执行文件

file rrss2imap-armv7-unknown-linux-gnueabihf
rrss2imap-armv7-unknown-linux-gnueabihf: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=cd8242f16992dce34c0bf4c283097c01206edf99, not stripped

那我在TravisCI config中错过了什么?

branches:
  except:
  - "/^untagged/"
language: rust
rust:
- stable
cache: cargo

# This is th script that will be run on each matrix element
script:
# - cargo install git-journal
- cargo test --verbose --all
- cargo build --verbose --all --release
- ls -al target
- mkdir -p target/executable
- cp target/release/rrss2imap target/executable/rrss2imap-${TARGET}
- ls -al target/executable
# - git journal

# All Rust build architectures are defined here
matrix:
  include:
  - env: TARGET=i686-unknown-linux-gnu
  - env: TARGET=i686-unknown-linux-musl
  - env: TARGET=x86_64-unknown-linux-gnu
  - env: TARGET=x86_64-unknown-linux-musl
  - env: TARGET=i686-apple-darwin
    os: osx
    osx_image: xcode8
  - env: TARGET=x86_64-apple-darwin
    os: osx
    osx_image: xcode8
  - env: TARGET=x86_64-pc-windows-msvc
    os: windows
  - env: TARGET=arm-unknown-linux-gnueabi
- env: TARGET=armv7-unknown-linux-gnueabihf

(实际上,似乎没有Linux版本可以运行,因为在Linux docker主机上安装会触发其他错误-但我对使其在Raspbian上运行更感兴趣)

0 个答案:

没有答案