You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you follow the getting started steps outlined in the docs on an m1 based Mac, you get the following error:
cross run --target aarch64-unknown-linux-gnu
info: downloading component 'rust-src'
info: installing component 'rust-src'
Unable to find image 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5' locally
0.2.5: Pulling from cross-rs/aarch64-unknown-linux-gnu
docker: no matching manifest for linux/arm64/v8 in the manifest list entries.
See 'docker run --help'.
I believe the root cause is that some of the Docker images used for the cross compilation do not have native aarch64 architecture support. I'm not sure how many of the supported targets are currently broken as I have not exhaustively checked the entire list, but at least the following images appear to be affected:
aarch64-unknown-linux-gnu
x86_64-pc-windows-gnu
What target(s) are you cross-compiling for?
aarch64-unknown-linux-gnu, x86_64-pc-windows-gnu
Which operating system is the host (e.g computer cross is on) running?
macOS
Windows
Linux / BSD
other OS (specify in description)
What architecture is the host?
x86_64 / AMD64
arm32
arm64 (including Mac M1)
What container engine is cross using?
docker
podman
other container engine (specify in description)
cross version
0.2.5
Example
$ cargo init --bin hello
$ cd hello
$ cross run --target aarch64-unknown-linux-gnu
Additional information / notes
No response
The text was updated successfully, but these errors were encountered:
NOTE: I did find a workaround to the problem for the time being, which I will describe here in case anyone else hits this problem in the meantime.
Using Docker for Mac, on an m1 / aarch64 CPU, you can manually download a Docker image for an architecture that is supported by both cross and Docker/Rosetta, such as x86_64, which should run properly in emulation mode. For the example provided in my description above, you can do this by running the following Docker command from a terminal:
This will force Docker to download an x86_64 CPU architecture image and store it in the local Docker cache, so that subsequent calls to use that same Docker image (ie: by cross) will use the cached version of the image instead of trying to download a new one from Docker/Github.
As part of this task, it would be nice if the table of targets included a column that showed the CPU architecture(s) of the host platforms supported by each of the base images, to make it easier to find this information at a glance.
solution for now is to do CROSS_CONTAINER_OPTS="--platform linux/amd64", ensuring that --platform is passed on first pull. There's a explanation also of why this happened in that issue
As part of this task, it would be nice if the table of targets included a column that showed the CPU architecture(s) of the host platforms supported by each of the base images, to make it easier to find this information at a glance.
The only supported platform is linux/amd64 for now. See #751
Checklist
Describe your issue
If you follow the getting started steps outlined in the docs on an m1 based Mac, you get the following error:
I believe the root cause is that some of the Docker images used for the cross compilation do not have native aarch64 architecture support. I'm not sure how many of the supported targets are currently broken as I have not exhaustively checked the entire list, but at least the following images appear to be affected:
What target(s) are you cross-compiling for?
aarch64-unknown-linux-gnu, x86_64-pc-windows-gnu
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
0.2.5
Example
$ cargo init --bin hello $ cd hello $ cross run --target aarch64-unknown-linux-gnu
Additional information / notes
No response
The text was updated successfully, but these errors were encountered: