From 0e12b1d6913dcdae6d7b7e5dc3a075f125b6fe46 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Mon, 1 Nov 2021 10:09:50 -0700 Subject: [PATCH] Update buckify scripts (#9104) Summary: https://github.com/facebook/rocksdb/commit/49af999954c0c130fefdb5f4bafc919c18341521 updates RocksDB buckifier script directly via fbcode. We need to make sure that the following command run in RocksDB repo generate the same TARGETS file. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9104 Test Plan: ``` $python buckifier/buckify_rocksdb.py ``` Verify that TARGETS file does not have uncommitted changes. Reviewed By: jay-zhuang Differential Revision: D32055387 Pulled By: riversand963 fbshipit-source-id: 19cf1b8145095b6df625958458189680e543e3ba --- buckifier/targets_builder.py | 4 ++-- buckifier/targets_cfg.py | 26 +++++++++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/buckifier/targets_builder.py b/buckifier/targets_builder.py index d2649c131..08e866de0 100644 --- a/buckifier/targets_builder.py +++ b/buckifier/targets_builder.py @@ -84,10 +84,10 @@ cpp_binary( name = "c_test_bin", srcs = ["db/c_test.c"], arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, - os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS, - preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, include_paths = ROCKSDB_INCLUDE_PATHS, + os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, + preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, deps = [":rocksdb_test_lib"], ) if not is_opt_mode else None diff --git a/buckifier/targets_cfg.py b/buckifier/targets_cfg.py index 38037b250..a97ef3853 100644 --- a/buckifier/targets_cfg.py +++ b/buckifier/targets_cfg.py @@ -38,7 +38,11 @@ ROCKSDB_EXTERNAL_DEPS = [ ROCKSDB_OS_DEPS_0 = [ ( "linux", - ["third-party//numa:numa", "third-party//liburing:uring", "third-party//tbb:tbb"], + [ + "third-party//numa:numa", + "third-party//liburing:uring", + "third-party//tbb:tbb", + ], ), ( "macos", @@ -76,7 +80,13 @@ ROCKSDB_OS_PREPROCESSOR_FLAGS_0 = [ ), ( "windows", - [ "-DOS_WIN", "-DWIN32", "-D_MBCS", "-DWIN64", "-DNOMINMAX" ] + [ + "-DOS_WIN", + "-DWIN32", + "-D_MBCS", + "-DWIN64", + "-DNOMINMAX", + ], ), ] @@ -144,13 +154,14 @@ cpp_library( {headers_attr_prefix}headers = {headers}, arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS, + include_paths = ROCKSDB_INCLUDE_PATHS, + link_whole = {link_whole}, os_deps = ROCKSDB_OS_DEPS, os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, - include_paths = ROCKSDB_INCLUDE_PATHS, + unexported_deps_by_default = False, deps = [{deps}], external_deps = ROCKSDB_EXTERNAL_DEPS{extra_external_deps}, - link_whole = {link_whole}, ) """ @@ -161,10 +172,11 @@ cpp_library( {headers_attr_prefix}headers = {headers}, arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS, + include_paths = ROCKSDB_INCLUDE_PATHS, os_deps = ROCKSDB_OS_DEPS, os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, - include_paths = ROCKSDB_INCLUDE_PATHS, + unexported_deps_by_default = False, deps = ROCKSDB_LIB_DEPS, external_deps = ROCKSDB_EXTERNAL_DEPS, ) @@ -205,10 +217,10 @@ ROCKS_TESTS = [ name = test_name, srcs = [test_cc], arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, - os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS + extra_compiler_flags, - preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, include_paths = ROCKSDB_INCLUDE_PATHS, + os_preprocessor_flags = ROCKSDB_OS_PREPROCESSOR_FLAGS, + preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, deps = [":rocksdb_test_lib"] + extra_deps, external_deps = ROCKSDB_EXTERNAL_DEPS + [ ("googletest", None, "gtest"),