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

Sync master to 3.7.1 #234

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 37 additions & 18 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ on:
types: [ published, created, edited ]
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
build_with_clang:
name: build_with_clang
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
os: [ macos-12 ]
# env:
# VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
steps:
Expand Down Expand Up @@ -63,11 +64,11 @@ jobs:
ls -h bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.dylib
- uses: actions/upload-artifact@v4
with:
name: libbcos-c-sdk.dylib.zip
name: libbcos-c-sdk.dylib
path: build/libbcos-c-sdk.dylib
- uses: actions/upload-artifact@v4
with:
name: libbcos-sdk-jni.dylib.zip
name: libbcos-sdk-jni.dylib
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.dylib
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
Expand Down Expand Up @@ -161,16 +162,26 @@ jobs:
vcpkg-centos-v1-notest-${{ runner.temp }}-
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl-rh/2/3.el7.centos/noarch/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
rpm -ivh https://cbs.centos.org/kojifiles/packages/centos-release-scl/2/3.el7.centos/noarch/centos-release-scl-2-3.el7.centos.noarch.rpm
sed -i s/mirror.centos.org/mirrors.aliyun.com/g /etc/yum.repos.d/*.repo
sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo
sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo
cat /etc/yum.repos.d/*.repo
yum clean all
yum makecache
yum update -y
yum install -y epel-release centos-release-scl centos-release-scl-rh
yum install -y https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
yum install -y java-11-openjdk-devel wget git make gcc gcc-c++ glibc-static glibc-devel openssl openssl-devel ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison python-devel python3-devel
yum install -y java-11-openjdk-devel wget git make gcc gcc-c++ glibc-static glibc-devel openssl openssl-devel ccache devtoolset-11 llvm-toolset-7.0 rh-perl530-perl libzstd-devel zlib-devel flex bison
- name: reinstall cmake
run: |
wget -c https://github.com/Kitware/CMake/releases/download/v3.27.8/cmake-3.27.8-linux-x86_64.tar.gz
tar -zxvf cmake-3.27.8-linux-x86_64.tar.gz && mkdir -p /usr/local/cmake && cd cmake-3.27.8-linux-x86_64 && cp -r * /usr/local/cmake
ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake
cmake --version
git --version
rm -rf cmake-3.27.8-linux-x86_64.tar.gz
- name: configure
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
Expand All @@ -182,29 +193,37 @@ jobs:
export CFLAGS="${CFLAGS} -fPIC"
export CXXFLAGS="${CXXFLAGS} -fPIC"
mkdir -p build && cd build
cmake ../ -DBUILD_JNI=ON -DBUILD_SAMPLE=ON -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake ../ -DBUILD_JNI=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SAMPLE=ON -DTESTS=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
make -j4
- name: run test
run: cd build && CTEST_OUTPUT_ON_FAILURE=TRUE make test
- name: print link.txt
run: cat build/CMakeFiles/bcos-c-sdk*.dir/link.txt
- uses: actions/upload-artifact@v3
with:
name: libbcos-c-sdk-WithDebInfo.so
path: build/libbcos-c-sdk.so
- name: strip libbcos-c-sdk.so
run: |
ls -h build/libbcos-c-sdk.so
strip build/libbcos-c-sdk.so || strip -x build/libbcos-c-sdk.so
ls -h build/libbcos-c-sdk.so
- uses: actions/upload-artifact@v3
with:
name: libbcos-sdk-jni-WithDebInfo.so
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
- name: strip libbcos-sdk-jni.so
run: |
ls -h bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
strip bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so || strip -x bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
ls -h bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: libbcos-c-sdk.so.zip
name: libbcos-c-sdk.so
path: build/libbcos-c-sdk.so
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: libbcos-sdk-jni.so.zip
name: libbcos-sdk-jni.so
path: bindings/java/jni/src/main/resources/META-INF/native/libbcos-sdk-jni.so
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
Expand Down Expand Up @@ -244,21 +263,21 @@ jobs:
cmake -G "Visual Studio 16 2019" -A x64 ../ -DCMAKE_BUILD_TYPE=Release -DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7 -D_WIN32_WINNT=0x0601 -DTESTS=ON -DBUILD_JNI=ON -DVCPKG_TARGET_TRIPLET='x64-windows-static' -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake || cat C:\vcpkg\buildtrees\fisco-bcos-cpp-sdk\build-x64-windows-static-dbg-out.log
- name: compile
run: cd build && MSBuild bcos-c-sdk.sln /p:Configuration=Release /p:Platform=x64
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: bcos-c-sdk.lib.zip
name: bcos-c-sdk.lib
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.lib
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: bcos-c-sdk.dll.zip
name: bcos-c-sdk.dll
path: D:\a\bcos-c-sdk\bcos-c-sdk\build\Release\bcos-c-sdk.dll
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: bcos-sdk-jni.lib.zip
name: bcos-sdk-jni.lib
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.lib
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: bcos-sdk-jni.dll.zip
name: bcos-sdk-jni.dll
path: D:\a\bcos-c-sdk\bcos-c-sdk\bindings\java\jni\src\main\resources\META-INF\native\Release\bcos-sdk-jni.dll
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if ("${ARCHITECTURE}" MATCHES "aarch64")
set(ARCH_NATIVE ON)
endif ()

set(VCPKG_BUILD_TYPE "Release")
set(VCPKG_BUILD_TYPE "RelWithDebInfo")
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
find_package(Git REQUIRED)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive -- vcpkg WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
Expand Down
1 change: 1 addition & 0 deletions bindings/go/csdk/csdk_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func on_callback_once(resp *C.struct_bcos_sdk_c_struct_response) {
var respData Response
if int(resp.error) != 0 {
respData.Err = fmt.Errorf("something is wrong, error: %d, errorMessage: %s", resp.error, C.GoString(resp.desc))
respData.Result = []byte{}
} else {
respData.Result = C.GoBytes(unsafe.Pointer(resp.data), C.int(resp.size))
}
Expand Down
Loading