Skip to content
Open
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
186 changes: 1 addition & 185 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,192 +15,8 @@ env:

# https://github.com/actions/runner-images
jobs:
compile-with-make:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependencies

- name: gcc with default options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror

- name: gcc with all options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan

- name: clang with default options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror

- name: clang with all options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan

compile-with-cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependencies

- name: gcc with default options
run: |
export CC=gcc && export CXX=g++
mkdir gcc_build && cd gcc_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

- name: gcc with all options
run: |
export CC=gcc && export CXX=g++
mkdir gcc_build_all && cd gcc_build_all
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

- name: clang with default options
run: |
export CC=clang && export CXX=clang++
mkdir clang_build && cd clang_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

- name: clang with all options
run: |
export CC=clang && export CXX=clang++
mkdir clang_build_all && cd clang_build_all
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

gcc-compile-with-make-protobuf:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies

- name: protobuf 3.5.1
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.5.1
protobuf-cpp-version: 3.5.1
protobuf-install-dir: /protobuf-3.5.1
config-brpc-options: --cc=gcc --cxx=g++ --werror

- name: protobuf 3.12.4
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.12.4
protobuf-cpp-version: 3.12.4
protobuf-install-dir: /protobuf-3.12.4
config-brpc-options: --cc=gcc --cxx=g++ --werror

- name: protobuf 21.12
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 21.12
protobuf-cpp-version: 3.21.12
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=gcc --cxx=g++ --werror

gcc-compile-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures -- //... -//example/...

gcc-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...

gcc-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --define with_mesalink=false --define with_glog=true --define with_thrift=true --define with_debug_bthread_sche_safety=true --define with_debug_lock=true --define with_asan=true -- //... -//example/...

clang-compile-with-make-protobuf:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies

- name: protobuf 3.5.1
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.5.1
protobuf-cpp-version: 3.5.1
protobuf-install-dir: /protobuf-3.5.1
config-brpc-options: --cc=clang --cxx=clang++ --werror

- name: protobuf 3.12.4
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.12.4
protobuf-cpp-version: 3.12.4
protobuf-install-dir: /protobuf-3.12.4
config-brpc-options: --cc=clang --cxx=clang++ --werror

- name: protobuf 21.12
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 21.12
protobuf-cpp-version: 3.21.12
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=clang --cxx=clang++ --werror

clang-compile-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang -- //... -//example/...

clang-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...

clang-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang --define with_mesalink=false --define with_glog=true --define with_thrift=true --define with_debug_bthread_sche_safety=true --define with_debug_lock=true --define with_asan=true -- //... -//example/...

clang-unittest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies
- uses: ./.github/actions/init-ut-make-config
with:
options: --with-bthread-tracer
- name: compile tests
run: |
cat config.mk
cd test
make -j ${{env.proc_num}}
- name: run tests
run: |
cd test
sh ./run_tests.sh

clang-unittest-asan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies
- uses: ./.github/actions/init-ut-make-config
with:
options: --with-bthread-tracer --with-asan
- name: compile tests
run: |
cat config.mk
cd test
make NEED_GPERFTOOLS=0 -j ${{env.proc_num}}
- name: run tests
run: |
cd test
sh ./run_tests.sh
- run: bazel build --verbose_failures //:brpc
67 changes: 0 additions & 67 deletions .github/workflows/ci-macos.yml

This file was deleted.

46 changes: 16 additions & 30 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,27 @@ licenses(["notice"]) # Apache v2

exports_files(["LICENSE"])

DEFINES = [
"BTHREAD_USE_FAST_PTHREAD_MUTEX",
"__const__=__unused__",
"__STDC_FORMAT_MACROS",
"__STDC_LIMIT_MACROS",
"__STDC_CONSTANT_MACROS",
] + select({
"//bazel/config:brpc_with_glog": ["BRPC_WITH_GLOG=1"],
"//conditions:default": ["BRPC_WITH_GLOG=0"],
}) + select({
"//bazel/config:brpc_with_no_pthread_mutex_hook": ["NO_PTHREAD_MUTEX_HOOK"],
"//conditions:default": [],
})

COPTS = [
"-DBTHREAD_USE_FAST_PTHREAD_MUTEX",
"-D__const__=__unused__",
"-D_GNU_SOURCE",
"-DUSE_SYMBOLIZE",
"-DNO_TCMALLOC",
"-D__STDC_FORMAT_MACROS",
"-D__STDC_LIMIT_MACROS",
"-D__STDC_CONSTANT_MACROS",
] + select({
"//bazel/config:brpc_with_glog": ["-DBRPC_WITH_GLOG=1"],
"//conditions:default": ["-DBRPC_WITH_GLOG=0"],
}) + select({
"//bazel/config:brpc_with_mesalink": ["-DUSE_MESALINK"],
"//conditions:default": [""],
}) + select({
"//bazel/config:brpc_with_thrift": ["-DENABLE_THRIFT_FRAMED_PROTOCOL=1"],
"//conditions:default": [""],
}) + select({
"//bazel/config:brpc_with_thrift_legacy_version": [],
"//conditions:default": ["-DTHRIFT_STDCXX=std"],
}) + select({
"//bazel/config:brpc_with_rdma": ["-DBRPC_WITH_RDMA=1"],
"//conditions:default": [""],
}) + select({
"//bazel/config:brpc_with_debug_bthread_sche_safety": ["-DBRPC_DEBUG_BTHREAD_SCHE_SAFETY=1"],
"//conditions:default": ["-DBRPC_DEBUG_BTHREAD_SCHE_SAFETY=0"],
}) + select({
"//bazel/config:brpc_with_debug_lock": ["-DBRPC_DEBUG_LOCK=1"],
"//conditions:default": ["-DBRPC_DEBUG_LOCK=0"],
}) + select({
"//bazel/config:brpc_with_asan": ["-fsanitize=address"],
"//conditions:default": [""],
}) + select({
"//bazel/config:brpc_with_no_pthread_mutex_hook": ["-DNO_PTHREAD_MUTEX_HOOK"],
"//conditions:default": [""],
})

LINKOPTS = [
Expand Down Expand Up @@ -330,6 +315,7 @@ cc_library(
"src/butil/third_party/dmg_fp/dtoa.cc",
":config_h",
],
defines = DEFINES,
copts = COPTS + select({
"//bazel/config:brpc_build_for_unittest": [
"-DBVAR_NOT_LINK_DEFAULT_VARIABLES",
Expand Down Expand Up @@ -405,7 +391,7 @@ cc_library(
]),
defines = [] + select({
"//bazel/config:brpc_with_bthread_tracer": [
"-DBRPC_BTHREAD_TRACER",
"BRPC_BTHREAD_TRACER",
],
"//conditions:default": [],
}),
Expand Down