Files
netris-cdc-file-transfer/cdc_rsync/BUILD
Christian Schneider 4326e972ac Releasing the former Stadia file transfer tools
The tools allow efficient and fast synchronization of large directory
trees from a Windows workstation to a Linux target machine.

cdc_rsync* support efficient copy of files by using content-defined
chunking (CDC) to identify chunks within files that can be reused.

asset_stream_manager + cdc_fuse_fs support efficient streaming of a
local directory to a remote virtual file system based on FUSE. It also
employs CDC to identify and reuse unchanged data chunks.
2022-11-03 10:39:10 +01:00

192 lines
4.6 KiB
Python

load(
"//tools:windows_cc_library.bzl",
"cc_windows_shared_library",
)
package(default_visibility = [
"//:__subpackages__",
])
cc_library(
name = "client_file_info",
hdrs = ["client_file_info.h"],
)
cc_library(
name = "client_socket",
srcs = ["client_socket.cc"],
hdrs = ["client_socket.h"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
"//cdc_rsync/base:socket",
"//common:log",
"//common:status",
"//common:util",
],
)
cc_library(
name = "file_finder_and_sender",
srcs = ["file_finder_and_sender.cc"],
hdrs = ["file_finder_and_sender.h"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
":client_file_info",
"//cdc_rsync/base:message_pump",
"//cdc_rsync/protos:messages_cc_proto",
"//common:log",
"//common:path",
"//common:path_filter",
"//common:platform",
"//common:util",
],
)
cc_test(
name = "file_finder_and_sender_test",
srcs = ["file_finder_and_sender_test.cc"],
data = ["testdata/root.txt"] + glob(["testdata/file_finder_and_sender/**"]),
deps = [
":file_finder_and_sender",
"//cdc_rsync/base:fake_socket",
"//cdc_rsync/protos:messages_cc_proto",
"//common:status_test_macros",
"//common:test_main",
"@com_google_googletest//:gtest",
"@com_google_protobuf//:protobuf_lite",
],
)
cc_windows_shared_library(
name = "cdc_rsync",
srcs = [
"cdc_rsync.cc",
"cdc_rsync_client.cc",
"dllmain.cc",
],
hdrs = [
"cdc_rsync.h",
"cdc_rsync_client.h",
"error_messages.h",
],
linkopts = select({
"//tools:windows": [
"/DEFAULTLIB:Ws2_32.lib", # Sockets, e.g. recv, send, WSA*.
],
"//conditions:default": [],
}),
local_defines = ["COMPILING_DLL"],
target_compatible_with = ["@platforms//os:windows"],
deps = [
":client_socket",
":file_finder_and_sender",
":parallel_file_opener",
":progress_tracker",
":zstd_stream",
"//cdc_rsync/base:cdc_interface",
"//cdc_rsync/base:message_pump",
"//cdc_rsync/base:server_exit_code",
"//cdc_rsync/base:socket",
"//cdc_rsync/protos:messages_cc_proto",
"//common:gamelet_component",
"//common:log",
"//common:path",
"//common:path_filter",
"//common:platform",
"//common:port_manager",
"//common:process",
"//common:remote_util",
"//common:sdk_util",
"//common:status",
"//common:status_macros",
"//common:threadpool",
"//common:util",
"@com_google_absl//absl/status",
],
)
cc_library(
name = "parallel_file_opener",
srcs = ["parallel_file_opener.cc"],
hdrs = ["parallel_file_opener.h"],
data = ["testdata/root.txt"] + glob(["testdata/parallel_file_opener/**"]),
deps = [
":client_file_info",
"//common:path",
"//common:platform",
"//common:threadpool",
],
)
cc_test(
name = "parallel_file_opener_test",
srcs = ["parallel_file_opener_test.cc"],
deps = [
":parallel_file_opener",
"//common:test_main",
"@com_google_googletest//:gtest",
],
)
cc_library(
name = "progress_tracker",
srcs = ["progress_tracker.cc"],
hdrs = ["progress_tracker.h"],
deps = [
":file_finder_and_sender",
"//cdc_rsync/base:cdc_interface",
"//common:stopwatch",
"@com_github_jsoncpp//:jsoncpp",
"@com_google_absl//absl/strings:str_format",
],
)
cc_test(
name = "progress_tracker_test",
srcs = ["progress_tracker_test.cc"],
deps = [
":progress_tracker",
"//cdc_rsync/protos:messages_cc_proto",
"//common:test_main",
"//common:testing_clock",
"@com_google_googletest//:gtest",
],
)
cc_library(
name = "zstd_stream",
srcs = ["zstd_stream.cc"],
hdrs = ["zstd_stream.h"],
deps = [
":client_socket",
"//common:buffer",
"//common:status",
"//common:status_macros",
"//common:stopwatch",
"@com_github_zstd//:zstd",
],
)
cc_test(
name = "zstd_stream_test",
srcs = ["zstd_stream_test.cc"],
deps = [
":zstd_stream",
"//cdc_rsync/base:fake_socket",
"//cdc_rsync_server:unzstd_stream",
"//common:status_test_macros",
"//common:test_main",
"@com_github_zstd//:zstd",
],
)
filegroup(
name = "all_test_sources",
srcs = glob(["*_test.cc"]),
)
filegroup(
name = "all_test_data",
srcs = glob(["testdata/**"]),
)