jetty-project / jetty-quiche-native

The Cloudflare Quiche library native builds used by the Jetty project
Other
2 stars 2 forks source link

Linux ARM (AArch64) support #84

Closed victornoel closed 3 months ago

victornoel commented 4 months ago

Hi,

Is there any plan to add support for Linux ARM to this library?

ARM is used more and more nowadays to deploy servers on the cloud and this could be useful to have HTTP/3 support :)

Thanks!

joakime commented 4 months ago

Wouldn't we access to a piece of ARM hardware to build the ARM layer?

victornoel commented 4 months ago

@joakime hehe, very good question. I have to admit I am not very familiar with how to do this :)

I think there are ways to do cross-compilation (it's slower than native compilation from what I read) but it allows not to have to setup a dedicated hardware.

gregw commented 4 months ago

Have you asked the https://github.com/google/quiche project?

victornoel commented 4 months ago

@gregw is jetty-quiche-native using the compiled lib from the quiche project? Or are you building them yourselves?

gregw commented 4 months ago

@gregw is jetty-quiche-native using the compiled lib from the quiche project? Or are you building them yourselves?

@lorban ??

victornoel commented 4 months ago

Ha, I just realized it is rust so I suspect you should be able to use https://github.com/cross-rs/cross

lorban commented 4 months ago

@victornoel We're building Quiche by directly checking out the official project's sources. Adding a linux-aarch64 target wouldn't be a lot of work to maintain, but we need some hardware internally to both make builds and run the test suite.

What exact target do you have in mind? Raspberry Pi? Amazon Graviton? Also, what Linux distribution do you think of?

victornoel commented 4 months ago

@lorban the use case I have in mind is deploying a Jetty-based application on Kubernetes in AWS/GCP/etc using their ARM-based machines. The distribution is most certainly either alpine or ubuntu, whatever is needed, as it's coming from a generic eclipse temurin docker image. Btw I checked eclipse temurin docker image architecture support and they say (https://hub.docker.com/_/eclipse-temurin):

amd64, arm32v7, arm64v8, ppc64le, s390x, windows-amd64

joakime commented 4 months ago

Heh, odd timing. The following github runner issue was completed 12 hours ago.

lorban commented 4 months ago

I managed to build libquiche.so using my Raspberry Pi 3 running Ubuntu, but I cannot run the Jetty build as that poor little machine doesn't have enough RAM.

Nevertheless, I'll build the next Quiche release for linux-aarch64 and include it in the next jetty-quiche-native as an experiment while I also look for some hardware powerful enough to build and test Jetty.

lysliu commented 4 months ago

Generally, cargo build --target to build a target architecture from x86_64 host, using rustc --print target-list to query the target triple for the architecture you want to compile for. I tried with below arm types, all have errors

cargo build --features ffi,qlog --target armv7-unknown-linux-musleabihf
cargo build --features ffi,qlog --target armv7-unknown-linux-musleabi
cargo build --features ffi,qlog --target armv7-unknown-linux-gnueabi
cargo build --features ffi,qlog --target armv7-unknown-linux-gnueabihf
cross build --features ffi,qlog --target armv7-unknown-linux-gnueabihf
lorban commented 3 months ago

This will be done as part of #86

victornoel commented 3 months ago

really cool @lorban, thanks a lot :)

lorban commented 3 months ago

@victornoel No problem. Once https://github.com/jetty/jetty.project/pull/11520 gets merged, you'll be able to make your own build of Jetty 12.0.8-SNAPSHOT to try it out. I'd be glad if you could and report back the outcome by the way.

Thanks!

victornoel commented 3 months ago

@lorban ok, no guarantees that it's going to be soon though because I was preparing for the future and for now I'm not using http3 nor ARM (yet, hence the feature request ;).

But when I do, I will report back!