curiosity-ai / rocksdb-sharp

.net bindings for the rocksdb by facebook
BSD 2-Clause "Simplified" License
155 stars 38 forks source link

Linux ARM64 support #20

Closed dahlia closed 1 year ago

dahlia commented 2 years ago

ARM64 is rapidly growing nowadays due to its competitive advantage over x86-64 (amd64) on price-performance.[^1] The recent popularity of AWS Graviton shows that too. I expect it would be one of the major architectures for servers besides x86-64 in few years, so that we wouldn't be able to just ignore it.

This project currently supports only x86-64 on three major platforms: linux-x64, osx-x64, and win-x64. I hope it will support linux-arm64 too. I guess it would need only some trivial changes code-wise, but the problem is the automated pipeline to build native shared objects for it.

Here's three ideas to build native libraries for linux-arm64 on CI/CI:

  1. Partially adopt a CI/CD product supporting arm64 runners or entirely turn over the whole build pipeline. I took a quick survey and CircleCI apparently supports arm64.
  2. Cross-compile native libraries on x86-64 for arm64. GCC seemingly supports cross-compilation to arm64 on x86-64 (gcc-aarch64-linux-gnu on Debian/Ubuntu). It probably requires libc for cross-compilation too (libc-dev-arm64-cross on Debian/Ubuntu).
  3. Build native libraries in a VM/container emulating arm64. The most widely used approach would be the combination of userland QEMU and Docker.

If the project maintainers have willing to support Linux ARM64, I would try to send patches for it.

Thanks for the great project.

[^1]: Honeycomb's retrospective on AWS Graviton maybe worth a read.

theolivenbaum commented 2 years ago

Hi @dahlia,

This sounds like an easy change on the CI side. Could you perhaps submit a simplified version of the build script that cross-compile to ARM here? No need to work out the CI and publishing, only get the basics to compile and I can integrate it afterwards! Might be a good opportunity to close #15 as well!

rubo commented 1 year ago

We're also interested in this. Any updates so far?

ByronAP commented 1 year ago

BUMP for needing Linux ARM support, show Raspberry PI some love 😍

rubo commented 1 year ago

@ByronAP For a workaround, see here.

theolivenbaum commented 1 year ago

Added the linux-arm official binaries to the latest package, if anyone could give it a try and let me know if it works! Please reopen the issue if you hit anything!