Closed Coosis closed 2 months ago
Sorry, my bad. Figured it out: You have to pass in the podman flag --platform=linux/amd64
or --arch=amd64
, tweak for your own requirements.
Based on Configuring cross with environment variables, you can pass flags to the container engine. You can do:
CROSS_CONTAINER_OPTS=--platform=linux/amd64 cross build --target aarch64-unknown-linux-gnu
Basically, if you fail during a build and it's image not found, inspect the url(in my case it's docker://ghcr.io/cross-rs/aarch64-unknown-linux-gnu:0.2.5) for supported platform, and do the environment variable.
If you use nix, you can simply set up shell hook in flake.nix for this.
See also https://github.com/cross-rs/cross/issues/1214 where this has been discussed before
Checklist
Describe your issue
I have a simple rust project on aarch64-darwin, targeting arm64 raspberryPi 4B. I have installed cross using cargo, I have added
aarch64-unknown-linux-gnu
as target viarustup
, I havepodman
installed. I did across build --target aarch64-unknown-linux-gnu
, here's the output:What target(s) are you cross-compiling for?
aarch64-unknown-linux-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
cross 0.2.5
Example
Additional information / notes
No response