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

bakaid pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a2b3aa  MINIFICPP-1190 fix build on clang 10
7a2b3aa is described below

commit 7a2b3aacc920913eb66170d8c4c7c00d7b1e08e4
Author: Marton Szasz <szasz...@gmail.com>
AuthorDate: Thu Apr 9 16:29:41 2020 +0200

    MINIFICPP-1190 fix build on clang 10
    
    Signed-off-by: Daniel Bakai <bak...@apache.org>
    
    This closes #752
---
 cmake/BundledRocksDB.cmake                     |  2 +-
 thirdparty/rocksdb/channel-mutex-mutable.patch | 31 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/cmake/BundledRocksDB.cmake b/cmake/BundledRocksDB.cmake
index c107546..6b993c2 100644
--- a/cmake/BundledRocksDB.cmake
+++ b/cmake/BundledRocksDB.cmake
@@ -19,7 +19,7 @@ function(use_bundled_rocksdb SOURCE_DIR BINARY_DIR)
     message("Using bundled RocksDB")
 
     # Define patch step
-    set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/rocksdb/rocksdb-BUILD.patch")
+    set(PC "${Patch_EXECUTABLE}" -p1 -i 
"${SOURCE_DIR}/thirdparty/rocksdb/rocksdb-BUILD.patch" && "${Patch_EXECUTABLE}" 
-p1 -i "${SOURCE_DIR}/thirdparty/rocksdb/channel-mutex-mutable.patch")
 
     # Define byproducts
     get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
diff --git a/thirdparty/rocksdb/channel-mutex-mutable.patch 
b/thirdparty/rocksdb/channel-mutex-mutable.patch
new file mode 100644
index 0000000..d52c1ee
--- /dev/null
+++ b/thirdparty/rocksdb/channel-mutex-mutable.patch
@@ -0,0 +1,31 @@
+From a796c06fef6a8e43d793f8e627db3f29e6f95964 Mon Sep 17 00:00:00 2001
+From: Maysam Yabandeh <myaban...@fb.com>
+Date: Thu, 12 Dec 2019 13:48:50 -0800
+Subject: [PATCH] Fix build breakage from lock_guard error (#6161)
+
+Summary:
+This change fixes a source issue that caused compile time error which breaks 
build for many fbcode services in that setup. The size() member function of 
channel is a const member, so member variables accessed within it are 
implicitly const as well. This caused error when clang fails to resolve to a 
constructor that takes std::mutex because the suitable constructor got rejected 
due to loss of constness for its argument. The fix is to add mutable modifier 
to the lock_ member of channel.
+Pull Request resolved: https://github.com/facebook/rocksdb/pull/6161
+
+Differential Revision: D18967685
+
+Pulled By: maysamyabandeh
+
+fbshipit-source-id: 698b6a5153c3c92eeacb842c467aa28cc350d432
+---
+ util/channel.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/channel.h b/util/channel.h
+index 0225482c00..a8a47680a2 100644
+--- a/util/channel.h
++++ b/util/channel.h
+@@ -60,7 +60,7 @@ class channel {
+ 
+  private:
+   std::condition_variable cv_;
+-  std::mutex lock_;
++  mutable std::mutex lock_;
+   std::queue<T> buffer_;
+   bool eof_;
+ };

Reply via email to