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

Use Cross-Compile #2806

Closed
wants to merge 8 commits into from
Closed

Use Cross-Compile #2806

wants to merge 8 commits into from

Conversation

6543
Copy link
Contributor

@6543 6543 commented Apr 14, 2023

image

@dessalines
Copy link
Member

I think the compile of openssl is one of the things the clux/muslrust images did for us.

@Nutomic
Copy link
Member

Nutomic commented Apr 15, 2023

Maybe it would be enough to install openssl-dev from distro repositories, then it can use that and doesnt need to build from source? But I dont know if that works for cross-compilation.

@6543
Copy link
Contributor Author

6543 commented Apr 16, 2023

No openssl cross compile do work, the ring crate is the issue

dessalines pushed a commit that referenced this pull request Apr 16, 2023
* Add docker/Dockerfile.multiarch

* Update normal Dockerfile to be similar to multiarch one

* docker build run on x86 and arm64 now
manifest not needed, its handled by buildx plugin

* Rename Dockerfile.arm To Dockerfile.debian

* Emulate builder on arm target too

* fix misspell

* Improve Dockerfiles

* naming

* undo multiarchbuild settings as its blocked by a dependeny, see #2806

* Delete Dockerfile.debian
@6543
Copy link
Contributor Author

6543 commented Apr 16, 2023

ok cleaned up the pull now ... I have a look into the ring issue but can not promise anything

@Nutomic Nutomic mentioned this pull request Jun 14, 2023
4 tasks
.woodpecker.yml Outdated Show resolved Hide resolved
Co-authored-by: Wim Vander Schelden <lists@fixnum.org>
@JustinLex
Copy link

I believe we're encountering a bug with the Woodpecker configuration. Woodpecker is cloning the latest revision of lemmy-translations instead of the commit that this branch points to. (translations @ 1c42c57) Rust is then complaining that the translations are missing from the removed confirmation email feature.

I think the easiest solution here is to rebase this branch so that the rust code isn't failing during the build?

I'm really interested in having ARM64 builds working, since it reduces hosting costs a lot.

@JustinLex
Copy link

Actually, that woodpecker bug was already fixed. 980df75

@6543 I think this build will work if you rebase onto this commit.

@6543
Copy link
Contributor Author

6543 commented Jun 23, 2023

uh nice :)

@6543
Copy link
Contributor Author

6543 commented Jun 24, 2023

A simple rebase wont do it as clux/muslrust:1.67.0 dont have crosscompilung toolchain (clux/muslrust#11)

They link to https://github.com/cross-rs/cross#dockerfiles ...

So we need to test if that can be used

@JustinLex
Copy link

Hmm, maybe my (lack of) experience with Rust is showing, but could we just use docker.io/library/rust:1.67.0-alpine3.17 instead? I know I've definitely been able to compile staticlibs with just musl-dev installed on rust:alpine.

@JustinLex
Copy link

JustinLex commented Jun 24, 2023

Yeah, I just some of ran the woodpecker steps manually on a docker container, and it seems to work.

Let's try swapping the image with docker.io/library/rust:1.67.0-alpine3.17 and adding apk add musl-dev openssl-dev where needed, in the steps?

@6543
Copy link
Contributor Author

6543 commented Jun 24, 2023

I did had that and it created a bad image ... just look at my past pulls

@6543
Copy link
Contributor Author

6543 commented Jun 24, 2023

Might need just be 1 or 2 lines that would fix it so i encourage everybody to look at it

@6543
Copy link
Contributor Author

6543 commented Jun 25, 2023

Yeah, I just some of ran the woodpecker steps manually on a docker container, and it seems to work.

Let's try swapping the image with docker.io/library/rust:1.67.0-alpine3.17 and adding apk add musl-dev openssl-dev where needed, in the steps?

I'll give it a try soon

@JustinLex
Copy link

JustinLex commented Jul 7, 2023

Yeah, my attempt didn't actually work. There's some weirdness where it's pulling the x86 libraries instead of arm, I think, but I'm not very good with C compilers.

Maybe another look at cross is worth trying.

@kroese
Copy link
Contributor

kroese commented Jul 8, 2023

There are already working ARM64 images by https://github.com/ubergeek77/lemmy-docker-multiarch

@Nutomic
Copy link
Member

Nutomic commented Aug 8, 2023

Replaced by #3810

@Nutomic Nutomic closed this Aug 8, 2023
@6543 6543 deleted the cross-compile branch August 9, 2023 04:47
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

6 participants