diff --git a/centipede/BUILD b/centipede/BUILD index 1000d7f1..6cb746af 100644 --- a/centipede/BUILD +++ b/centipede/BUILD @@ -31,6 +31,11 @@ package(default_visibility = DEFAULT_VISIBILITY) licenses(["notice"]) +exports_files([ + "centipede_main.cc", + "seed_corpus_maker.cc", +]) + ################################################################################ # Binaries ################################################################################ @@ -38,6 +43,7 @@ licenses(["notice"]) cc_binary( name = "centipede", srcs = ["centipede_main.cc"], + compatible_with = [], deps = [ ":centipede_callbacks", ":centipede_default_callbacks", @@ -52,41 +58,10 @@ cc_binary( cc_uninstrumented_binary( name = "centipede_uninstrumented", binary = ":centipede", + compatible_with = [], ) # A standalone seed corpus generator. -cc_binary( - name = "seed_corpus_maker", - srcs = ["seed_corpus_maker.cc"], - deps = [ - ":config_init", - ":seed_corpus_maker_flags", - ":seed_corpus_maker_proto_lib", - ":util", - "@abseil-cpp//absl/base:nullability", - "@abseil-cpp//absl/flags:flag", - "@com_google_fuzztest//common:logging", - "@com_google_fuzztest//common:remote_file", - ], -) - -cc_binary( - name = "blob_file_converter", - srcs = ["blob_file_converter.cc"], - deps = [ - ":config_init", - ":rusage_profiler", - "@abseil-cpp//absl/base:nullability", - "@abseil-cpp//absl/flags:flag", - "@abseil-cpp//absl/status", - "@abseil-cpp//absl/strings:str_format", - "@abseil-cpp//absl/time", - "@com_google_fuzztest//common:blob_file", - "@com_google_fuzztest//common:defs", - "@com_google_fuzztest//common:logging", - "@com_google_fuzztest//common:remote_file", - ], -) ############################################################################### # Proto libraries diff --git a/common/BUILD b/common/BUILD index d64c4809..9b1a6557 100644 --- a/common/BUILD +++ b/common/BUILD @@ -14,7 +14,6 @@ # The package contains libraries that are common to both FuzzTest and Centipede. -load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_cc//cc:cc_test.bzl", "cc_test") DEFAULT_VISIBILITY = ["//visibility:public"] @@ -126,23 +125,21 @@ cc_library( "//conditions:default": [], }), deps = [ - ":defs", - ":logging", - ":status_macros", - "@abseil-cpp//absl/base:nullability", - "@abseil-cpp//absl/status", - "@abseil-cpp//absl/status:statusor", - "@abseil-cpp//absl/strings", - ] + select({ - "//conditions:default": [":remote_file_oss"], - }) + - select({ - "@com_google_fuzztest//fuzztest:disable_riegeli": [], - "//conditions:default": [ - "@com_google_riegeli//riegeli/bytes:reader", - "@com_google_riegeli//riegeli/bytes:writer", - ], - }), + ":defs", + ":logging", + ":remote_file_oss", + ":status_macros", + "@abseil-cpp//absl/base:nullability", + "@abseil-cpp//absl/status", + "@abseil-cpp//absl/status:statusor", + "@abseil-cpp//absl/strings", + ] + select({ + "@com_google_fuzztest//fuzztest:disable_riegeli": [], + "//conditions:default": [ + "@com_google_riegeli//riegeli/bytes:reader", + "@com_google_riegeli//riegeli/bytes:writer", + ], + }), ) cc_library( @@ -155,7 +152,6 @@ cc_library( "@com_google_fuzztest//fuzztest:disable_riegeli": ["CENTIPEDE_DISABLE_RIEGELI"], "//conditions:default": [], }), - visibility = ["//visibility:private"], deps = [ ":defs", ":logging", @@ -253,13 +249,11 @@ cc_test( ) # TODO(b/324462306): Merge this with remote_file_test once the bug is fixed. -cc_library( - name = "remote_file_test_lib", - testonly = True, +exports_files(["remote_file_test.cc"]) + +cc_test( + name = "remote_file_test", srcs = ["remote_file_test.cc"], - defines = select({ - "//conditions:default": [], - }), deps = [ ":logging", ":remote_file", @@ -267,16 +261,6 @@ cc_library( "@abseil-cpp//absl/status", "@abseil-cpp//absl/time", "@googletest//:gtest", - ] + select({ - "//conditions:default": [], - }), - alwayslink = True, -) - -cc_test( - name = "remote_file_test", - deps = [ - ":remote_file_test_lib", "@googletest//:gtest_main", ], ) diff --git a/fuzztest/internal/BUILD b/fuzztest/internal/BUILD index f5155910..eb96fe73 100644 --- a/fuzztest/internal/BUILD +++ b/fuzztest/internal/BUILD @@ -110,6 +110,55 @@ cc_library( ], ) +cc_library( + name = "centipede_adaptor_hermetic", + srcs = ["centipede_adaptor.cc"], + hdrs = ["centipede_adaptor.h"], + defines = ["FUZZTEST_USE_CENTIPEDE"], + deps = [ + ":any", + ":configuration", + ":escaping", + ":fixture_driver", + ":flag_name", + ":io_hermetic", + ":logging", + ":runtime", + ":serialization", + ":subprocess", + ":table_of_recent_compares", + "@abseil-cpp//absl/algorithm:container", + "@abseil-cpp//absl/base:no_destructor", + "@abseil-cpp//absl/cleanup", + "@abseil-cpp//absl/functional:any_invocable", + "@abseil-cpp//absl/memory", + "@abseil-cpp//absl/random", + "@abseil-cpp//absl/random:distributions", + "@abseil-cpp//absl/status", + "@abseil-cpp//absl/status:statusor", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/strings:str_format", + "@abseil-cpp//absl/strings:string_view", + "@abseil-cpp//absl/time", + "@abseil-cpp//absl/types:span", + "@com_google_fuzztest//centipede:centipede_callbacks", + "@com_google_fuzztest//centipede:centipede_default_callbacks", + "@com_google_fuzztest//centipede:centipede_interface", + "@com_google_fuzztest//centipede:centipede_runner_no_main", + "@com_google_fuzztest//centipede:environment", + "@com_google_fuzztest//centipede:fuzztest_mutator", + "@com_google_fuzztest//centipede:mutation_data", + "@com_google_fuzztest//centipede:runner_result", + "@com_google_fuzztest//centipede:stop", + "@com_google_fuzztest//centipede:workdir", + "@com_google_fuzztest//common:defs", + "@com_google_fuzztest//common:logging", + "@com_google_fuzztest//common:remote_file_oss", + "@com_google_fuzztest//common:temp_dir", + "@com_google_fuzztest//fuzztest/internal/domains:core_domains_impl", + ], +) + cc_library( name = "compatibility_mode", srcs = ["compatibility_mode.cc"], @@ -272,9 +321,27 @@ cc_library( "@com_google_fuzztest//common:defs", "@com_google_fuzztest//common:logging", "@com_google_fuzztest//common:remote_file", - ] + select({ - "//conditions:default": [], - }), + ], +) + +cc_library( + name = "io_hermetic", + srcs = ["io.cc"], + hdrs = ["io.h"], + deps = [ + ":logging", + "@abseil-cpp//absl/functional:function_ref", + "@abseil-cpp//absl/hash", + "@abseil-cpp//absl/status", + "@abseil-cpp//absl/strings:str_format", + "@abseil-cpp//absl/strings:string_view", + "@abseil-cpp//absl/time", + "@abseil-cpp//absl/types:span", + "@com_google_fuzztest//common:blob_file", + "@com_google_fuzztest//common:defs", + "@com_google_fuzztest//common:logging", + "@com_google_fuzztest//common:remote_file_oss", + ], ) cc_test(