From e58d76955a649c0cb60e0f5a6fab90a44d9b2c1a Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 5 Dec 2018 10:35:56 -0800 Subject: [PATCH] Fix buck dev mode fbcode builds (#4747) Summary: Don't enable ROCKSDB_JEMALLOC unless the build mode is opt and default allocator is jemalloc. In dev mode, this is causing compile/link errors such as - ``` stderr: buck-out/dev/gen/rocksdb/src/rocksdb_lib#compile-pic-malloc_stats.cc.o4768b59e,gcc-5-glibc-2.23-clang/db/malloc_stats.cc.o:malloc_stats.cc:function rocksdb::DumpMallocStats(std::__cxx11::basic_string, std::allocator >*): error: undefined reference to 'malloc_stats_print' clang-7.0: error: linker command failed with exit code 1 ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/4747 Differential Revision: D13324840 Pulled By: anand1976 fbshipit-source-id: 45ffbd4f63fe4d9e8a0473d8f066155e4ef64a14 --- TARGETS | 12 ++++++------ buckifier/targets_cfg.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TARGETS b/TARGETS index 681ea1cbc..246c2efee 100644 --- a/TARGETS +++ b/TARGETS @@ -73,7 +73,7 @@ sanitizer = read_config("fbcode", "sanitizer") # Let RocksDB aware of jemalloc existence. # Do not enable it if sanitizer presents. -if default_allocator.startswith("jemalloc") and sanitizer == "": +if is_opt_mode and default_allocator.startswith("jemalloc") and sanitizer == "": rocksdb_compiler_flags.append("-DROCKSDB_JEMALLOC") rocksdb_external_deps.append(("jemalloc", None, "headers")) @@ -990,6 +990,11 @@ ROCKS_TESTS = [ "tools/sst_dump_test.cc", "serial", ], + [ + "sst_file_reader_test", + "table/sst_file_reader_test.cc", + "serial", + ], [ "statistics_test", "monitoring/statistics_test.cc", @@ -1100,11 +1105,6 @@ ROCKS_TESTS = [ "utilities/transactions/write_unprepared_transaction_test.cc", "parallel", ], - [ - "sst_file_reader_test", - "table/sst_file_reader_test.cc", - "serial", - ], ] # Generate a test rule for each entry in ROCKS_TESTS diff --git a/buckifier/targets_cfg.py b/buckifier/targets_cfg.py index 80359f770..5378f697a 100644 --- a/buckifier/targets_cfg.py +++ b/buckifier/targets_cfg.py @@ -77,7 +77,7 @@ sanitizer = read_config("fbcode", "sanitizer") # Let RocksDB aware of jemalloc existence. # Do not enable it if sanitizer presents. -if default_allocator.startswith("jemalloc") and sanitizer == "": +if is_opt_mode and default_allocator.startswith("jemalloc") and sanitizer == "": rocksdb_compiler_flags.append("-DROCKSDB_JEMALLOC") rocksdb_external_deps.append(("jemalloc", None, "headers")) """