cross-rs / cross

“Zero setup” cross compilation and “cross testing” of Rust crates
Apache License 2.0
6.21k stars 354 forks source link

Building aarch64 image fails due to gfortran not being available #1518

Open astapleton opened 1 week ago

astapleton commented 1 week ago

Checklist

Describe your issue

Building the aarch64 Docker image on Mac M1/M2 fails due to a missing package error for gfortran. ie. running this:

docker build -f Dockerfile.aarch64-unknown-linux-gnu -t ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main https://github.com/cross-rs/cross.git#main:docker

results in this error:

Unable to locate package gfortran-aarch64-linux-gnu

which then fails the image creation.

It seems like this was introduced in this commit: https://github.com/cross-rs/cross/commit/6ab0e7cfc8fd45e6947b0c2768c041ad4ba0c528

I also reproduced this on an x86_64 Windows host when specifying --platform linux/arm64 during the build step.

What target(s) are you cross-compiling for?

No response

Which operating system is the host (e.g computer cross is on) running?

What architecture is the host?

What container engine is cross using?

cross version

cross 0.2.5

Example

docker build -f Dockerfile.aarch64-unknown-linux-gnu -t ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main https://github.com/cross-rs/cross.git#main:docker

Additional information / notes

Building with an older commit works:

docker build -f Dockerfile.aarch64-unknown-linux-gnu -t ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main https://github.com/cross-rs/cross.git#c87a52a60dbcde069714a8d2ed51570e7fc23cf9:docker