| # Copyright 2021 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/rust/rustc_binary.gni") | 
 | import("//build/rust/rustc_library.gni") | 
 |  | 
 | rustc_library("lib") { | 
 |   name = "inspect_runtime" | 
 |   version = "0.1.0" | 
 |   edition = "2021" | 
 |   with_unit_tests = true | 
 |  | 
 |   # Restrict visibility to local targets. Clients looking to use the inspect_runtime library | 
 |   # should depend on `:rust` or, in rare circumstances, `:unchecked_includes`. | 
 |   visibility = [ ":*" ] | 
 |  | 
 |   deps = [ | 
 |     "//sdk/fidl/fuchsia.inspect:fuchsia.inspect_rust", | 
 |     "//sdk/fidl/fuchsia.io:fuchsia.io_rust", | 
 |     "//sdk/fidl/fuchsia.mem:fuchsia.mem_rust", | 
 |     "//src/lib/diagnostics/inspect/rust", | 
 |     "//src/lib/fidl/rust/fidl", | 
 |     "//src/lib/fuchsia-async", | 
 |     "//src/lib/fuchsia-component", | 
 |     "//src/lib/zircon/rust:fuchsia-zircon", | 
 |     "//src/storage/lib/vfs/rust:vfs", | 
 |     "//third_party/rust_crates:anyhow", | 
 |     "//third_party/rust_crates:futures", | 
 |     "//third_party/rust_crates:tracing", | 
 |   ] | 
 |  | 
 |   test_deps = [ | 
 |     "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_rust", | 
 |     "//src/lib/diagnostics/reader/rust", | 
 |     "//src/lib/diagnostics/testing/diagnostics-assertions/rust:diagnostics-assertions", | 
 |     "//src/lib/fuchsia", | 
 |     "//src/lib/fuchsia-async", | 
 |     "//src/lib/fuchsia-component-test", | 
 |     "//src/lib/fuchsia-fs", | 
 |     "//src/sys/lib/component_debug", | 
 |     "//third_party/rust_crates:assert_matches", | 
 |  | 
 |     # TODO(https://fxbug.dev/81400): Remove this dep during post-migration cleanup. | 
 |     "//src/sys/lib/component-events", | 
 |   ] | 
 |  | 
 |   sources = [ | 
 |     "src/lib.rs", | 
 |     "src/service.rs", | 
 |   ] | 
 | } | 
 |  | 
 | fuchsia_unittest_package("inspect-runtime-tests") { | 
 |   manifest = "meta/inspect_runtime_lib_test.cml" | 
 |   deps = [ | 
 |     ":inspect_test_component", | 
 |     ":inspect_test_component_serve_fn", | 
 |     ":lib_test", | 
 |   ] | 
 | } | 
 |  | 
 | rustc_binary("inspect_test_component_bin") { | 
 |   testonly = true | 
 |   edition = "2021" | 
 |   source_root = "test/main.rs" | 
 |  | 
 |   deps = [ | 
 |     "//src/lib/diagnostics/inspect/runtime/rust", | 
 |     "//src/lib/diagnostics/inspect/rust", | 
 |     "//src/lib/fuchsia", | 
 |     "//src/lib/fuchsia-component", | 
 |     "//third_party/rust_crates:futures", | 
 |   ] | 
 |  | 
 |   sources = [ "test/main.rs" ] | 
 | } | 
 |  | 
 | fuchsia_component("inspect_test_component") { | 
 |   testonly = true | 
 |   deps = [ ":inspect_test_component_bin" ] | 
 |   manifest = "meta/inspect_test_component.cml" | 
 | } | 
 |  | 
 | fuchsia_component("inspect_test_component_serve_fn") { | 
 |   testonly = true | 
 |   deps = [ ":inspect_test_component_bin" ] | 
 |   manifest = "meta/inspect_test_component_serve_fn.cml" | 
 | } | 
 |  | 
 | group("tests") { | 
 |   testonly = true | 
 |   deps = [ ":inspect-runtime-tests" ] | 
 | } | 
 |  | 
 | group("rust") { | 
 |   public_deps = [ | 
 |     ":lib", | 
 |     "//sdk/lib/inspect:client_includes", | 
 |   ] | 
 | } | 
 |  | 
 | group("unchecked_includes") { | 
 |   public_deps = [ ":lib" ] | 
 | } |