| # 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("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS") | |
| load("//build/bazel/rules/rust:rustc_binary.bzl", "rustc_binary") | |
| package(default_applicable_licenses = ["//:license"]) | |
| # This executable implements self-extraction of a ZIP file appended directly | |
| # onto the binary itself. It is prepended to ZIP files that should be | |
| # extracted and executed. | |
| rustc_binary( | |
| name = "self_extracting_binary", | |
| srcs = ["src/main.rs"], | |
| build_flags = ["//build/config:optimize_size"], | |
| edition = "2024", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| "//third_party/rust_crates/vendor:tempfile", | |
| "//third_party/rust_crates/vendor:zip", | |
| ], | |
| ) |