You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2022/06/21 11:23:38 UTC

[rocketmq-clients] branch master updated: CPP: fix compile issue for MacOS

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

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new 1ec0fcf  CPP: fix compile issue for MacOS
1ec0fcf is described below

commit 1ec0fcf57b8e821d416a89f39d6a44cd48e00fbf
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Tue Jun 21 19:19:42 2022 +0800

    CPP: fix compile issue for MacOS
---
 .github/workflows/cpp_build.yml    | 39 +++++++++++++++++++++++++++++++++-----
 .github/workflows/csharp_build.yml |  4 ++--
 .github/workflows/java_build.yml   |  4 ++--
 cpp/.bazelrc                       |  2 ++
 cpp/api/rocketmq/Message.h         |  2 +-
 5 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/cpp_build.yml b/.github/workflows/cpp_build.yml
index 2d1360e..86e1a94 100644
--- a/.github/workflows/cpp_build.yml
+++ b/.github/workflows/cpp_build.yml
@@ -1,8 +1,8 @@
 name: CPP Build
 on: [push, pull_request]
 jobs:
-  cpp_ubuntu_18_04_build:
-    name: Ubuntu 18.04 Build
+  cpp_ubuntu_18_04:
+    name: Ubuntu 18.04
     runs-on: ubuntu-18.04
     steps:
       - uses: actions/checkout@v2
@@ -17,8 +17,8 @@ jobs:
       - name: Compile All Targets
         working-directory: ./cpp
         run: bazel build //...
-  cpp_mac_os_10_15_build:
-    name: MacOS 10.15 Build
+  cpp_mac_os_10_15:
+    name: MacOS 10.15
     runs-on: macos-10.15
     steps:
       - uses: actions/checkout@v2
@@ -32,4 +32,33 @@ jobs:
       - name: Compile All Targets
         working-directory: ./cpp
         run: bazel build //...
-  
+  cpp_mac_os_11:
+    name: MacOS 11
+    runs-on: macos-11
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Bazel
+        run: |
+          brew install bazelisk
+      - name: Use Bazel
+        if: matrix.os != 'windows'
+        working-directory: ./cpp
+        run: bazel -h
+      - name: Compile All Targets
+        working-directory: ./cpp
+        run: bazel build //...
+  cpp_mac_os_12:
+    name: MacOS 12
+    runs-on: macos-12
+    steps:
+      - uses: actions/checkout@v2
+      - name: Setup Bazel
+        run: |
+          brew install bazelisk
+      - name: Use Bazel
+        if: matrix.os != 'windows'
+        working-directory: ./cpp
+        run: bazel -h
+      - name: Compile All Targets
+        working-directory: ./cpp
+        run: bazel build //...
diff --git a/.github/workflows/csharp_build.yml b/.github/workflows/csharp_build.yml
index 9ddde64..557c901 100644
--- a/.github/workflows/csharp_build.yml
+++ b/.github/workflows/csharp_build.yml
@@ -1,8 +1,8 @@
 name: C# Build
 on: [push, pull_request]
 jobs:
-  c_sharp_build:
-    name: Ubuntu 18.04 Build
+  c_sharp_ubuntu_18_04:
+    name: Ubuntu 18.04
     runs-on: ubuntu-18.04
     steps:
       - name: Checkout 
diff --git a/.github/workflows/java_build.yml b/.github/workflows/java_build.yml
index dde6264..4b8b2be 100644
--- a/.github/workflows/java_build.yml
+++ b/.github/workflows/java_build.yml
@@ -1,8 +1,8 @@
 name: Java Build
 on: [push, pull_request]
 jobs:
-  java_build:
-    name: Ubuntu 18.04 Build
+  java_ubuntu_18_04:
+    name: Ubuntu 18.04
     runs-on: ubuntu-18.04
     steps:
     - name: Checkout
diff --git a/cpp/.bazelrc b/cpp/.bazelrc
index dce4c47..d5ec2a9 100644
--- a/cpp/.bazelrc
+++ b/cpp/.bazelrc
@@ -28,6 +28,8 @@ build:windows --cxxopt=/std:c++14
 build:macos --cxxopt=-std=c++11
 build:macos --strip=never
 build:macos --copt -g
+# Workaround, see https://github.com/grpc/grpc/issues/19645
+build:macos --copt -DGRPC_BAZEL_BUILD
 
 # Enable position independent code (this is the default on macOS and Windows)
 # (Workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/421)
diff --git a/cpp/api/rocketmq/Message.h b/cpp/api/rocketmq/Message.h
index 0c2ef02..642f322 100644
--- a/cpp/api/rocketmq/Message.h
+++ b/cpp/api/rocketmq/Message.h
@@ -41,7 +41,7 @@ struct Extension {
   std::chrono::system_clock::time_point delivery_timepoint{std::chrono::system_clock::now()};
   std::uint16_t delivery_attempt{0};
   std::chrono::system_clock::time_point decode_time{std::chrono::system_clock::now()};
-  std::chrono::system_clock::duration invisible_period{0};
+  std::chrono::duration<long long, std::nano> invisible_period{0};
   std::string receipt_handle;
   std::string target_endpoint;
   std::int32_t queue_id{0};