| # Copyright 2025 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/bazel/bazel_inputs.gni") |
| import("//build/host.gni") |
| import("//build/rust/rustc_binary.gni") |
| |
| assert(is_host, "Assembly libraries are host-only") |
| |
| declare_args() { |
| # If true, components that have an experimental dso version enabled |
| # (//src/sys/runners/dso) will be included in place of the standard version. |
| # This flag exists to support experimental dso builders, for more information |
| # see https://fxbug.dev/403545512 |
| experimental_dso_enabled = false |
| |
| # If true, experimental memory optimization features like the |
| # `kernel.oom.experimental_expand_memory_stall` kernel argument will be |
| # enabled. |
| experimental_mem_enabled = false |
| } |
| |
| rustc_binary("assembly") { |
| with_unit_tests = true |
| edition = "2024" |
| |
| features = [] |
| if (experimental_dso_enabled) { |
| features += [ "experimental_dso" ] |
| } |
| if (experimental_mem_enabled) { |
| features += [ "experimental_memory_opt" ] |
| } |
| |
| deps = [ |
| "//src/lib/assembly/assembled_system", |
| "//src/lib/assembly/cli_args", |
| "//src/lib/assembly/config_schema", |
| "//src/lib/assembly/container", |
| "//src/lib/assembly/image_assembly_config", |
| "//src/lib/assembly/image_assembly_config_builder", |
| "//src/lib/assembly/platform_artifacts", |
| "//src/lib/assembly/product_input_bundle", |
| "//src/lib/assembly/tool", |
| "//src/lib/assembly/util", |
| "//src/lib/fuchsia", |
| "//src/starnix/lib/starnix_container", |
| "//src/sys/pkg/lib/fuchsia-pkg", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:camino", |
| "//third_party/rust_crates:log", |
| "//third_party/rust_crates:serde_json", |
| ] |
| |
| test_deps = [ "//third_party/rust_crates:tempfile" ] |
| |
| sources = [ |
| "src/create_system.rs", |
| "src/main.rs", |
| "src/product.rs", |
| ] |
| } |
| |
| bazel_input_file("bazel_input") { |
| generator = ":assembly" |
| outputs = [ "${root_out_dir}/assembly" ] |
| } |