blob: 46e045e9e32b1ff30c67c200ff7e67177456fd61 [file]
# Copyright 2026 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.
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")
load("//build/bazel/rules/host_tests:host_rustc_test.bzl", "host_rustc_test")
load("//build/bazel/rules/rust:defs.bzl", "rustc_binary", "rustc_library")
package(default_applicable_licenses = ["//:license"])
rustc_library(
name = "lib",
srcs = ["src/lib.rs"],
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_CONSTRAINTS,
deps = [
"//src/lib/fuchsia-url",
"//src/sys/pkg/lib/channel-config",
"//src/sys/pkg/lib/eager-package-config",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:omaha_client",
"//third_party/rust_crates/vendor:serde",
],
)
# @bazel2gn:skip
host_rustc_test(
name = "lib_test",
crate = ":lib",
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_CONSTRAINTS,
deps = [
"//third_party/rust_crates/vendor:assert_matches",
"//third_party/rust_crates/vendor:serde_json",
"//third_party/rust_crates/vendor:tempfile",
],
)
rustc_binary(
name = "gen_eager_package_config",
srcs = ["src/main.rs"],
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_CONSTRAINTS,
deps = [
":lib",
"//third_party/rust_crates/vendor:anyhow",
"//third_party/rust_crates/vendor:argh",
"//third_party/rust_crates/vendor:serde_json",
],
)
# @bazel2gn:skip
host_rustc_test(
name = "gen_eager_package_config_test",
crate = ":gen_eager_package_config",
edition = "2024",
lint_config = "//build/config/rust/lints:clippy_warn_all",
target_compatible_with = HOST_CONSTRAINTS,
deps = [
"//src/sys/pkg/lib/eager-package-config",
"//third_party/rust_crates/vendor:tempfile",
],
)
# @bazel2gn:skip
test_suite(
name = "host_tests",
tests = [
":gen_eager_package_config_test",
":lib_test",
],
visibility = ["//src/sys/pkg/scripts:__pkg__"],
)