From 374fff2415d5a1099efb95a0ec198d35472259ea Mon Sep 17 00:00:00 2001 From: james94 Date: Fri, 4 Oct 2024 00:06:54 -0700 Subject: [PATCH] Reverted RocksDB arm7.patch based on main branch one & created conan package After reverting RocksDB arm7.patch back to the one based on MiNiFi main branch, verified I could still create custom RocksDB conan package using Fuzzy patching. Fuzzy patching allows us to proceed creating a conan package like RocksDB where even if there is a minor difference between patch code and actual source code, we can still apply the patch. This fuzzy patching was key in us being able to successfully apply arm7.patch when creating a custom RocksDB conan package. Previously we used apply_conandata_patches() when creating the custom RocksDB conan package and it was too strict, so we'll stick with the fuzzy patching approach. Then I verified I could build MiNiFi using the conan build approach and then the standalone CMake approach. Afterward, I verified I could create the MiNiFi conan package. Finally, I double checked that 218 out of 219 CTEST cases passed for building MiNiFi using conan build and then standalone CMake approaches. 218 out of 219 CTEST cases passed after creating the MiNiFi conan package. --- thirdparty/rocksdb/all/conandata.yml | 1 + thirdparty/rocksdb/all/conanfile.py | 6 +++--- thirdparty/rocksdb/all/patches/arm7.patch | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/thirdparty/rocksdb/all/conandata.yml b/thirdparty/rocksdb/all/conandata.yml index ed09c733cf..f5c3ecd302 100644 --- a/thirdparty/rocksdb/all/conandata.yml +++ b/thirdparty/rocksdb/all/conandata.yml @@ -12,3 +12,4 @@ patches: patch_description: "Fix for missing equality operator in DBOptions and make DBOptions configurable" patch_type: "portability" patch_source: "https://github.com/apache/nifi-minifi-cpp/commit/545236fd06b613f2d2b38f74ff9ee85df9190d59" + - patch_file: "patches/cstdint.patch" diff --git a/thirdparty/rocksdb/all/conanfile.py b/thirdparty/rocksdb/all/conanfile.py index d9a5ae5627..a1ff97ad87 100644 --- a/thirdparty/rocksdb/all/conanfile.py +++ b/thirdparty/rocksdb/all/conanfile.py @@ -6,7 +6,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rm, rmdir +from conan.tools.files import patch, collect_libs, copy, export_conandata_patches, get, rm, rmdir from conan.tools.microsoft import check_min_vs, is_msvc, is_msvc_static_runtime from conan.tools.scm import Version @@ -96,7 +96,6 @@ def requirements(self): self.requires("zlib/[>=1.2.11 <2]") if self.options.with_bz2: self.requires("bzip2/1.0.8") - # self.requires("bzip2/1.0.8@minifi/dev") # prebuilt with minifi bz2 patch if self.options.with_zstd: self.requires("zstd/1.5.2") if self.options.get_safe("with_tbb"): @@ -174,7 +173,8 @@ def generate(self): deps.generate() def build(self): - apply_conandata_patches(self) + for patch_data in self.conan_data.get("patches", {}).get(self.version, []): + patch(self, patch_file=patch_data["patch_file"], base_path=self.source_folder, strip=1, fuzz=True) cmake = CMake(self) cmake.configure() cmake.build() diff --git a/thirdparty/rocksdb/all/patches/arm7.patch b/thirdparty/rocksdb/all/patches/arm7.patch index bd1eb6aa22..1eb64ed5ce 100644 --- a/thirdparty/rocksdb/all/patches/arm7.patch +++ b/thirdparty/rocksdb/all/patches/arm7.patch @@ -4,7 +4,7 @@ index 225e3fa72..cd5f935f1 100644 +++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h @@ -131,6 +131,10 @@ static inline tokutime_t toku_time_now(void) { uint64_t result; - __asm __volatile__("mrs %[rt], cntvct_el0" : [rt] "=r"(result)); + __asm __volatile__("mrs %[rt], cntvct_el0" : [ rt ] "=r"(result)); return result; +#elif defined(__arm__) + uint32_t lo, hi;