compiling for armv7-unknown-linux-musleabihf on MacOS M1 chip. #1477
-
All, I have a project, that requires openssl, that I'm trying to cross compile for armv7-unknown-linux-musleabihf. When I try to setup cross build --profile release --target armv7-unknown-linux-musleabihf
[cross] warning: using older rustc `1.74.1 (a28077b28 2023-12-04)` for the target. Current active rustc on the host is `rustc 1.77.0 (aedd173a2 2024-03-17)`.
> Update with `rustup update --force-non-host stable-x86_64-unknown-linux-gnu`
[+] Building 0.5s (3/3) FINISHED
=> [internal] load build definition from Dockerfile.armv7-unknown-linux-musleabihf-custom 0.0s
=> => transferring dockerfile: 263B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [internal] load metadata for ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5 0.4s
------
> [internal] load metadata for ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:b4f481f30ceca34730a5723f717396d762d94f6eddd7e1cf7c7862d1377ff98c: not found
Error:
0: could not run container
1: when building custom image
2: when pre-building
3: `docker build --label 'org.cross-rs.for-cross-target=armv7-unknown-linux-musleabihf' --label 'org.cross-rs.workspace_root=<dir>' --tag cross-custom-adblock-sanitizer:armv7-unknown-linux-musleabihf-4bd5e-pre-build --build-arg 'CROSS_CMD=dpkg --add-architecture $CROSS_DEB_ARCH
apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH
echo -e '\''#!/bin/bash
echo test'\'' > /usr/bin/test-echo
chmod +x /usr/bin/test-echo' --build-arg 'CROSS_DEB_ARCH=musl-linux-armhf' --file .../target/armv7-unknown-linux-musleabihf/Dockerfile.armv7-unknown-linux-musleabihf-custom <dir>` failed with exit status: 1
Note: CROSS_CMD=dpkg --add-architecture $CROSS_DEB_ARCH
apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH
echo -e '#!/bin/bash
echo test' > /usr/bin/test-echo
chmod +x /usr/bin/test-echo
Exit 1 I'm using Docker 20.10.21 so I should be good with the verison. I suspect it's because I'm on a Apple M1 chip not x86_64/amd64 so I tried to set the platform for docker (see below) but with no difference. export CROSS_CONTAINER_OPTS="--platform linux/amd64"
cross build --profile release --target armv7-unknown-linux-musleabihf I do have the docker container pulled locally: docker pull --platform linux/amd64 ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5
0.2.5: Pulling from cross-rs/armv7-unknown-linux-musleabihf
Digest: sha256:b4f481f30ceca34730a5723f717396d762d94f6eddd7e1cf7c7862d1377ff98c
Status: Image is up to date for ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5
ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:0.2.5 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This is solved on the main branch, use that or you can try setting |
Beta Was this translation helpful? Give feedback.
Actually, I see now that you've pulled the image, then it's the same error but a bit different, you need to do
CROSS_BUILD_OPTS="--platform linux/amd64"