[GH-ISSUE #200] arm build "bash: ./dust: cannot execute binary file: Exec format error" but can build from source #91

Closed
opened 2026-06-08 11:25:38 +03:00 by zhus · 9 comments
Owner

Originally created by @bbugh on GitHub (Nov 29, 2021).
Original GitHub issue: https://github.com/bootandy/dust/issues/200

Hi! 👋🏻 Thank you for making dust, it's awesome!

debian-11.1.0-arm64 virtualized in an Apple M1:

$ wget https://github.com/bootandy/dust/releases/download/v0.7.5/dust-v0.7.5-arm-unknown-linux-gnueabihf.tar.gz
$ tar vzxf dust-v0.7.5-arm-unknown-linux-gnueabihf.tar.gz
$ cd dust-v0.7.5-arm-unknown-linux-gnueabihf
$ chmod +x dust

$ ./dust
zsh: exec format error: ./dust

$ bash
$ ./dust
bash: ./dust: cannot execute binary file: Exec format error

However, building it from source works:

$ docker run --rm -v "$PWD":/usr/src/dust -w /usr/src/dust rust:latest cargo build --release
   ... 
   Compiling du-dust v0.7.5 (/opt/src)
    Finished release [optimized] target(s) in 1m 41s
$ ./target/release/dust
  ...
  49M       ├─┴ deps                                    │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████ │  60%
  82M     ┌─┴ release                                   │████████████████████████████████████████████████ │ 100%
  82M   ┌─┴ target                                      │████████████████████████████████████████████████ │ 100%
  83M ┌─┴ .                                             │████████████████████████████████████████████████ │ 100%
Originally created by @bbugh on GitHub (Nov 29, 2021). Original GitHub issue: https://github.com/bootandy/dust/issues/200 Hi! 👋🏻 Thank you for making dust, it's awesome! debian-11.1.0-arm64 virtualized in an Apple M1: ``` $ wget https://github.com/bootandy/dust/releases/download/v0.7.5/dust-v0.7.5-arm-unknown-linux-gnueabihf.tar.gz $ tar vzxf dust-v0.7.5-arm-unknown-linux-gnueabihf.tar.gz $ cd dust-v0.7.5-arm-unknown-linux-gnueabihf $ chmod +x dust $ ./dust zsh: exec format error: ./dust $ bash $ ./dust bash: ./dust: cannot execute binary file: Exec format error ``` However, building it from source works: ``` $ docker run --rm -v "$PWD":/usr/src/dust -w /usr/src/dust rust:latest cargo build --release ... Compiling du-dust v0.7.5 (/opt/src) Finished release [optimized] target(s) in 1m 41s $ ./target/release/dust ... 49M ├─┴ deps │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████ │ 60% 82M ┌─┴ release │████████████████████████████████████████████████ │ 100% 82M ┌─┴ target │████████████████████████████████████████████████ │ 100% 83M ┌─┴ . │████████████████████████████████████████████████ │ 100% ```
zhus closed this issue 2026-06-08 11:25:38 +03:00
Author
Owner

@anirvan-majumdar commented on GitHub (Dec 1, 2021):

Hi — we are trying to get Dust installed on an AWS Graviton (Aarch64) instance and facing a similar issue:

bash: ./dust: cannot execute binary file: Exec format error

You seem to have built dust from source using docker, but is there a way to build the binary from source natively on the instance?

<!-- gh-comment-id:983835543 --> @anirvan-majumdar commented on GitHub (Dec 1, 2021): Hi — we are trying to get Dust installed on an AWS Graviton (Aarch64) instance and facing a similar issue: ``` bash: ./dust: cannot execute binary file: Exec format error ``` You seem to have built dust from source using `docker`, but is there a way to build the binary from source natively on the instance?
Author
Owner

@bbugh commented on GitHub (Dec 1, 2021):

@anirvan-majumdar I used docker because the server I was running this on doesn't need Rust installed. If you have Rust installed, you should be able to just run cargo build --release in the project's source folder!

<!-- gh-comment-id:983837700 --> @bbugh commented on GitHub (Dec 1, 2021): @anirvan-majumdar I used docker because the server I was running this on doesn't need Rust installed. If you have Rust installed, you should be able to just run `cargo build --release` in the project's source folder!
Author
Owner

@bootandy commented on GitHub (Dec 3, 2021):

Hi,

Sorry to hear that.

This might be a silly suggestion but do any of the other releases work?

Should we be building a separate release for the M1 processor ?

I'm afraid I don't know much about creating the releases but I'm happy to help if I can.

<!-- gh-comment-id:985341492 --> @bootandy commented on GitHub (Dec 3, 2021): Hi, Sorry to hear that. This might be a silly suggestion but do any of the other releases work? Should we be building a separate release for the M1 processor ? I'm afraid I don't know much about creating the releases but I'm happy to help if I can.
Author
Owner

@bbugh commented on GitHub (Dec 3, 2021):

Hey @bootandy, thanks for the reply! Nothing special is needed for the M1, it's just an arm64. The executable also doesn't run on a Rasperry Pi, which is also arm64. If you could also output an arm64 build, that would solve it.

I can check later to see if any old versions ran, but unless they were built for arm64 they most likely won't.

<!-- gh-comment-id:985536369 --> @bbugh commented on GitHub (Dec 3, 2021): Hey @bootandy, thanks for the reply! Nothing special is needed for the M1, it's just an arm64. The executable also doesn't run on a Rasperry Pi, which is also arm64. If you could also output an arm64 build, that would solve it. I can check later to see if any old versions ran, but unless they were built for arm64 they most likely won't.
Author
Owner

@bbugh commented on GitHub (Dec 5, 2021):

This came up on the sidebar of dev.to and it seems like it might be useful! https://dev.to/marcoieni/rust-makes-cross-compilation-child-s-play-4e4g

<!-- gh-comment-id:986159330 --> @bbugh commented on GitHub (Dec 5, 2021): This came up on the sidebar of dev.to and it seems like it might be useful! https://dev.to/marcoieni/rust-makes-cross-compilation-child-s-play-4e4g
Author
Owner

@anirvan-majumdar commented on GitHub (Dec 5, 2021):

Worked like a charm @bbugh!
Installed cargo on the Ubuntu instance and ran the command you'd suggested.

<!-- gh-comment-id:986237449 --> @anirvan-majumdar commented on GitHub (Dec 5, 2021): Worked like a charm @bbugh! Installed `cargo` on the Ubuntu instance and ran the command you'd suggested.
Author
Owner

@bootandy commented on GitHub (Dec 7, 2021):

Thanks for the info. I'll add an arm64 build when I next fiddle round with the releases

(I confess I don't much like touching the release scripts!).

<!-- gh-comment-id:987256938 --> @bootandy commented on GitHub (Dec 7, 2021): Thanks for the info. I'll add an arm64 build when I next fiddle round with the releases (I confess I don't much like touching the release scripts!).
Author
Owner

@bootandy commented on GitHub (Feb 26, 2022):

I'm not sure I can help anymore on this.

If someone wants to add a new release to dust that would be welcome, the file is here:
https://github.com/bootandy/dust/blob/master/.github/workflows/CICD.yml

(I don't have an arm system and have not had much luck including a new arm64 build).

<!-- gh-comment-id:1052048332 --> @bootandy commented on GitHub (Feb 26, 2022): I'm not sure I can help anymore on this. If someone wants to add a new release to dust that would be welcome, the file is here: https://github.com/bootandy/dust/blob/master/.github/workflows/CICD.yml (I don't have an arm system and have not had much luck including a new arm64 build).
Author
Owner

@adamcstephens commented on GitHub (Feb 27, 2022):

Confirmed v0.8.1-alpha.2 musl and gnu binaries both work on a raspberry pi running Ubuntu aarch64

<!-- gh-comment-id:1053569149 --> @adamcstephens commented on GitHub (Feb 27, 2022): Confirmed v0.8.1-alpha.2 musl and gnu binaries both work on a raspberry pi running Ubuntu aarch64
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#91