This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new decdf3e7 Fix compile errors of json2pb (#2956)
decdf3e7 is described below

commit decdf3e7d8f87b2a8ca5a717aa20fd9f7c17ee0e
Author: Bright Chen <chenguangmin...@foxmail.com>
AuthorDate: Thu Apr 24 10:15:49 2025 +0800

    Fix compile errors of json2pb (#2956)
---
 .../actions/compile-with-make-protobuf/action.yml  |  27 +++
 .github/actions/compile-with-make/action.yml       |  11 +
 .github/actions/init-make-config/action.yml        |   9 -
 .github/actions/init-ut-make-config/action.yml     |  27 ++-
 .../action.yml                                     |   4 +-
 .../action.yml                                     |   0
 .github/workflows/ci-linux.yml                     | 253 +++++++++++----------
 .github/workflows/ci-macos.yml                     |  72 ++----
 src/json2pb/json_to_pb.cpp                         |   2 +
 src/json2pb/pb_to_json.cpp                         |   1 +
 10 files changed, 206 insertions(+), 200 deletions(-)

diff --git a/.github/actions/compile-with-make-protobuf/action.yml 
b/.github/actions/compile-with-make-protobuf/action.yml
new file mode 100644
index 00000000..5448b81d
--- /dev/null
+++ b/.github/actions/compile-with-make-protobuf/action.yml
@@ -0,0 +1,27 @@
+inputs:
+  protobuf-version:
+    description: version of protobuf
+    required: true
+  protobuf-cpp-version:
+    description: version of protobuf-cpp
+    required: true
+  protobuf-install-dir:
+    description: install directory of protobuf
+    required: true
+  config-brpc-options:
+    description: extra options for config_brpc.sh
+    required: true
+runs:
+  using: "composite"
+  steps:
+  - run: | 
+      wget 
https://github.com/protocolbuffers/protobuf/releases/download/v${{inputs.protobuf-version}}/protobuf-cpp-${{inputs.protobuf-cpp-version}}.tar.gz
+      tar -xf protobuf-cpp-${{inputs.protobuf-cpp-version}}.tar.gz
+      cd protobuf-${{inputs.protobuf-cpp-version}}
+      ./configure --prefix=${{inputs.protobuf-install-dir}} --with-pic 
--disable-java --disable-python --disable-other-languages
+      sudo mkdir ${{inputs.protobuf-install-dir}}
+      make -j ${{env.proc_num}} && sudo make install
+    shell: bash
+  - uses: ./.github/actions/compile-with-make
+    with:
+      options: --headers="${{inputs.protobuf-install-dir}}/include 
/usr/include" --libs="${{inputs.protobuf-install-dir}} /usr/lib /usr/lib64" 
${{inputs.config-brpc-options}}
diff --git a/.github/actions/compile-with-make/action.yml 
b/.github/actions/compile-with-make/action.yml
new file mode 100644
index 00000000..1192b30d
--- /dev/null
+++ b/.github/actions/compile-with-make/action.yml
@@ -0,0 +1,11 @@
+inputs:
+  options:
+    description: extra options for config_brpc.sh
+    required: false
+runs:
+  using: "composite"
+  steps:
+  - run: |
+      sh config_brpc.sh --nodebugsymbols ${{inputs.options}}
+      cat config.mk && make clean && make -j ${{env.proc_num}}
+    shell: bash
diff --git a/.github/actions/init-make-config/action.yml 
b/.github/actions/init-make-config/action.yml
deleted file mode 100644
index 1132b605..00000000
--- a/.github/actions/init-make-config/action.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-inputs:
-  options:
-    description: extra options for config_brpc.sh
-    required: false
-runs:
-  using: "composite"
-  steps:
-    - run: sh config_brpc.sh --headers="/usr/include" --libs="/usr/lib 
/usr/lib64" --nodebugsymbols ${{inputs.options}}
-      shell: bash
diff --git a/.github/actions/init-ut-make-config/action.yml 
b/.github/actions/init-ut-make-config/action.yml
index b4c57486..891e45b2 100644
--- a/.github/actions/init-ut-make-config/action.yml
+++ b/.github/actions/init-ut-make-config/action.yml
@@ -5,11 +5,22 @@ inputs:
 runs:
   using: "composite"
   steps:
-    - run: sudo apt-get update && sudo apt-get install -y clang-12 lldb-12 
lld-12 libgtest-dev cmake gdb libstdc++6-11-dbg && cd /usr/src/gtest && export 
CC=clang-12 && export CXX=clang++-12 && sudo cmake 
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 . && sudo make -j ${{env.proc_num}} && sudo 
mv lib/libgtest* /usr/lib/
-      shell: bash
-    - run: sudo git clone https://github.com/libunwind/libunwind.git && cd 
libunwind && sudo git checkout tags/v1.8.1 && sudo mkdir -p /libunwind && sudo 
autoreconf -i && sudo CC=clang-12 CXX=clang++-12 ./configure 
--prefix=/libunwind && sudo make -j ${{env.proc_num}} && sudo make install
-      shell: bash
-    - run: sudo git clone https://github.com/gperftools/gperftools.git && cd 
gperftools && sudo git checkout tags/gperftools-2.16 && sudo mkdir -p 
/gperftools && sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure 
--prefix=/gperftools --enable-frame-pointers && sudo make -j ${{env.proc_num}} 
&& sudo make install
-      shell: bash
-    - run: sh config_brpc.sh --headers="/libunwind/include /gperftools/include 
/usr/include" --libs="/libunwind/lib /gperftools/lib /usr/lib /usr/lib64" 
${{inputs.options}}
-      shell: bash
+  - run: |
+      sudo apt-get update && sudo apt-get install -y clang-12 lldb-12 lld-12 
libgtest-dev cmake gdb libstdc++6-11-dbg
+      cd /usr/src/gtest && export CC=clang-12 && export CXX=clang++-12 && sudo 
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
+      sudo make -j ${{env.proc_num}} && sudo mv lib/libgtest* /usr/lib/
+    shell: bash
+  - run: |
+      sudo git clone https://github.com/libunwind/libunwind.git
+      cd libunwind && sudo git checkout tags/v1.8.1 && sudo mkdir -p /libunwind
+      sudo autoreconf -i && sudo CC=clang-12 CXX=clang++-12 ./configure 
--prefix=/libunwind
+      sudo make -j ${{env.proc_num}} && sudo make install
+    shell: bash
+  - run: |
+      sudo git clone https://github.com/gperftools/gperftools.git 
+      cd gperftools && sudo git checkout tags/gperftools-2.16 && sudo mkdir -p 
/gperftools 
+      sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure 
--prefix=/gperftools --enable-frame-pointers 
+      sudo make -j ${{env.proc_num}} && sudo make install
+    shell: bash
+  - run: sh config_brpc.sh --headers="/libunwind/include /gperftools/include 
/usr/include" --libs="/libunwind/lib /gperftools/lib /usr/lib /usr/lib64" 
${{inputs.options}}
+    shell: bash
diff --git a/.github/actions/install-all-dependences/action.yml 
b/.github/actions/install-all-dependencies/action.yml
similarity index 80%
rename from .github/actions/install-all-dependences/action.yml
rename to .github/actions/install-all-dependencies/action.yml
index 2394c2fc..cb4d0002 100644
--- a/.github/actions/install-all-dependences/action.yml
+++ b/.github/actions/install-all-dependencies/action.yml
@@ -1,10 +1,10 @@
 runs:
   using: "composite"
   steps:
-    - uses: ./.github/actions/install-essential-dependences
+    - uses: ./.github/actions/install-essential-dependencies
     - run: sudo apt-get install -y libunwind-dev libgoogle-glog-dev automake 
bison flex libboost-all-dev libevent-dev libtool pkg-config  libibverbs1 
libibverbs-dev
       shell: bash
     - run: wget 
https://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf 
thrift-0.11.0.tar.gz
       shell: bash
-    - run: cd thrift-0.11.0/ && ./configure --prefix=/usr --with-rs=no 
--with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no 
--with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no 
--with-haskell=no --with-dotnetcore=no CXXFLAGS="-Wno-unused-variable" && make 
-j $(nproc) && sudo make install
+    - run: cd thrift-0.11.0/ && ./configure --prefix=/usr --with-rs=no 
--with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no 
--with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no 
--with-haskell=no --with-dotnetcore=no CXXFLAGS="-Wno-unused-variable" && make 
-j ${{env.proc_num}} && sudo make install
       shell: bash
diff --git a/.github/actions/install-essential-dependences/action.yml 
b/.github/actions/install-essential-dependencies/action.yml
similarity index 100%
rename from .github/actions/install-essential-dependences/action.yml
rename to .github/actions/install-essential-dependencies/action.yml
diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml
index 965ffb20..dbceac1a 100644
--- a/.github/workflows/ci-linux.yml
+++ b/.github/workflows/ci-linux.yml
@@ -13,74 +13,107 @@ on:
 env:
   proc_num: $(nproc)
 
+# https://github.com/actions/runner-images
 jobs:
-  gcc-compile-with-make:
-    runs-on: ubuntu-22.04 # https://github.com/actions/runner-images
+  compile-with-make:
+    runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-essential-dependences
-    - uses: ./.github/actions/init-make-config
+    - uses: ./.github/actions/install-all-dependencies
+
+    - name: gcc with default options
+      uses: ./.github/actions/compile-with-make
       with:
-        options: --cc=gcc --cxx=g++ --werror
-    - name: compile
-      run: |
-           make -j ${{env.proc_num}}
+        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
 
-  gcc-compile-with-cmake:
+  compile-with-cmake:
     runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-essential-dependences
-    - name: cmake
+    - uses: ./.github/actions/install-all-dependencies
+
+    - name: gcc with default options
       run: |
-           export CC=gcc && export CXX=g++
-           mkdir build
-           cd build
-           cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
-    - name: compile
+        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: |
-           cd build
-           make -j ${{env.proc_num}}
+        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
 
-  gcc-compile-with-bazel:
-    runs-on: ubuntu-22.04
-    steps:
-    - uses: actions/checkout@v2
-    - run: bazel build --verbose_failures -- //... -//example/...
+    - 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
 
-  gcc-compile-with-boringssl:
+    - 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
-    - run: bazel build --verbose_failures --define with_mesalink=false 
--define with_glog=true --define with_thrift=true --define 
BRPC_WITH_BORINGSSL=true -- //... -//example/...
+    - uses: ./.github/actions/install-essential-dependencies
 
-  gcc-compile-with-make-all-options:
+    - 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
-    - uses: ./.github/actions/install-all-dependences
-    - uses: ./.github/actions/init-make-config
-      with:
-       options: --cc=gcc --cxx=g++ --with-thrift --with-glog --with-rdma  
--with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer 
--werror --with-asan
-    - name: compile
-      run: |
-        make -j ${{env.proc_num}}
+    - run: bazel build --verbose_failures -- //... -//example/...
 
-  gcc-compile-with-cmake-all-options:
+  gcc-compile-with-boringssl:
     runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-all-dependences
-    - name: cmake
-      run: |
-           export CC=gcc && export CXX=g++
-           mkdir build
-           cd build
-           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 ..
-    - name: compile
-      run: |
-           cd build
-           make -j ${{env.proc_num}}
+    - 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
@@ -88,33 +121,35 @@ jobs:
     - 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:
+  clang-compile-with-make-protobuf:
     runs-on: ubuntu-22.04
     steps:
     - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-essential-dependences
-    - uses: ./.github/actions/init-make-config
+    - uses: ./.github/actions/install-essential-dependencies
+
+    - name: protobuf 3.5.1
+      uses: ./.github/actions/compile-with-make-protobuf
       with:
-        options: --cc=clang --cxx=clang++ --werror
-    - name: compile
-      run: |
-           make -j ${{env.proc_num}}
+        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
 
-  clang-compile-with-cmake:
-    runs-on: ubuntu-22.04
-    steps:
-    - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-essential-dependences
-    - name: cmake
-      run: |
-           export CC=clang && export CXX=clang++
-           mkdir build
-           cd build
-           cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
-    - name: compile
-      run: |
-           cd build
-           make -j ${{env.proc_num}}
+    - 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
@@ -128,34 +163,6 @@ jobs:
     - 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-make-all-options:
-    runs-on: ubuntu-22.04
-    steps:
-    - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-all-dependences
-    - uses: ./.github/actions/init-make-config
-      with:
-        options: --cc=clang --cxx=clang++ --with-thrift --with-glog 
--with-rdma  --with-debug-bthread-sche-safety --with-debug-lock 
--with-bthread-tracer --werror --with-asan
-    - name: compile
-      run: |
-           make -j ${{env.proc_num}}
-
-  clang-compile-with-cmake-all-options:
-    runs-on: ubuntu-22.04
-    steps:
-    - uses: actions/checkout@v2
-    - uses: ./.github/actions/install-all-dependences
-    - name: cmake
-      run: |
-           export CC=clang && export CXX=clang++
-           mkdir build
-           cd build
-           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 ..
-    - name: compile
-      run: |
-           cd build
-           make -j ${{env.proc_num}}
-
   clang-compile-with-bazel-all-options:
     runs-on: ubuntu-22.04
     steps:
@@ -165,35 +172,35 @@ jobs:
   clang-unittest:
     runs-on: ubuntu-22.04
     steps:
-      - uses: actions/checkout@v2
-      - uses: ./.github/actions/install-essential-dependences
-      - uses: ./.github/actions/init-ut-make-config
-        with:
-          options: --cc=clang-12 --cxx=clang++-12 --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
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/install-essential-dependencies
+    - uses: ./.github/actions/init-ut-make-config
+      with:
+        options: --cc=clang-12 --cxx=clang++-12 --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-dependences
-      - uses: ./.github/actions/init-ut-make-config
-        with:
-          options: --cc=clang-12 --cxx=clang++-12 --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
+    - uses: actions/checkout@v2
+    - uses: ./.github/actions/install-essential-dependencies
+    - uses: ./.github/actions/init-ut-make-config
+      with:
+        options: --cc=clang-12 --cxx=clang++-12 --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
diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml
index 50ab2e02..014850f6 100644
--- a/.github/workflows/ci-macos.yml
+++ b/.github/workflows/ci-macos.yml
@@ -14,7 +14,7 @@ env:
   proc_num: $(sysctl -n hw.logicalcpu)
 
 jobs:
-  compile-with-make:
+  compile:
     runs-on: macos-latest # https://github.com/actions/runner-images
 
     steps:
@@ -25,37 +25,17 @@ jobs:
            brew install ./homebrew-formula/protobuf.rb 
            brew install openssl gnu-getopt coreutils gflags leveldb
 
-    - name: config_brpc
+    - name: compile with make
       run: |
-           GETOPT_PATH=$(brew --prefix gnu-getopt)/bin
-           export PATH=$GETOPT_PATH:$PATH
-           ./config_brpc.sh --header="$(brew --prefix)/include" --libs="$(brew 
--prefix)/lib"
+        GETOPT_PATH=$(brew --prefix gnu-getopt)/bin
+        export PATH=$GETOPT_PATH:$PATH
+        ./config_brpc.sh --header="$(brew --prefix)/include" --libs="$(brew 
--prefix)/lib"
+        make -j ${{env.proc_num}} && make clean
 
-    - name: compile
+    - name: compile with cmake
       run: |
-           make -j ${{env.proc_num}}
-
-  compile-with-cmake:
-    runs-on: macos-latest
-
-    steps:
-    - uses: actions/checkout@v2
-    
-    - name: install dependences
-      run: |
-           brew install ./homebrew-formula/protobuf.rb 
-           brew install openssl gflags leveldb
-
-    - name: cmake
-      run: |
-           mkdir build
-           cd build
-           cmake ..
-
-    - name: compile
-      run: |
-           cd build
-           make -j ${{env.proc_num}}
+        mkdir build && cd build && cmake ..
+        make -j ${{env.proc_num}} && make clean
 
   compile-with-make-protobuf23:
     runs-on: macos-latest # https://github.com/actions/runner-images
@@ -72,38 +52,14 @@ jobs:
           curl -o protobuf.rb 
https://raw.githubusercontent.com/Homebrew/homebrew-core/b85b8dbf23ad509f163677a88ac72268f31e9c4a/Formula/protobuf.rb
           HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --formula 
--ignore-dependencies ./abseil.rb ./protobuf.rb
 
-      - name: config_brpc
+      - name: compile with make
         run: |
           GETOPT_PATH=$(brew --prefix gnu-getopt)/bin
           export PATH=$GETOPT_PATH:$PATH
            ./config_brpc.sh --header="$(brew --prefix)/include" --libs="$(brew 
--prefix)/lib"
+          make -j ${{env.proc_num}} && make clean
 
-      - name: compile
-        run: |
-          make -j ${{env.proc_num}}
-
-  compile-with-cmake-protobuf23:
-    runs-on: macos-latest
-
-    steps:
-      - uses: actions/checkout@v2
-
-      - name: install dependences
-        run: |
-          brew install openssl gflags leveldb
-          # abseil 20230125.3
-          curl -o abseil.rb   
https://raw.githubusercontent.com/Homebrew/homebrew-core/b85b8dbf23ad509f163677a88ac72268f31e9c4a/Formula/abseil.rb
-          # protobuf 23.3
-          curl -o protobuf.rb 
https://raw.githubusercontent.com/Homebrew/homebrew-core/b85b8dbf23ad509f163677a88ac72268f31e9c4a/Formula/protobuf.rb
-          HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install --formula 
--ignore-dependencies ./abseil.rb ./protobuf.rb
-
-      - name: cmake
-        run: |
-          mkdir build
-          cd build
-          cmake ..
-
-      - name: compile
+      - name: compile with make
         run: |
-          cd build
-          make -j ${{env.proc_num}}
+          mkdir build && cd build && cmake ..
+          make -j ${{env.proc_num}} && make clean
diff --git a/src/json2pb/json_to_pb.cpp b/src/json2pb/json_to_pb.cpp
index 42d4772e..82327cd6 100644
--- a/src/json2pb/json_to_pb.cpp
+++ b/src/json2pb/json_to_pb.cpp
@@ -24,6 +24,8 @@
 #include <typeinfo>
 #include <limits> 
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/io/coded_stream.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 #include "butil/strings/string_number_conversions.h"
 #include "butil/third_party/rapidjson/error/error.h"
 #include "butil/third_party/rapidjson/rapidjson.h"
diff --git a/src/json2pb/pb_to_json.cpp b/src/json2pb/pb_to_json.cpp
index e37cc87d..9671979c 100644
--- a/src/json2pb/pb_to_json.cpp
+++ b/src/json2pb/pb_to_json.cpp
@@ -22,6 +22,7 @@
 #include <sys/time.h>
 #include <time.h>
 #include <google/protobuf/descriptor.h>
+#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
 #include "json2pb/zero_copy_stream_writer.h"
 #include "json2pb/encode_decode.h"
 #include "json2pb/protobuf_map.h"


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to