-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
fix: Cross-compilation to ARM64 #4142
Conversation
Now that I am about to update woodpecker CI, we need to take a decision: the cross-compilation step must be executed on an amd64 platform but the actual runner (with apt to add libs) need to be run on This means I cannot just invoke the wookpecker image https://codeberg.org/woodpecker-plugins/docker-buildx as-is. I first need to make an intermediate image that will build Maybe named and published as: Then creating the Are you fine with that plan? @Nutomic @dessalines. |
Also, I noted your willingness to avoid dependencies with MS / GitHub. Your call! |
I think that should do! I will spawn a GH Codespace (bcs I run on arm) and try to build the images :) |
Ok, I had a typo + variables are not expanded in |
Fixed! :) |
I've started a tag to make sure that our builders will be able to handle this, and that everything works well with woodpecker. |
Signed-off-by: Enzo NOCERA <enzo@nocera.eu>
Signed-off-by: Enzo Nocera <enzo@nocera.eu>
36f1f16
to
11fbf04
Compare
I merged main as the pipeline is now passing! |
I'll start another tag build to make sure it passes. @raskyld in the future, avoid rebase, as it rewrites history, and makes collaboration difficult. Just merge from main. |
K, another tag build started. 🤞 |
@raskyld Any idea what this error might be? https://woodpecker.join-lemmy.org/repos/129/pipeline/4012/22 |
Yeah that's because |
Thanks, I've started another build. |
I needed to use a temporary layer to be able to copy |
Failed again. |
Gosh, I hate this "eventually working" workflow. Sorry @dessalines ! |
The buildkit log:
seems to say it tries to download the builder for |
Sweet, nother tag started. BTW don't worry about these. I've had like 20 builds failed when trying to tweak and get CI working. Once it finally works, then you usually don't need to worry about it again. |
Here's the error: https://woodpecker.join-lemmy.org/repos/129/pipeline/4046/22 |
To be sure the binary has been linked correctly, we should do some integration test using the resulting docker image. Any hint on how to do that? I have an arm machine so I can test it |
There's not an easy way to do it with the binary, but you can pull down and run the tests on your arm machine: git clone https://github.com/LemmyNet/lemmy
cd lemmy/api_tests
./run-federation-test.sh |
This Dockerfile renames lemmy_server to lemmy and then sets the entrypoint to lemmy_server? I cannot imagine that that would work (but I havent tried it to be honest). |
You are right, that's why I wanted to test running the image, it indeed cannot work. Also we exchanged mails with @kroese, he pointed out that we could avoid using a two-step build process: If we use This would make the main Dockerfile more heavy but would avoid the burden of building two images. |
I now created a pull request ( #4202 ) which fixes the entrypoint and removes the need for the second image. |
Introduction
We should be able to build lemmy from amd64 to arm64.
All the heavy work has been off-loaded:
raskyld/lemmy-cross-toolchains
,a. in the future we could/SHOULD migrate it to the LemmyNet orga
b. it does NOT use musl but the more traditional (even though messy) glibc.
The only moment virtualisation would be involved is when building the runner container but it does really trivial things like downloading apt packages and creating non-root user.
I am not familiar with woodpecker, but I can give it a try.
Issues
Solves #3102.