Exclude c_test from buck build opt mode (#7093)

Summary:
Fix a Facebook internal build

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7093

Test Plan:
buck build mode/opt :c_test :c_test_bin (was compilation
failure, now "not found")
buck build mode/dev :c_test :c_test_bin (still passes)

Reviewed By: ajkr

Differential Revision: D22412528

Pulled By: pdillinger

fbshipit-source-id: 8e55c43dbf95386597e4cc690c41d9cbdcee03aa
main
Peter Dillinger 5 years ago committed by Facebook GitHub Bot
parent 92731b6b4a
commit dbf5c55812
  1. 10
      TARGETS
  2. 10
      buckifier/targets_builder.py

@ -449,7 +449,8 @@ cpp_library(
external_deps = ROCKSDB_EXTERNAL_DEPS, external_deps = ROCKSDB_EXTERNAL_DEPS,
) )
cpp_binary( if not is_opt_mode:
cpp_binary(
name = "c_test_bin", name = "c_test_bin",
srcs = ["db/c_test.c"], srcs = ["db/c_test.c"],
arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
@ -457,16 +458,17 @@ cpp_binary(
compiler_flags = ROCKSDB_COMPILER_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS,
preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
deps = [":rocksdb_test_lib"], deps = [":rocksdb_test_lib"],
) )
custom_unittest( if not is_opt_mode:
custom_unittest(
"c_test", "c_test",
command = [ command = [
native.package_name() + "/buckifier/rocks_test_runner.sh", native.package_name() + "/buckifier/rocks_test_runner.sh",
"$(location :{})".format("c_test_bin"), "$(location :{})".format("c_test_bin"),
], ],
type = "simple", type = "simple",
) )
cpp_library( cpp_library(
name = "env_basic_test_lib", name = "env_basic_test_lib",

@ -78,7 +78,8 @@ class TARGETSBuilder(object):
def add_c_test(self): def add_c_test(self):
self.targets_file.write(""" self.targets_file.write("""
cpp_binary( if not is_opt_mode:
cpp_binary(
name = "c_test_bin", name = "c_test_bin",
srcs = ["db/c_test.c"], srcs = ["db/c_test.c"],
arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS, arch_preprocessor_flags = ROCKSDB_ARCH_PREPROCESSOR_FLAGS,
@ -86,16 +87,17 @@ cpp_binary(
compiler_flags = ROCKSDB_COMPILER_FLAGS, compiler_flags = ROCKSDB_COMPILER_FLAGS,
preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS, preprocessor_flags = ROCKSDB_PREPROCESSOR_FLAGS,
deps = [":rocksdb_test_lib"], deps = [":rocksdb_test_lib"],
) )
custom_unittest( if not is_opt_mode:
custom_unittest(
"c_test", "c_test",
command = [ command = [
native.package_name() + "/buckifier/rocks_test_runner.sh", native.package_name() + "/buckifier/rocks_test_runner.sh",
"$(location :{})".format("c_test_bin"), "$(location :{})".format("c_test_bin"),
], ],
type = "simple", type = "simple",
) )
""") """)
def register_test(self, def register_test(self,

Loading…
Cancel
Save