Skip to content
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

Add aarch64 support #213

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Add aarch64 support #213

merged 1 commit into from
Dec 20, 2021

Conversation

myhro
Copy link
Contributor

@myhro myhro commented Dec 20, 2021

Discussed in #212.

Still trying to figure why tests are failing with multiple errors. It's not clear which file or directory wasn't found.

Was able to reproduce it locally with cross test --target aarch64-unknown-linux-gnu. Interestingly enough, switching to aarch64-unknown-linux-musl works.

Edit: fixed switching to the expected aarch64-unknown-linux-musl.

@ducaale
Copy link
Owner

ducaale commented Dec 20, 2021

This happens because we are invoking the xh binary with the value of CARGO_TARGET_*_RUNNER. But for some reason, this value happens to be /linux-runner aarch64 in aarch64-unknown-linux-gnu rather than the usual qemu-*. To work around this issue, you can update the find_runner() function in tests/cli.rs to be like this:

fn find_runner() -> Option<String> {
    for (key, value) in std::env::vars() {
        if key.starts_with("CARGO_TARGET_") && key.ends_with("_RUNNER") && value.contains("qemu") {
            return Some(value);
        }
    }
    None
}

However, I am still in favor of adding aarch64-unknown-linux-musl and not aarch64-unknown-linux-gnu which doesn't work in termux.

@myhro
Copy link
Contributor Author

myhro commented Dec 20, 2021

This happens because we are invoking the xh binary with the value of CARGO_TARGET_*_RUNNER. But for some reason, this value happens to be /linux-runner aarch64 in aarch64-unknown-linux-gnu rather than the usual qemu-*.

Thanks for the explanation. Looking at the rustembedded/cross images, I've noticed that their CARGO_TARGET_*_RUNNER environment variables are quite different. In Dockerfile.aarch64-unknown-linux-gnu it's "/linux-runner aarch64" and on Dockerfile.aarch64-unknown-linux-musl it's just qemu-aarch64. That explains why tests ran fine on the latter.

However, I am still in favor of adding aarch64-unknown-linux-musl and not aarch64-unknown-linux-gnu which doesn't work in termux.

Sorry, I misread your suggestion in this comment (and also in the other one before). I've been mentioning the -gnu variant for aarch64 so many times in the discussion that I didn't notice you were suggesting the -musl one. I'm all in for the musl statically-linked option, like we are already doing with the x86_64 release.

I've updated the PR to make use of the aarch64-unknown-linux-musl one. Thanks for the clarification.

@myhro myhro marked this pull request as ready for review December 20, 2021 11:45
Copy link
Owner

@ducaale ducaale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@ducaale ducaale merged commit 81e65c8 into ducaale:develop Dec 20, 2021
@myhro myhro deleted the add-aarch64-support branch December 20, 2021 13:20
@nicolasdanelon
Copy link

what about apple silicon 😭

@ducaale
Copy link
Owner

ducaale commented Jan 6, 2022

@nicolasdanelon can you open an issue for it? Thanks

@nicolasdanelon
Copy link

@ducaale sure.

@nicolasdanelon
Copy link

@ducaale it's working now man! 😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants