| # 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/components.gni") |
| import("//build/config.gni") |
| import("//build/fuzz.gni") |
| import("//build/images/filesystem_limits.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_fuzzer.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//src/diagnostics/archivist/build/archivist.gni") |
| import("//src/diagnostics/archivist/configs.gni") |
| import("//tools/fidl/measure-tape/measure_tape.gni") |
| |
| measure_tape("logmessage_measure_tape") { |
| target_binding = "rust" |
| target_types = [ "fuchsia.logger/LogMessage" ] |
| fidls = [ "//sdk/fidl/fuchsia.logger" ] |
| } |
| |
| rustc_library("lib") { |
| name = "archivist_lib" |
| with_unit_tests = true |
| edition = "2021" |
| |
| visibility = [ |
| "//src/diagnostics/archivist/*", |
| "//src/diagnostics/launcher/*", |
| ] |
| |
| deps = [ |
| ":archivist-config", |
| ":logmessage_measure_tape", |
| "//sdk/fidl/fuchsia.boot:fuchsia.boot_rust", |
| "//sdk/fidl/fuchsia.component:fuchsia.component_rust", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust", |
| "//sdk/fidl/fuchsia.diagnostics.host:fuchsia.diagnostics.host_rust", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated_rust", |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_rust", |
| "//sdk/fidl/fuchsia.process.lifecycle:fuchsia.process.lifecycle_rust", |
| "//sdk/fidl/fuchsia.sys.internal:fuchsia.sys.internal_rust", |
| "//src/diagnostics/lib/inspect-fidl-load", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/hierarchy/rust", |
| "//src/lib/diagnostics/inspect/contrib/rust", |
| "//src/lib/diagnostics/inspect/derive", |
| "//src/lib/diagnostics/inspect/format/rust", |
| "//src/lib/diagnostics/inspect/runtime/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/log/message/rust", |
| "//src/lib/diagnostics/selectors", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fidl_table_validation", |
| "//src/lib/flyweights", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-fs", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/trace/rust:trace", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/lib/zircon/rust:fuchsia-zircon-status", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:async-lock", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:derivative", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:pin-project", |
| "//third_party/rust_crates:pin-utils", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_cbor", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:thiserror", |
| "//third_party/rust_crates:tracing", |
| ] |
| |
| test_deps = [ |
| "//src/diagnostics/lib/validating-log-listener", |
| "//src/lib/diagnostics/log/encoding/rust", |
| "//src/lib/fuchsia", |
| "//src/lib/syslog/rust:syslog-listener", |
| "//third_party/rust_crates:assert_matches", |
| "//third_party/rust_crates:libc", |
| "//third_party/rust_crates:tempfile", |
| ] |
| |
| sources = [ |
| "src/accessor.rs", |
| "src/archivist.rs", |
| "src/component_lifecycle.rs", |
| "src/configs.rs", |
| "src/constants.rs", |
| "src/diagnostics.rs", |
| "src/error.rs", |
| "src/events/error.rs", |
| "src/events/mod.rs", |
| "src/events/router.rs", |
| "src/events/sources/event_source.rs", |
| "src/events/sources/legacy.rs", |
| "src/events/sources/log_connector.rs", |
| "src/events/sources/mod.rs", |
| "src/events/sources/unattributed_inspect_sink.rs", |
| "src/events/sources/unattributed_log_sink.rs", |
| "src/events/types.rs", |
| "src/formatter.rs", |
| "src/identity.rs", |
| "src/inspect/collector.rs", |
| "src/inspect/container.rs", |
| "src/inspect/mod.rs", |
| "src/inspect/repository.rs", |
| "src/inspect/servers/inspect_sink.rs", |
| "src/inspect/servers/mod.rs", |
| "src/lib.rs", |
| "src/logs/budget.rs", |
| "src/logs/buffer.rs", |
| "src/logs/buffer/arc_list.rs", |
| "src/logs/container.rs", |
| "src/logs/debuglog.rs", |
| "src/logs/error.rs", |
| "src/logs/listener.rs", |
| "src/logs/listener/filter.rs", |
| "src/logs/mod.rs", |
| "src/logs/multiplex.rs", |
| "src/logs/repository.rs", |
| "src/logs/servers/log.rs", |
| "src/logs/servers/log_settings.rs", |
| "src/logs/servers/mod.rs", |
| "src/logs/socket.rs", |
| "src/logs/stats.rs", |
| "src/logs/stored_message.rs", |
| "src/logs/testing.rs", |
| "src/moniker_rewriter.rs", |
| "src/pipeline.rs", |
| "src/testing.rs", |
| "src/trie.rs", |
| "src/utils.rs", |
| ] |
| } |
| |
| archivist_optimized_binary("bin") { |
| name = "archivist" |
| with_unit_tests = true |
| edition = "2021" |
| |
| deps = [ |
| ":archivist-config", |
| ":lib", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/log/rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/trace/rust:trace-provider", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//src/sys/lib/stdout-to-debuglog/rust", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:tracing", |
| "//third_party/rust_crates:tracing-subscriber", |
| ] |
| |
| test_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_rust", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_rust", |
| "//sdk/fidl/fuchsia.sys.internal:fuchsia.sys.internal_rust", |
| "//src/lib/diagnostics/selectors", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ "src/main.rs" ] |
| } |
| |
| fuchsia_component_manifest("root-manifest") { |
| manifest = "meta/archivist.cml" |
| component_name = "archivist" |
| } |
| |
| fuchsia_component("component") { |
| cm_label = ":root-manifest" |
| deps = [ ":bin" ] |
| |
| # console uses the boot log. |
| # The includes checker wants the syslog shard because console gets the |
| # injected dep on the legacy syslog backend. |
| check_includes = false |
| } |
| |
| fuchsia_component_manifest("archivist-for-embedding-v2-manifest") { |
| manifest = "meta/archivist-for-embedding.cml" |
| component_name = "archivist-for-embedding" |
| } |
| |
| fuchsia_component_manifest("archivist-without-attribution-manifest") { |
| manifest = "meta/archivist-without-attribution.cml" |
| component_name = "archivist-without-attribution" |
| } |
| |
| fuchsia_component("archivist-for-embedding-v2-component") { |
| cm_label = ":archivist-for-embedding-v2-manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_component("archivist-without-attribution-component") { |
| cm_label = ":archivist-without-attribution-manifest" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_structured_config_values("without-attribution-config") { |
| cm_label = ":archivist-without-attribution-manifest" |
| values = without_attribution_config |
| } |
| |
| fuchsia_structured_config_values("archivist-embedded-config") { |
| cm_label = ":archivist-for-embedding-v2-manifest" |
| values = embedded_config |
| } |
| |
| fuchsia_structured_config_rust_lib("archivist-config") { |
| cm_label = ":root-manifest" |
| } |
| |
| group("archivist-for-embedding-v2") { |
| deps = [ |
| ":archivist-embedded-config", |
| ":archivist-for-embedding-v2-component", |
| ] |
| } |
| |
| fuchsia_package("package") { |
| package_name = "archivist" |
| deps = [ ":component" ] |
| } |
| |
| fuchsia_package("archivist-without-attribution") { |
| deps = [ |
| ":archivist-without-attribution-component", |
| ":without-attribution-config", |
| ] |
| } |
| |
| fuchsia_package("archivist-for-embedding") { |
| visibility = [ |
| "//bundles/buildbot/*", |
| "//sdk/bundles:core-tools", |
| ] |
| deps = [ ":archivist-for-embedding-v2" ] |
| } |
| |
| rustc_fuzzer("convert_debuglog_to_log_message_fuzzer") { |
| edition = "2021" |
| deps = [ |
| ":lib", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/fuzzing/rust:fuzz", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:arbitrary", |
| ] |
| |
| source_root = "src/fuzzer.rs" |
| |
| sources = [ "src/fuzzer.rs" ] |
| } |
| |
| fuchsia_fuzzer_component("convert-debuglog-to-log-message-fuzzer-component") { |
| manifest = "meta/convert_debuglog_to_log_message_fuzzer.cml" |
| deps = [ ":convert_debuglog_to_log_message_fuzzer" ] |
| } |
| |
| fuchsia_fuzzer_package("archivist-fuzzers") { |
| rust_fuzzer_components = |
| [ ":convert-debuglog-to-log-message-fuzzer-component" ] |
| } |
| |
| fuchsia_unittest_component("archivist-unittests") { |
| manifest = "meta/archivist-unittests.cml" |
| deps = [ ":lib_test" ] |
| } |
| |
| fuchsia_test_package("archivist-tests") { |
| test_components = [ ":archivist-unittests" ] |
| } |
| |
| group("archivist") { |
| testonly = true |
| deps = [ |
| ":package", |
| ":tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":archivist-fuzzers", |
| ":archivist-tests", |
| "build/scripts:tests", |
| "tests", |
| ] |
| } |
| |
| group("benchmarks") { |
| testonly = true |
| public_deps = [ "bench" ] |
| } |