Break out executor into its own build target

PiperOrigin-RevId: 257147090
Change-Id: I34c5e86ca68f865fdae42e4077c52c6168672c06
This commit is contained in:
Christian Blichmann 2019-07-09 01:53:31 -07:00 committed by Copybara-Service
parent 747ccb57e8
commit 6d06df1b86
2 changed files with 50 additions and 8 deletions

View File

@ -251,12 +251,32 @@ cc_library(
], ],
) )
cc_library(
name = "executor",
srcs = ["executor.cc"],
hdrs = ["executor.h"],
copts = sapi_platform_copts(),
deps = [
":forkserver",
":forkserver_proto",
":global_forkserver",
":ipc",
":limits",
":namespace",
":util",
"//sandboxed_api/sandbox2/util:fileops",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@org_kernel_libcap//:libcap",
],
)
# Should not be used in sandboxee code if it only uses sandbox2::Comms and # Should not be used in sandboxee code if it only uses sandbox2::Comms and
# sandbox2::Client objects # sandbox2::Client objects
cc_library( cc_library(
name = "sandbox2", name = "sandbox2",
srcs = [ srcs = [
"executor.cc",
"monitor.cc", "monitor.cc",
"monitor.h", "monitor.h",
"policybuilder.cc", "policybuilder.cc",
@ -264,24 +284,24 @@ cc_library(
"stack_trace.cc", "stack_trace.cc",
], ],
hdrs = [ hdrs = [
"client.h",
"executor.h", "executor.h",
"policybuilder.h",
"sandbox2.h",
"stack_trace.h",
# Workaround: reexporting the header files of our dependencies, see b/15420638
"ipc.h", "ipc.h",
"limits.h", "limits.h",
"notify.h", "notify.h",
"policy.h", "policy.h",
"policybuilder.h",
"regs.h", "regs.h",
"result.h", "result.h",
"sandbox2.h",
"stack_trace.h",
"syscall.h", "syscall.h",
"client.h",
], ],
copts = sapi_platform_copts(), copts = sapi_platform_copts(),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":client", ":client",
":executor",
":comms", ":comms",
":violation_proto_cc", ":violation_proto_cc",
":forkserver", ":forkserver",

View File

@ -268,10 +268,31 @@ target_link_libraries(sandbox2_global_forkserver PRIVATE
sapi::raw_logging sapi::raw_logging
) )
# sandboxed_api/sandbox2:sandbox2 # sandboxed_api/sandbox2:executor
add_library(sandbox2_sandbox2 STATIC add_library(sandbox2_executor STATIC
executor.cc executor.cc
executor.h executor.h
)
add_library(sandbox2::executor ALIAS sandbox2_executor)
target_link_libraries(sandbox2_executor PRIVATE
absl::core_headers
absl::memory
absl::strings
glog::glog
libcap::libcap
sandbox2::fileops
sandbox2::forkserver
sandbox2::forkserver_proto
sandbox2::global_forkserver
sandbox2::ipc
sandbox2::limits
sandbox2::namespace
sandbox2::util
sapi::base
)
# sandboxed_api/sandbox2:sandbox2
add_library(sandbox2_sandbox2 STATIC
monitor.cc monitor.cc
monitor.h monitor.h
policybuilder.cc policybuilder.cc
@ -296,6 +317,7 @@ target_link_libraries(sandbox2_sandbox2
sandbox2::bpf_helper sandbox2::bpf_helper
sandbox2::client sandbox2::client
sandbox2::comms sandbox2::comms
sandbox2::executor
sandbox2::file_base sandbox2::file_base
sandbox2::fileops sandbox2::fileops
sandbox2::forkserver sandbox2::forkserver