| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| import("//build/config.gni") |
| import("//build/fuzzing/fuzzer.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_fuzzer.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_library("lib") { |
| name = "archivist_lib" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "fidl:controller-rustc", |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.diagnostics.stream:fuchsia.diagnostics.stream-rustc", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated-rustc", |
| "//sdk/fidl/fuchsia.sys.internal:fuchsia.sys.internal-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/diagnostics/lib/inspect-fidl-load", |
| "//src/diagnostics/lib/selectors", |
| "//src/diagnostics/lib/validating-log-listener", |
| "//src/diagnostics/streams:lib", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/inspect/rust/fuchsia-inspect", |
| "//src/lib/inspect/rust/fuchsia-inspect-contrib", |
| "//src/lib/inspect/rust/fuchsia-inspect-derive", |
| "//src/lib/inspect/rust/fuchsia-inspect-node-hierarchy", |
| "//src/lib/storage/fuchsia-watch", |
| "//src/lib/storage/vfs/rust:vfs", |
| "//src/lib/syslog/rust:syslog-listener", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:byteorder", |
| "//third_party/rust_crates:chrono", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:itertools", |
| "//third_party/rust_crates:json5", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:parking_lot", |
| "//third_party/rust_crates:paste", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| "//zircon/system/fidl/fuchsia-logger:fuchsia-logger-rustc", |
| "//zircon/system/fidl/fuchsia-mem:fuchsia-mem-rustc", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "archivist" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.sys.internal:fuchsia.sys.internal-rustc", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc", |
| "//src/diagnostics/lib/selectors", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:thiserror", |
| "//zircon/system/fidl/fuchsia-io:fuchsia-io-rustc", |
| ] |
| } |
| |
| package("archivist") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "archivist" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/archivist.cmx") |
| dest = "archivist.cmx" |
| }, |
| { |
| path = rebase_path("meta/observer.cmx") |
| dest = "observer.cmx" |
| }, |
| ] |
| } |
| |
| config_data("archivist_config") { |
| for_pkg = "archivist" |
| outputs = [ "archivist_config.json" ] |
| |
| sources = [ "configs/archivist_config.json" ] |
| } |
| |
| config_data("observer_config") { |
| for_pkg = "archivist" |
| outputs = [ "observer_config.json" ] |
| |
| sources = [ "configs/observer_config.json" ] |
| } |
| |
| config_data("archivist_startup") { |
| for_pkg = "sysmgr" |
| outputs = [ "archivist.config" ] |
| |
| sources = [ "configs/sysmgr_config.json" ] |
| } |
| |
| group("with_default_config") { |
| deps = [ |
| ":archivist", |
| ":archivist_config", |
| ":archivist_startup", |
| ":observer_config", |
| ] |
| } |
| |
| rustc_fuzzer("convert_debuglog_to_log_message_fuzzer") { |
| deps = [ |
| ":lib", |
| "//src/lib/fuzzing/rust:fuzz", |
| "//src/lib/syslog/rust:syslog", |
| ] |
| source_root = "src/fuzzer.rs" |
| } |
| |
| fuzzers_package("archivist-fuzzers") { |
| rust_fuzzers = [ ":convert_debuglog_to_log_message_fuzzer" ] |
| } |
| |
| test_package("archivist_tests") { |
| deps = [ ":lib_test" ] |
| |
| tests = [ |
| { |
| name = "archivist_lib_lib_test" |
| dest = "archivist_tests" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":archivist-fuzzers", |
| ":archivist_tests", |
| "tests", |
| ] |
| } |