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<char, std::char_traits<char>, std::allocator<char> >*): 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
This commit is contained in:
anand76 2018-12-05 10:35:56 -08:00 committed by Facebook Github Bot
parent 2f1ca4e838
commit e58d76955a
2 changed files with 7 additions and 7 deletions

12
TARGETS
View File

@ -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

View File

@ -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"))
"""