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

Enable cross compilation (Docker) to aarch64-unknown-linux-musl #23

Merged
merged 5 commits into from
Jun 24, 2022

Conversation

alxjpzmn
Copy link
Contributor

@alxjpzmn alxjpzmn commented Jun 23, 2022

Resolves #21

Naive and unoptimized approach for cross compilation during Docker build. Result is a multi-arch Docker image.

Cross compilation to aarch64 takes a while on my machine (~ 2hrs), but it works. amd64 version builds significantly faster (< 30mins).

Please be aware that you'll need to have buildx set up as described in the Docker blog post for it.

The conditional to skip non-targetarch build stages is described in this blog post by Docker.

@alxjpzmn alxjpzmn changed the title Develop Enable cross compilation (Docker) to aarch64-unknown-linux-musl (#21) Jun 23, 2022
@alxjpzmn alxjpzmn changed the title Enable cross compilation (Docker) to aarch64-unknown-linux-musl (#21) Enable cross compilation (Docker) to aarch64-unknown-linux-musl (closes #21) Jun 23, 2022
@alxjpzmn alxjpzmn changed the title Enable cross compilation (Docker) to aarch64-unknown-linux-musl (closes #21) Enable cross compilation (Docker) to aarch64-unknown-linux-musl Jun 23, 2022
@aaronleopold
Copy link
Collaborator

Cross compilation to aarch64 takes a while on my machine (~ 2hrs)

2 hours 😭 haha, but thank you so much @alxjpzmn! I will test this out as soon as I have a minute after work

@stumpapp stumpapp deleted a comment from vercel bot Jun 23, 2022
@stumpapp stumpapp deleted a comment from vercel bot Jun 23, 2022
@aaronleopold
Copy link
Collaborator

It compiled! Thanks again, I'll go ahead and merge this :)

@aaronleopold aaronleopold marked this pull request as ready for review June 24, 2022 00:33
@aaronleopold aaronleopold merged commit e64b754 into stumpapp:develop Jun 24, 2022
@alxjpzmn
Copy link
Contributor Author

Your're welcome — glad I could help!

If you'd later want to have cross compilation being run as part of a CI/CD pipeline, it might still make sense to use Cross from outside the Docker build, similar to how the Conduit team does it.

Looking forward to eventually replacing Calibre with Stump ;)

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.

2 participants