blob: 1e9cd57618378e2301a2b3c1994a7ec80493844e [file] [edit]
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
load("//bazel/ebuild/private:common.bzl", "RUSTC_DEBUG_FLAGS")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test")
rust_binary(
name = "sdk_from_archive",
srcs = glob(["src/*.rs"]),
data = [
"//bazel/zstd",
],
rustc_flags = RUSTC_DEBUG_FLAGS,
visibility = ["//bazel:internal"],
deps = [
"//bazel/ebuild/private/common/cliutil:cliutil_rust",
"//bazel/ebuild/private/common/durabletree",
"//bazel/ebuild/private/common/processes",
"@alchemy_crates//:anyhow",
"@alchemy_crates//:clap",
"@rules_rust//tools/runfiles",
],
)
rust_test(
name = "sdk_from_archive_test",
size = "small",
srcs = [
"tests/run_binary.rs",
],
data = [
":archive.tar.xz",
":archive.tar.zst",
":sdk_from_archive",
],
rustc_flags = RUSTC_DEBUG_FLAGS,
deps = [
"@alchemy_crates//:anyhow",
"@alchemy_crates//:tempfile",
"@rules_rust//tools/runfiles",
],
)