Skip to content

Instantly share code, notes, and snippets.

@h0hmj
Last active September 6, 2022 09:19
Show Gist options
  • Save h0hmj/f8764c082c9ecd03c074efe557cf3048 to your computer and use it in GitHub Desktop.
Save h0hmj/f8764c082c9ecd03c074efe557cf3048 to your computer and use it in GitHub Desktop.
Build curvebs v1.2.5 on arm64

doc: how to build curvebs v1.2.5 on arm64

env & version

  • debian: 10
  • arch: arm64
  • curvebs: v1.2.5

build deps

ATTENTION: we have provided build image with deps

docker pull harbor.cloud.netease.com/curve/curvebs-build:v1.2.5-debian10-arm64
# apt packages
apt install curl git wget openjdk-11-jdk zip unzip build-essential python meson ninja-build pkg-config udev zlib1g-dev libssl-dev uuid-dev libcurl4-gnutls-dev libnl-3-dev libnl-genl-3-dev python-dev libunwind-dev python-setuptools python-wheel python-requests

# bazel
cd ~
wget https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-dist.zip
mkdir bazel && unzip bazel-0.17.2-dist.zip -d bazel && cd bazel
env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
cp output/bazel /usr/local/bin

# libfiu
cd ~
git clone https://github.com/albertito/libfiu && cd libfiu
make && make PREFIX=/usr install

How to build curvebs v1.2.5 step by step

p0. start a build container

docker run --name build-curve -d -it --net=host -w /root -v /var/run/docker.sock:/var/run/docker.sock harbor.cloud.netease.com/curve/curvebs-build:v1.2.5-debian10-arm64 /bin/bash
docker exec -it build-curve bash

p1. compile curvebs && make container image for curveadm

cd ~
git clone https://github.com/opencurve/curve --branch v1.2.5 && cd curve
# apply patch
curl https://gist.githubusercontent.com/h0hmj/4e973d9b0e191bd455ddd06e883792a3/raw/1de2ab5c58426e8e4f1ad161c92a79e797a8df14/arm64.patch | git apply
bash replace-curve-repo.sh # change some github.com url to mirror
(cd thirdparties/etcdclient && make)
make build
# need `make build` first
# install docker command
echo \
  "deb [arch=$(dpkg --print-architecture) trusted=yes] http://mirrors.ustc.edu.cn/docker-ce/linux/debian \
  buster stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update && apt install docker-ce -y
make image tag=curvebs:v1.2.5-arm64 # change to your own tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment