| # Copyright 2024 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/assembly/bootfs_files_for_assembly.gni") |
| import("//build/dist/renamed_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| # `package` is conceptually a binary, but it is built as a lib here so it can be |
| # aggregated into //src/sys/tools/shared-multi-call-tool-binary to save disk space. |
| rustc_library("package") { |
| visibility = [ |
| ":*", |
| "../shared-multi-call-tool-binary:*", |
| ] |
| edition = "2021" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.dash:fuchsia.dash_rust", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-component", |
| "//src/sys/lib/socket-to-stdio", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| # The package tool is only used for debugging. |
| deps += [ "//build/validate:non_production_tag" ] |
| |
| # This is a part of the bootfs image, so attempt to minimize its size impact. |
| configs += [ "//build/config/rust:bootfs" ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/lib.rs", |
| ] |
| } |
| |
| renamed_binary("package-binary") { |
| source = "$root_out_dir/shared-multi-call-tool-binary" |
| source_deps = [ "//src/sys/tools/shared-multi-call-tool-binary" ] |
| dest = "bin/package" |
| } |
| |
| bootfs_files_for_assembly("bootfs") { |
| deps = [ ":package-binary" ] |
| } |