Skip to content

Fix aarch64 build in Dockerfile-CI.alpine.Dockerfile#1747

Closed
mre wants to merge 1 commit intomasterfrom
aarch64-docker
Closed

Fix aarch64 build in Dockerfile-CI.alpine.Dockerfile#1747
mre wants to merge 1 commit intomasterfrom
aarch64-docker

Conversation

@mre
Copy link
Member

@mre mre commented Jun 26, 2025

Fixes #1745

@willnode
Copy link

I'm not sure that will working since alpine doesn't have glibc, it must be compiled under musl.

@mre
Copy link
Member Author

mre commented Jun 26, 2025

Okay, I'm not an expert on this but the binary builds are here if you want to give it a go: https://github.com/lycheeverse/lychee/blob/master/.github/workflows/release-binary.yml

Maybe it's possible to create a PR for that new binary?

@willnode
Copy link

willnode commented Jun 26, 2025

AFAIK arm-*-linux-* is 32-bit ARM variant and I don't know if any machine runs it anymore (except old android). There's aarch64-unknown-linux-musl for 64 bit musl.

That would be a breaking change I think

@mre
Copy link
Member Author

mre commented Jun 26, 2025

Breaking change would be fine. The image is broken anyway at the moment. ;)

@mre
Copy link
Member Author

mre commented Jul 3, 2025

@willnode , do you think the change is correct and fixes the problem? If not, I'd need some guidance here. Not an expert. 😉 If there's a better way, I'd appreciate a pull request or a list of change requests.

@willnode
Copy link

willnode commented Jul 4, 2025

I'll test tonight

@eread
Copy link
Contributor

eread commented Jul 22, 2025

I'll test tonight

@willnode Did you have any luck with your testing?

&& ARCH=$(case $(arch) in \
"x86_64") echo "x86_64-unknown-linux-musl";; \
"aarch64") echo "arm-unknown-linux-musleabihf";; \
"aarch64") echo "aarch64-unknown-linux-gnu";; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mre @willnode I don't think this will work because, this being a build for Alpine Linux, it must be musl based and not GNU based.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. If you like, you could create a separate pr to try and fix it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mre I've raised: #1774.

@eread
Copy link
Contributor

eread commented Jul 22, 2025

@mre I'm wondering with this one if the problem is the binary itself. If I'm not mistaken, this project uses https://github.com/cross-rs/cross for compilation, and uses a subset of https://github.com/cross-rs/cross?tab=readme-ov-file#supported-targets as compilation targets:

target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- aarch64-unknown-linux-gnu

I wonder if adding aarch64-unknown-linux-musl as a target would work well, and complement aarch64-unknown-linux-gnu that the project already has?

@eread
Copy link
Contributor

eread commented Jul 23, 2025

@mre I'm wondering with this one if the problem is the binary itself. If I'm not mistaken, this project uses https://github.com/cross-rs/cross for compilation, and uses a subset of https://github.com/cross-rs/cross?tab=readme-ov-file#supported-targets as compilation targets:

target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- arm-unknown-linux-gnueabihf
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- aarch64-unknown-linux-gnu

I wonder if adding aarch64-unknown-linux-musl as a target would work well, and complement aarch64-unknown-linux-gnu that the project already has?

I've raised: #1774 to that effect.

@mre
Copy link
Member Author

mre commented Jul 25, 2025

Closing because it got superseded #1774.

@mre mre closed this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect binary in alpine aarch64 build: exec format error

3 participants