Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ARM64 version #414

Closed
nlamirault opened this issue Sep 19, 2018 · 19 comments
Closed

Support for ARM64 version #414

nlamirault opened this issue Sep 19, 2018 · 19 comments
Assignees
Labels
packaging Building and distribution issues

Comments

@nlamirault
Copy link

Could you provide an ARM64 version in a next release ?
Thanks.

@ogham
Copy link
Owner

ogham commented Sep 25, 2018

It looks like rust-cross can help with cross-compiling for ARM — the next time I make a new release I’ll see what I can do.

@ogham ogham self-assigned this Sep 25, 2018
@ogham ogham added the packaging Building and distribution issues label Sep 25, 2018
@0x3333
Copy link
Contributor

0x3333 commented Aug 30, 2019

I'm was looking for a version to run on my RBPi 3B+.

I boot up a Ubuntu Docker Image(docker run -it ubuntu /bin/bash) and run:

apt update
apt install -y git curl gcc-arm-linux-gnueabihf

pushd /usr/local/src && git clone https://github.com/ogham/exa.git && popd

curl https://sh.rustup.rs -sSf | sh
export PATH=$PATH:/root/.cargo/bin
rustup target add armv7-unknown-linux-gnueabihf
cat >>/root/.cargo/config <<EOF
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
EOF

cd /usr/local/src/exa
cargo build --release --no-default-features --features "default" --target=armv7-unknown-linux-gnueabihf

The binary will be in target/armv7-unknown-linux-gnueabihf/release folder:

$ file target/armv7-unknown-linux-gnueabihf/release/exa
target/armv7-unknown-linux-gnueabihf/release/exa: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 3.2.0, BuildID[sha1]=071f9344646fa0987b828ef0d22dc6a6938c119a, with debug_info, not stripped

Hope it helps.

@TomFaulkner
Copy link

Came here looking for an ARM release for the Pinebook Pro. I'll try compiling it tomorrow.

@0x3333
Copy link
Contributor

0x3333 commented Feb 4, 2020

Easier method using @messense docker images for cross compiling:

# Clone exa
cd /tmp && git clone https://github.com/ogham/exa.git && cd exa

# Build using Cocker
docker run --rm -it -v "$(pwd)":/home/rust/src \
  messense/rust-musl-cross:armv7-musleabihf \
    cargo build --release --no-default-features --features "default"

@eggbean
Copy link

eggbean commented Jul 27, 2020

@0x3333 I just tried that on my RasPi and got this:

$ docker run --rm -it -v "$(pwd)":/home/rust/src \
>   messense/rust-musl-cross:armv7-musleabihf \
>     cargo build --release --no-default-features --features "default"
Unable to find image 'messense/rust-musl-cross:armv7-musleabihf' locally
armv7-musleabihf: Pulling from messense/rust-musl-cross
0a01a72a686c: Pull complete
cc899a5544da: Pull complete
19197c550755: Pull complete
716d454e56b6: Pull complete
0a77a23e0dee: Pull complete
bbff17155c2b: Pull complete
612c3a644b80: Pull complete
8519af83d421: Pull complete
326a732d16f5: Pull complete
7a257df52adb: Pull complete
3ce39ca01a36: Pull complete
0dd626b267ed: Pull complete
Digest: sha256:cd4e4cbce6d8b1b0f21eb14925e1b444e4ed3c80d77069f165725b62c8b45779
Status: Downloaded newer image for messense/rust-musl-cross:armv7-musleabihf
standard_init_linux.go:211: exec user process caused "exec format error"

Any idea what's going here?

Has anybody got a static binary compiled on ARM that they could share?

@0x3333
Copy link
Contributor

0x3333 commented Jul 28, 2020

@eggbean, my command is to cross-compile exa for Pi on an x86 machine... I just run it and it worked flawless.

Cloning into 'exa'...
remote: Enumerating objects: 6903, done.
remote: Total 6903 (delta 0), reused 0 (delta 0), pack-reused 6903
Receiving objects: 100% (6903/6903), 3.24 MiB | 4.11 MiB/s, done.
Resolving deltas: 100% (4917/4917), done.
    Updating crates.io index
  Downloaded number_prefix v0.3.0
  Downloaded unicode-width v0.1.5
  Downloaded log v0.4.7
  Downloaded datetime v0.4.7
  Downloaded scoped_threadpool v0.1.9
  Downloaded term_size v0.3.1
  Downloaded libc v0.2.60
  Downloaded zoneinfo_compiled v0.4.8
  Downloaded users v0.9.1
  Downloaded natord v1.0.9
  Downloaded ansi_term v0.12.0
  Downloaded glob v0.3.0
  Downloaded locale v0.2.2
  Downloaded lazy_static v1.3.0
  Downloaded term_grid v0.1.7
  Downloaded num_cpus v1.10.1
  Downloaded env_logger v0.6.2
  Downloaded byteorder v1.3.2
  Downloaded pad v0.1.5
  Downloaded iso8601 v0.1.1
  Downloaded num-traits v0.1.43
  Downloaded cfg-if v0.1.9
  Downloaded atty v0.2.13
  Downloaded termcolor v1.0.5
  Downloaded regex v1.1.9
  Downloaded humantime v1.2.0
  Downloaded num-traits v0.2.8
  Downloaded aho-corasick v0.7.4
  Downloaded regex-syntax v0.6.8
  Downloaded git2 v0.9.1
  Downloaded url v1.7.2
  Downloaded memchr v2.2.1
  Downloaded utf8-ranges v1.0.3
  Downloaded thread_local v0.3.6
  Downloaded bitflags v1.1.0
  Downloaded autocfg v0.1.5
  Downloaded quick-error v1.2.2
  Downloaded ucd-util v0.1.3
  Downloaded nom v1.2.4
  Downloaded percent-encoding v1.0.1
  Downloaded idna v0.1.5
  Downloaded unicode-bidi v0.3.4
  Downloaded unicode-normalization v0.1.8
  Downloaded matches v0.1.8
  Downloaded libgit2-sys v0.8.1
  Downloaded smallvec v0.6.10
  Downloaded libz-sys v1.0.25
  Downloaded pkg-config v0.3.14
  Downloaded cc v1.0.37
   Compiling libc v0.2.60
   Compiling autocfg v0.1.5
   Compiling pkg-config v0.3.14
   Compiling cc v1.0.37
   Compiling memchr v2.2.1
   Compiling log v0.4.7
   Compiling matches v0.1.8
   Compiling unicode-width v0.1.5
   Compiling nom v1.2.4
   Compiling smallvec v0.6.10
   Compiling byteorder v1.3.2
   Compiling lazy_static v1.3.0
   Compiling bitflags v1.1.0
   Compiling ucd-util v0.1.3
   Compiling regex v1.1.9
   Compiling cfg-if v0.1.9
   Compiling percent-encoding v1.0.1
   Compiling quick-error v1.2.2
   Compiling utf8-ranges v1.0.3
   Compiling termcolor v1.0.5
   Compiling natord v1.0.9
   Compiling glob v0.3.0
   Compiling scoped_threadpool v0.1.9
   Compiling number_prefix v0.3.0
   Compiling ansi_term v0.12.0
   Compiling num-traits v0.2.8
   Compiling unicode-bidi v0.3.4
   Compiling pad v0.1.5
   Compiling term_grid v0.1.7
   Compiling unicode-normalization v0.1.8
   Compiling iso8601 v0.1.1
   Compiling thread_local v0.3.6
   Compiling regex-syntax v0.6.8
   Compiling humantime v1.2.0
   Compiling libz-sys v1.0.25
   Compiling libgit2-sys v0.8.1
   Compiling idna v0.1.5
   Compiling locale v0.2.2
   Compiling atty v0.2.13
   Compiling num_cpus v1.10.1
   Compiling users v0.9.1
   Compiling term_size v0.3.1
   Compiling aho-corasick v0.7.4
   Compiling url v1.7.2
   Compiling num-traits v0.1.43
   Compiling datetime v0.4.7
   Compiling env_logger v0.6.2
   Compiling exa v0.9.0 (/home/rust/src)
   Compiling zoneinfo_compiled v0.4.8
   Compiling git2 v0.9.1
    Finished release [optimized] target(s) in 3m 42s

@eggbean
Copy link

eggbean commented Jul 29, 2020

Thanks, I misread. I didn't even realise that was possible. Cheers.

@eggbean
Copy link

eggbean commented Aug 18, 2020

@0x3333 Do you have this issue?

#719

@0x3333
Copy link
Contributor

0x3333 commented Aug 18, 2020

@eggbean, yes I do have it...

@ickam
Copy link

ickam commented Sep 11, 2020

@eggbean if you're looking for an armhf binary, it is actually available in debian repositories, although the version that they have is 0.8.0-2. For arm64 I had to compile it myself. I did it on a target machine and it worked, but I forgot to save the deb package that I made with cargo deb
I can still upload the exa binary directly from my path if you (or anyone else) need/s it, but you may need to resolve some dependencies.

@eggbean
Copy link

eggbean commented Sep 11, 2020

@ickam Cross-compiling it using the method 0x3333 explained worked fine. Cheers.

@eggbean
Copy link

eggbean commented Jul 19, 2021

@ickam When I tired compiling using cargo on an aarm64 AWS graviton cloud instance it ended with this error.

....
   Compiling exa v0.10.1
   Compiling git2 v0.13.20
error[E0658]: use of unstable library feature 'str_strip': newly added
   --> /home/jason/.cargo/registry/src/github.com-1ecc6299db9ec823/git2-0.13.20/src/cred.rs:286:39
    |
286 |                 self.path = Some(path.strip_prefix('/').unwrap_or(path).to_string());
    |                                       ^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/67302

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: failed to compile `exa v0.10.1`, intermediate artifacts can be found at `/tmp/cargo-installkSK79J`

Caused by:
  could not compile `git2`.

To learn more, run the command again with --verbose.

Does anybody know how to deal with this or have a compiled arm64 binary of the latest version of exa?

@eggbean
Copy link

eggbean commented Jul 19, 2021

I tried cross-compiling using the method with the docker containers mentioned earlier and got this error:

...
   Compiling git2 v0.13.18
error[E0308]: mismatched types
   --> src/fs/feature/xattr.rs:265:21
    |
265 |                     buf.as_mut_ptr().cast::<i8>(),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*mut u8`
               found raw pointer `*mut i8`

error[E0308]: mismatched types
   --> src/fs/feature/xattr.rs:280:21
    |
280 |                     buf.as_ptr().cast::<i8>(),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
error: could not compile `exa`

To learn more, run the command again with --verbose.

@ariasuni
Copy link
Collaborator

When I tired compiling using cargo on an aarm64 AWG graviton cloud instance it ended with this error.

You’re using a version of Rust that is too old (it’s been added in 1.45.0).

I tried cross-compiling using the method with the docker containers mentioned earlier and got this error:

See #887 for compilation problems on ARM.

@balupton
Copy link

Perhaps the build system from these rust packages could help:

@ariasuni
Copy link
Collaborator

I think I’m gonna merge my fix for arm architectures and see later for the CI, thanks for the references, this will help immensely to learn how to use GitHub Actions properly for that!

@balupton
Copy link

Microsoft has a cross-platform builder for ripgrep, maybe that will be helpful:

https://github.com/microsoft/ripgrep-prebuilt

@seagle0128
Copy link

exa will not be maintained...

@ariasuni
Copy link
Collaborator

ariasuni commented Sep 8, 2023

exa already supports ARM64, you need to built it yourself from master tho.

Or, since exa is unmaintained (see #1243), try the the active fork eza instead.

I’ve «saved» the link with other projects building executable by posting it there: https://github.com/orgs/eza-community/discussions/186#discussioncomment-6949239

@ariasuni ariasuni closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Building and distribution issues
Projects
None yet
Development

No branches or pull requests

9 participants