From 7eefc8cbd294c32e526f32aaf5e2f84b768a9c34 Mon Sep 17 00:00:00 2001 From: hooklee2000 Date: Thu, 4 Feb 2021 17:45:39 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20build=20libsdk=EF=BC=8Cupgrade=20arm?= =?UTF-8?q?=20depend=20lib=20to=20lz4=201.9.3=EF=BC=8Czstd=201.4.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hooklee2000 --- build.sh | 14 +++++++------- build/build.sh | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build.sh b/build.sh index e30d13082e..41cf43516a 100755 --- a/build.sh +++ b/build.sh @@ -63,18 +63,18 @@ get_rocksdb_compress_dep() { tar zxf bzip2-1.0.6.tar.gz fi - if [ ! -d "${RootPath}/vendor/dep/zstd-1.4.5" ]; then - wget https://codeload.github.com/facebook/zstd/zip/v1.4.5 - unzip v1.4.5 + if [ ! -d "${RootPath}/vendor/dep/zstd-1.4.8" ]; then + wget https://codeload.github.com/facebook/zstd/zip/v1.4.8 + unzip v1.4.8 fi - if [ ! -d "${RootPath}/vendor/dep/lz4-1.9.2" ]; then - wget https://codeload.github.com/lz4/lz4/tar.gz/v1.9.2 - tar zxf v1.9.2 + if [ ! -d "${RootPath}/vendor/dep/lz4-1.9.3" ]; then + wget https://codeload.github.com/lz4/lz4/tar.gz/v1.9.3 + tar zxf v1.9.3 fi - #rm -rf zlib-1.2.11.tar.gz bzip2-1.0.6.tar.gz v1.4.5 v1.9.2 + #rm -rf zlib-1.2.11.tar.gz bzip2-1.0.6.tar.gz v1.4.8 v1.9.3 cd ${RootPath} diff --git a/build/build.sh b/build/build.sh index b2331ef6dd..a0962d5563 100755 --- a/build/build.sh +++ b/build/build.sh @@ -89,7 +89,7 @@ build_bzip2() { } build_lz4() { - ZstdSrcPath=${VendorPath}/dep/lz4-1.9.2 + ZstdSrcPath=${VendorPath}/dep/lz4-1.9.3 ZstdBuildPath=${BuildOutPath}/lz4 found=$(find ${ZstdBuildPath}/lib -name liblz4.a 2>/dev/null | wc -l) if [ ${found} -eq 0 ] ; then @@ -113,7 +113,7 @@ build_lz4() { # dep zlib,bz2,lz4 build_zstd() { - ZstdSrcPath=${VendorPath}/dep/zstd-1.4.5 + ZstdSrcPath=${VendorPath}/dep/zstd-1.4.8 ZstdBuildPath=${BuildOutPath}/zstd found=$(find ${ZstdBuildPath}/lib -name libzstd.a 2>/dev/null | wc -l) if [ ${found} -eq 0 ] ; then @@ -288,9 +288,10 @@ build_cli() { } build_libsdk() { + pre_build_server case `uname` in Linux) - TargetFile=${1:-${SrcPath}/libsdk.so} + TargetFile=${1:-${BuildBinPath}/libsdk.so} ;; *) echo "Unsupported platform" @@ -299,7 +300,7 @@ build_libsdk() { esac pushd $SrcPath >/dev/null echo -n "build libsdk " - go build $MODFLAGS -ldflags "${LDFlags}" -buildmode c-shared -o ${BuildBinPath}/$TargetFile ${SrcPath}/*.go && echo "success" | echo "failed" + go build $MODFLAGS -ldflags "${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/libsdk/*.go && echo "success" || echo "failed" popd >/dev/null } From 8d5abe0e6df64c48c95e0e5764e14bad1dfe3fcf Mon Sep 17 00:00:00 2001 From: hooklee2000 Date: Fri, 5 Feb 2021 10:28:44 +0800 Subject: [PATCH 2/3] change: supporting mvn java lib to build/bin,change libsdk.so to libcfs.so Signed-off-by: hooklee2000 --- .gitignore | 2 ++ build/build.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7d4180bee0..d91ebec3b8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ tmp/ docker/log console/html vendor/dep +java/target +java/src/main/resources/*.so diff --git a/build/build.sh b/build/build.sh index a0962d5563..e5eafb86e6 100755 --- a/build/build.sh +++ b/build/build.sh @@ -291,7 +291,7 @@ build_libsdk() { pre_build_server case `uname` in Linux) - TargetFile=${1:-${BuildBinPath}/libsdk.so} + TargetFile=${1:-${BuildBinPath}/libcfs.so} ;; *) echo "Unsupported platform" @@ -299,9 +299,17 @@ build_libsdk() { ;; esac pushd $SrcPath >/dev/null - echo -n "build libsdk " + echo -n "build libsdk: libcfs.so " go build $MODFLAGS -ldflags "${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/libsdk/*.go && echo "success" || echo "failed" popd >/dev/null + + pushd $SrcPath/java >/dev/null + echo -n "build java libchubaofs " + mkdir -p $SrcPath/java/src/main/resources/ + \cp -rf ${TargetFile} $SrcPath/java/src/main/resources/ + mvn clean package + \cp -rf $SrcPath/java/target/*.jar ${BuildBinPath} && echo "build java libchubaofs success" || echo "build java libchubaofs failed" + popd >/dev/null } clean() { From 47129c7eb7b98356ebb44994bee96e3e337e3a35 Mon Sep 17 00:00:00 2001 From: Shuoran Liu Date: Tue, 9 Feb 2021 14:52:06 +0800 Subject: [PATCH 3/3] enhance: add libsdk build process to ci Signed-off-by: Shuoran Liu --- docker/script/build.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/script/build.sh b/docker/script/build.sh index 0ad448a2e8..e6902bb9f7 100644 --- a/docker/script/build.sh +++ b/docker/script/build.sh @@ -36,6 +36,17 @@ else failed=1 fi +echo -n 'Building ChubaoFS libsdk ... '; +cd /go/src/github.com/chubaofs/chubaofs/libsdk; +bash ./build.sh &>> /tmp/cfs_build_output; +if [[ $? -eq 0 ]]; then + echo -e "\033[32mdone\033[0m"; + mv libcfs.so /go/src/github.com/chubaofs/chubaofs/docker/bin/; +else + echo -e "\033[31mfail\033[0m"; + failed=1 +fi + if [[ ${failed} -eq 1 ]]; then echo -e "\nbuild output:" cat /tmp/cfs_build_output;