-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross building x86_64 and arm64 on a arm64 machine inside docker does not work #1628
Comments
can you please share the entire log while using |
Hi @Emilgardis of course. When Installing cross with With
With
When installing cross with
Running
Tries cross 0.2.4 and still have the same error |
oh, this is on a aarch64 machine, should've noticed that immediately... You'll need to install |
I've got a different error after running the command:
|
is cargo installed in another fs not well supported by docker maybe? Can you try
if that doesn't work, try upgrading cross to the main branch (very much doubt it'll fix it though) |
Cargo isn't installed anywhere. I'm actually spinning up a fresh container running
|
For container in container you need to use https://github.com/cross-rs/cross/wiki/FAQ#docker-in-docker |
Yes, I'm mounting the docker socket. That's how I'm running the container where I'm trying my builds:
I tried setting the env variable
|
you need to have the env var set while running cross. Is it set? the warning about |
I've tried using the main branch and now I've got this error:
|
Yeah, im not sure how to fix this. Somethibg is seriously messed up it seems with emulation. The problem is that we need to emulate x86_64 because the images are all currently x86_64 only. You could craft your own image that has aarch64 support but its not super simple. See #751 |
Can you run the build again but with -v please |
Sure:
|
It worked with the builded image, guess I'll have to build those images before running my rust CI |
Awesome, hopefully soon we'll distribute prebuilt images for aarch64, do you think we can close this issue as the immediate problem is resolved? |
Yup we can close it ! |
Running cross on host aarch64-unknown-linux-gnu with target aarch64-unknown-linux-gnu or aarch64-unknown-linux-musl (in order to lower glibc version) also crashes, might be related:
Using via houseabsolute/actions-rust-cross#39 |
This looks like an error from trying to execute cross, not a bug in cross. There's no cross release for arm64, so I wonder if my action is just installing the x86-64 binary. It shouldn't, but it could be. But it looks like arm64 runners are now available for FOSS project - https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/ I will give it a try. |
Yeah, I can confirm this is a bug in action. |
Ok, there may also be an issue with cross when compiling for x86-64 on an arm host. Here's a log: https://github.com/houseabsolute/actions-rust-cross/actions/runs/13364309080/job/37319067651 You can see that cross did execute and it invoked Docker, then something blew up. This run used the latest commit from the cross |
Have you installed |
Ah, indeed, I did not have that step. I added it and now there's a different error:
|
Ugh, same error, this has worked in the past on my mac m1, will have to investigate more... Ill reopen this issue. |
To troubleshoot this, we need to figure out why rustc gets garbled and identify when it happens |
As a workaround, you can craft an aarch64 image to use as detailed in an earlier comment #1628 (comment) |
That linked comment doesn't really explain to me what sort of custom aarch64 image I would use. It seems like #751 sort of covers this, but even after reading through that one I'm at a loss as to how to make this work. But FWIW, I don't need to do this for any project of my own other than trying to support this in |
Until cross-rs/cross#1628 is resolved, running cross on Linux ARM also requires the user to provide a custom Docker image, so this is only sort of usable.
Yeah, I publish prebuilt binaries for imazen/imageflow (dll/dylib/so) and would love to use cross centos to make them work on more linux versions (curse glibc), but I can't get cross to run on ubuntu-22.04-arm and build arm64 binaries, nor run cross on x64 and build arm64 binaries. |
can you please open a new issue or discussion for this, that's a different issue 👍🏼 |
I have the similar issue and investigated the reason. Line 814 in c7dee4d
I think this will resolve in #1630 . |
#1630 will not solve this issue immediately, it does not include building and pushing the images. And it also doesnt explain why theres suddenly issues with using our x86_64 images on aarch64 docker. |
Checklist
Describe your issue
Hey,
I'm running Gitea + Gitea runner on a arm64 VM hosted on Oracle Cloud.
I'm getting this error:
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
0.2.5
Example
Additional information / notes
cross 0.2.5 (c7dee4d 2025-02-12)
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2025-01-30, rust version 1.84.1 (e71f9a9a9 2025-01-27)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
stable-x86_64-unknown-linux-gnu installed - (error reading rustc version)
info: checking for self-update
info: downloading component 'rust-std' for 'aarch64-unknown-linux-gnu'
info: installing component 'rust-std' for 'aarch64-unknown-linux-gnu'
[cross] note: Falling back to
cargo
on the host.cargo 1.84.1 (66221abde 2024-11-19)
The text was updated successfully, but these errors were encountered: