diff --git a/databases/rocksdb/Makefile b/databases/rocksdb/Makefile index 3fb5e8174e55..401c26a811da 100644 --- a/databases/rocksdb/Makefile +++ b/databases/rocksdb/Makefile @@ -1,83 +1,83 @@ PORTNAME= rocksdb -PORTVERSION= 7.9.2 +PORTVERSION= 8.0.0 DISTVERSIONPREFIX= v CATEGORIES= databases MAINTAINER= sunpoet@FreeBSD.org COMMENT= Persistent key-value store for fast storage environments WWW= https://rocksdb.org/ \ https://github.com/facebook/rocksdb LICENSE= APACHE20 GPLv2 LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE.Apache LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING -BROKEN= fails to build +#BROKEN= fails to build BROKEN_DragonFly= does not build on DragonFly BSD using GCC with -Werror BROKEN_armv6= does not build: db/c.cc:2281:44: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'size_t' (aka 'unsigned int') BROKEN_armv7= does not build: /nxb-bin/usr/bin/ld: undefined reference to symbol `__gnu_Unwind_Find_exidx@@FBSD_1.4' (try adding -lc) #'` BROKEN_FreeBSD_12_powerpc64= does not build: util/crc32c.cc:435:22: 'arch_ppc_probe' was not declared in this scope BUILD_DEPENDS= bash:shells/bash LIB_DEPENDS= libgflags.so:devel/gflags \ libsnappy.so:archivers/snappy USES= compiler:c++17-lang gmake localbase:ldflags perl5 USE_PERL5= build ALL_TARGET= shared_lib static_lib all CFLAGS+= -DOS_FREEBSD CONFIGURE_ARGS= make_config.mk CONFIGURE_ENV= PORTABLE=0 ROCKSDB_ROOT=${WRKSRC} CONFIGURE_SCRIPT= build_tools/build_detect_platform HAS_CONFIGURE= yes -MAKE_ENV= CXX=${CXX} INSTALL_PATH=${STAGEDIR}${PREFIX} USE_RTTI=1 +MAKE_ENV= CXX=${CXX} INSTALL_PATH=${STAGEDIR}${PREFIX} USE_RTTI=1 V=1 USE_CXXSTD= c++17 USE_LDCONFIG= yes TEST_TARGET= check PLIST_SUB= PORTVERSION=${PORTVERSION} SHLIB_VER=${PORTVERSION:R} PORTDATA= make_config.mk GH_ACCOUNT= facebook USE_GITHUB= yes CONFLICTS_INSTALL= rocksdb-lite BENCHMARKS= cache_bench db_bench memtablerep_bench persistent_cache_bench range_del_aggregator_bench table_reader_bench TOOLS= blob_dump db_repl_stress db_sanity_test db_stress ldb rocksdb_dump rocksdb_undump sst_dump trace_analyzer write_stress OPTIONS_DEFINE= DEBUG LZ4 ZSTD OPTIONS_DEFAULT=LZ4 ZSTD DEBUG_MAKE_ENV= DEBUG_LEVEL=2 DEBUG_MAKE_ENV_OFF= DEBUG_LEVEL=0 LZ4_LIB_DEPENDS= liblz4.so:archivers/liblz4 LZ4_MAKE_ENV_OFF= ROCKSDB_DISABLE_LZ4=yes ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MAKE_ENV_OFF= ROCKSDB_DISABLE_ZSTD=yes .include .if ${CHOSEN_COMPILER_TYPE} == clang CXXFLAGS+= -Wno-inconsistent-missing-override -Wno-unused-parameter -Wno-unused-variable -Wno-unused-private-field .endif post-patch: .if (${ARCH} == amd64 || ${ARCH} == i386) && !empty(CFLAGS:M-march=*) @${REINPLACE_CMD} -e 's| -march=native| ${CFLAGS:M-march=*}|' ${WRKSRC}/build_tools/build_detect_platform .else @${REINPLACE_CMD} -e 's| -march=native||' ${WRKSRC}/build_tools/build_detect_platform .endif post-install: ${MKDIR} ${STAGEDIR}${DATADIR}/ cd ${WRKSRC}/ && ${INSTALL_PROGRAM} ${BENCHMARKS} ${TOOLS} ${STAGEDIR}${PREFIX}/bin/ # Locate all shared libraries. The STRIP_CMD below failed on our package building clusters. ${FIND} ${WRKSRC} ${STAGEDIR}${PREFIX} -name '*.so*' ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/librocksdb.so ${INSTALL_LIB} ${WRKSRC}/librocksdb_tools.so ${STAGEDIR}${PREFIX}/lib/ ${INSTALL_DATA} ${WRKSRC}/make_config.mk ${STAGEDIR}${DATADIR}/ .include diff --git a/databases/rocksdb/distinfo b/databases/rocksdb/distinfo index 1b131de2dc75..52c990b124be 100644 --- a/databases/rocksdb/distinfo +++ b/databases/rocksdb/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1675190923 -SHA256 (facebook-rocksdb-v7.9.2_GH0.tar.gz) = 886378093098a1b2521b824782db7f7dd86224c232cf9652fcaf88222420b292 -SIZE (facebook-rocksdb-v7.9.2_GH0.tar.gz) = 12058713 +TIMESTAMP = 1679498520 +SHA256 (facebook-rocksdb-v8.0.0_GH0.tar.gz) = 05ff6b0e89bffdf78b5a9d6fca46cb06bde6189f5787b9eeaef0511b782c1033 +SIZE (facebook-rocksdb-v8.0.0_GH0.tar.gz) = 12634178 diff --git a/databases/rocksdb/files/patch-db-db_test_util.cc b/databases/rocksdb/files/patch-db-db_test_util.cc index 2601adc031a5..3ab185f0c560 100644 --- a/databases/rocksdb/files/patch-db-db_test_util.cc +++ b/databases/rocksdb/files/patch-db-db_test_util.cc @@ -1,120 +1,119 @@ ---- db/db_test_util.cc.orig 2022-12-22 17:30:39 UTC +--- db/db_test_util.cc.orig 2023-02-19 21:44:55 UTC +++ db/db_test_util.cc -@@ -104,9 +104,11 @@ DBTestBase::DBTestBase(const std::string path, bool en +@@ -102,9 +102,11 @@ DBTestBase::DBTestBase(const std::string path, bool en } DBTestBase::~DBTestBase() { +#ifndef NDEBUG ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->DisableProcessing(); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->LoadDependency({}); ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearAllCallBacks(); +#endif Close(); Options options; options.db_paths.emplace_back(dbname_, 0); -@@ -356,6 +358,7 @@ Options DBTestBase::GetOptions( +@@ -338,6 +340,7 @@ Options DBTestBase::GetOptions( Options options = default_options; BlockBasedTableOptions table_options; bool set_block_based_table_factory = true; +#ifndef NDEBUG #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_SOLARIS) && \ !defined(OS_AIX) ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearCallBack( -@@ -363,6 +366,7 @@ Options DBTestBase::GetOptions( +@@ -345,6 +348,7 @@ Options DBTestBase::GetOptions( ROCKSDB_NAMESPACE::SyncPoint::GetInstance()->ClearCallBack( "NewWritableFile:O_DIRECT"); #endif +#endif // kMustFreeHeapAllocations -> indicates ASAN build if (kMustFreeHeapAllocations && !options_override.full_block_cache) { // Detecting block cache use-after-free is normally difficult in unit -@@ -428,7 +432,9 @@ Options DBTestBase::GetOptions( +@@ -409,7 +413,9 @@ Options DBTestBase::GetOptions( options.use_direct_reads = true; options.use_direct_io_for_flush_and_compaction = true; options.compaction_readahead_size = 2 * 1024 * 1024; +#ifndef NDEBUG SetupSyncPointsToMockDirectIO(); +#endif break; } - #endif // ROCKSDB_LITE -@@ -1168,6 +1174,7 @@ std::string DBTestBase::FilesPerLevel(int cf) { + case kMergePut: +@@ -1141,6 +1147,7 @@ std::string DBTestBase::FilesPerLevel(int cf) { + } - #endif // !ROCKSDB_LITE +#ifndef NDEBUG std::vector DBTestBase::GetBlobFileNumbers() { VersionSet* const versions = dbfull()->GetVersionSet(); assert(versions); -@@ -1193,6 +1200,7 @@ std::vector DBTestBase::GetBlobFileNumbers() +@@ -1166,6 +1173,7 @@ std::vector DBTestBase::GetBlobFileNumbers() return result; } +#endif size_t DBTestBase::CountFiles() { size_t count = 0; -@@ -1275,6 +1283,7 @@ void DBTestBase::FillLevels(const std::string& smalles +@@ -1248,6 +1256,7 @@ void DBTestBase::FillLevels(const std::string& smalles } void DBTestBase::MoveFilesToLevel(int level, int cf) { +#ifndef NDEBUG for (int l = 0; l < level; ++l) { if (cf > 0) { EXPECT_OK(dbfull()->TEST_CompactRange(l, nullptr, nullptr, handles_[cf])); -@@ -1282,13 +1291,16 @@ void DBTestBase::MoveFilesToLevel(int level, int cf) { +@@ -1255,12 +1264,15 @@ void DBTestBase::MoveFilesToLevel(int level, int cf) { EXPECT_OK(dbfull()->TEST_CompactRange(l, nullptr, nullptr)); } } +#endif } - #ifndef ROCKSDB_LITE void DBTestBase::DumpFileCounts(const char* label) { fprintf(stderr, "---\n%s:\n", label); +#ifndef NDEBUG fprintf(stderr, "maxoverlap: %" PRIu64 "\n", dbfull()->TEST_MaxNextLevelOverlappingBytes()); +#endif for (int level = 0; level < db_->NumberLevels(); level++) { int num = NumTableFilesAtLevel(level); if (num > 0) { -@@ -1331,10 +1343,12 @@ void DBTestBase::GenerateNewFile(int cf, Random* rnd, +@@ -1302,10 +1314,12 @@ void DBTestBase::GenerateNewFile(int cf, Random* rnd, ASSERT_OK(Put(cf, Key(*key_idx), rnd->RandomString((i == 99) ? 1 : 990))); (*key_idx)++; } +#ifndef NDEBUG if (!nowait) { ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable()); ASSERT_OK(dbfull()->TEST_WaitForCompact()); } +#endif } // this will generate non-overlapping files since it keeps increasing key_idx -@@ -1343,10 +1357,12 @@ void DBTestBase::GenerateNewFile(Random* rnd, int* key +@@ -1314,10 +1328,12 @@ void DBTestBase::GenerateNewFile(Random* rnd, int* key ASSERT_OK(Put(Key(*key_idx), rnd->RandomString((i == 99) ? 1 : 990))); (*key_idx)++; } +#ifndef NDEBUG if (!nowait) { ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable()); ASSERT_OK(dbfull()->TEST_WaitForCompact()); } +#endif } const int DBTestBase::kNumKeysByGenerateNewRandomFile = 51; -@@ -1356,10 +1372,12 @@ void DBTestBase::GenerateNewRandomFile(Random* rnd, bo +@@ -1327,10 +1343,12 @@ void DBTestBase::GenerateNewRandomFile(Random* rnd, bo ASSERT_OK(Put("key" + rnd->RandomString(7), rnd->RandomString(2000))); } ASSERT_OK(Put("key" + rnd->RandomString(7), rnd->RandomString(200))); +#ifndef NDEBUG if (!nowait) { ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable()); ASSERT_OK(dbfull()->TEST_WaitForCompact()); } +#endif } std::string DBTestBase::IterStatus(Iterator* iter) { diff --git a/databases/rocksdb/files/patch-memory-arena.cc b/databases/rocksdb/files/patch-memory-arena.cc deleted file mode 100644 index db76c877c68f..000000000000 --- a/databases/rocksdb/files/patch-memory-arena.cc +++ /dev/null @@ -1,11 +0,0 @@ ---- memory/arena.cc.orig 2021-06-25 21:15:04 UTC -+++ memory/arena.cc -@@ -29,7 +29,7 @@ const size_t Arena::kInlineSize; - - const size_t Arena::kMinBlockSize = 4096; - const size_t Arena::kMaxBlockSize = 2u << 30; --static const int kAlignUnit = alignof(max_align_t); -+static const int kAlignUnit = alignof(std::max_align_t); - - size_t OptimizeBlockSize(size_t block_size) { - // Make sure block_size is in optimal range diff --git a/databases/rocksdb/files/patch-memory-arena.h b/databases/rocksdb/files/patch-memory-arena.h deleted file mode 100644 index a1dda117600a..000000000000 --- a/databases/rocksdb/files/patch-memory-arena.h +++ /dev/null @@ -1,11 +0,0 @@ ---- memory/arena.h.orig 2018-01-31 01:15:39 UTC -+++ memory/arena.h -@@ -82,7 +82,7 @@ class Arena : public Allocator { - } - - private: -- char inline_block_[kInlineSize] __attribute__((__aligned__(alignof(max_align_t)))); -+ char inline_block_[kInlineSize] __attribute__((__aligned__(alignof(std::max_align_t)))); - // Number of bytes allocated in one block - const size_t kBlockSize; - // Array of new[] allocated memory blocks diff --git a/databases/rocksdb/files/patch-memory-arena_test.cc b/databases/rocksdb/files/patch-memory-arena_test.cc index ccbdef9fc0b7..5c5b33c8cd31 100644 --- a/databases/rocksdb/files/patch-memory-arena_test.cc +++ b/databases/rocksdb/files/patch-memory-arena_test.cc @@ -1,11 +1,11 @@ ---- memory/arena_test.cc.orig 2018-01-31 01:15:39 UTC +--- memory/arena_test.cc.orig 2023-02-19 21:44:55 UTC +++ memory/arena_test.cc -@@ -91,7 +91,7 @@ static void ApproximateMemoryUsageTest(s +@@ -96,7 +96,7 @@ static void ApproximateMemoryUsageTest(size_t huge_pag ASSERT_EQ(kZero, arena.ApproximateMemoryUsage()); // allocate inline bytes - const size_t kAlignUnit = alignof(max_align_t); + const size_t kAlignUnit = alignof(std::max_align_t); EXPECT_TRUE(arena.IsInInlineBlock()); arena.AllocateAligned(kAlignUnit); EXPECT_TRUE(arena.IsInInlineBlock()); diff --git a/databases/rocksdb/files/patch-port-stack_trace.cc b/databases/rocksdb/files/patch-port-stack_trace.cc index 3b83846c5101..38ed09cc340f 100644 --- a/databases/rocksdb/files/patch-port-stack_trace.cc +++ b/databases/rocksdb/files/patch-port-stack_trace.cc @@ -1,20 +1,29 @@ ---- port/stack_trace.cc.orig 2021-06-25 21:15:04 UTC +--- port/stack_trace.cc.orig 2023-02-19 21:44:55 UTC +++ port/stack_trace.cc -@@ -135,7 +135,7 @@ void PrintStack(int first_frames_to_skip) { +@@ -33,6 +33,8 @@ void* SaveStack(int* /*num_frames*/, int /*first_frame + + #ifdef OS_FREEBSD + #include ++#include ++#include + #endif // OS_FREEBSD + #ifdef OS_LINUX + #include +@@ -219,7 +221,7 @@ void PrintStack(int first_frames_to_skip) { void* frames[kMaxFrames]; auto num_frames = backtrace(frames, kMaxFrames); - PrintStack(&frames[first_frames_to_skip], num_frames - first_frames_to_skip); + PrintStack(&frames[first_frames_to_skip], (int) (num_frames - first_frames_to_skip)); } void PrintAndFreeStack(void* callstack, int num_frames) { -@@ -148,7 +148,7 @@ void* SaveStack(int* num_frames, int first_frames_to_s +@@ -232,7 +234,7 @@ void* SaveStack(int* num_frames, int first_frames_to_s void* frames[kMaxFrames]; auto count = backtrace(frames, kMaxFrames); - *num_frames = count - first_frames_to_skip; + *num_frames = (int) (count - first_frames_to_skip); void* callstack = malloc(sizeof(void*) * *num_frames); memcpy(callstack, &frames[first_frames_to_skip], sizeof(void*) * *num_frames); return callstack; diff --git a/databases/rocksdb/pkg-plist b/databases/rocksdb/pkg-plist index 0a73c2e41d32..9c8cfde165a7 100644 --- a/databases/rocksdb/pkg-plist +++ b/databases/rocksdb/pkg-plist @@ -1,125 +1,127 @@ bin/blob_dump bin/cache_bench bin/db_bench bin/db_repl_stress bin/db_sanity_test bin/db_stress bin/ldb bin/memtablerep_bench bin/persistent_cache_bench bin/range_del_aggregator_bench bin/rocksdb_dump bin/rocksdb_undump bin/sst_dump bin/table_reader_bench bin/trace_analyzer bin/write_stress +include/rocksdb/advanced_cache.h include/rocksdb/advanced_options.h include/rocksdb/block_cache_trace_writer.h include/rocksdb/c.h include/rocksdb/cache.h include/rocksdb/cache_bench_tool.h include/rocksdb/cleanable.h include/rocksdb/compaction_filter.h include/rocksdb/compaction_job_stats.h include/rocksdb/comparator.h include/rocksdb/compression_type.h include/rocksdb/concurrent_task_limiter.h include/rocksdb/configurable.h include/rocksdb/convenience.h include/rocksdb/customizable.h include/rocksdb/data_structure.h include/rocksdb/db.h include/rocksdb/db_bench_tool.h include/rocksdb/db_dump_tool.h include/rocksdb/db_stress_tool.h include/rocksdb/env.h include/rocksdb/env_encryption.h include/rocksdb/experimental.h include/rocksdb/file_checksum.h include/rocksdb/file_system.h include/rocksdb/filter_policy.h include/rocksdb/flush_block_policy.h include/rocksdb/functor_wrapper.h include/rocksdb/io_status.h include/rocksdb/iostats_context.h include/rocksdb/iterator.h include/rocksdb/ldb_tool.h include/rocksdb/listener.h include/rocksdb/memory_allocator.h include/rocksdb/memtablerep.h include/rocksdb/merge_operator.h include/rocksdb/metadata.h include/rocksdb/options.h include/rocksdb/perf_context.h include/rocksdb/perf_level.h include/rocksdb/persistent_cache.h +include/rocksdb/port_defs.h include/rocksdb/rate_limiter.h include/rocksdb/rocksdb_namespace.h include/rocksdb/secondary_cache.h include/rocksdb/slice.h include/rocksdb/slice_transform.h include/rocksdb/snapshot.h include/rocksdb/sst_dump_tool.h include/rocksdb/sst_file_manager.h include/rocksdb/sst_file_reader.h include/rocksdb/sst_file_writer.h include/rocksdb/sst_partitioner.h include/rocksdb/statistics.h include/rocksdb/stats_history.h include/rocksdb/status.h include/rocksdb/system_clock.h include/rocksdb/table.h include/rocksdb/table_properties.h include/rocksdb/table_reader_caller.h include/rocksdb/thread_status.h include/rocksdb/threadpool.h include/rocksdb/trace_reader_writer.h include/rocksdb/trace_record.h include/rocksdb/trace_record_result.h include/rocksdb/transaction_log.h include/rocksdb/types.h include/rocksdb/unique_id.h include/rocksdb/universal_compaction.h include/rocksdb/utilities/agg_merge.h include/rocksdb/utilities/backup_engine.h include/rocksdb/utilities/cache_dump_load.h include/rocksdb/utilities/checkpoint.h include/rocksdb/utilities/convenience.h include/rocksdb/utilities/customizable_util.h include/rocksdb/utilities/db_ttl.h include/rocksdb/utilities/debug.h include/rocksdb/utilities/env_mirror.h include/rocksdb/utilities/info_log_finder.h include/rocksdb/utilities/ldb_cmd.h include/rocksdb/utilities/ldb_cmd_execute_result.h include/rocksdb/utilities/leveldb_options.h include/rocksdb/utilities/lua/rocks_lua_custom_library.h include/rocksdb/utilities/lua/rocks_lua_util.h include/rocksdb/utilities/memory_util.h include/rocksdb/utilities/object_registry.h include/rocksdb/utilities/optimistic_transaction_db.h include/rocksdb/utilities/option_change_migration.h include/rocksdb/utilities/options_type.h include/rocksdb/utilities/options_util.h include/rocksdb/utilities/replayer.h include/rocksdb/utilities/sim_cache.h include/rocksdb/utilities/stackable_db.h include/rocksdb/utilities/table_properties_collectors.h include/rocksdb/utilities/transaction.h include/rocksdb/utilities/transaction_db.h include/rocksdb/utilities/transaction_db_mutex.h include/rocksdb/utilities/write_batch_with_index.h include/rocksdb/version.h include/rocksdb/wal_filter.h include/rocksdb/wide_columns.h include/rocksdb/write_batch.h include/rocksdb/write_batch_base.h include/rocksdb/write_buffer_manager.h lib/librocksdb.a lib/librocksdb.so -lib/librocksdb.so.7 +lib/librocksdb.so.8 lib/librocksdb.so.%%SHLIB_VER%% lib/librocksdb.so.%%PORTVERSION%% lib/librocksdb_tools.so libdata/pkgconfig/rocksdb.pc