Files
Etienne PerotandgVisor bot 9ca09375e4 Add tool to generate a Go library that executes an embedded compressed binary.
This creates a `go_template` that can generate a `go_library` rule which
extracts a compressed binary to a temporary location, then executes it.

This is useful to implement `runsc` subcommands without requiring that these
subcommands' dependencies are linked into the main `runsc` binary.

PiperOrigin-RevId: 557270682
2023-08-15 15:32:43 -07:00

25 lines
683 B
Python

load("//tools:defs.bzl", "go_binary")
load("//tools/embeddedbinary:defs.bzl", "embedded_binary_go_library")
package(
default_applicable_licenses = ["//:license"],
licenses = ["notice"],
)
# helloworld_bundlee is a simple Go program that prints "Hello, gVisor!\n"
# to stdout. It is bundled by other rules.
go_binary(
name = "helloworld_bundlee",
srcs = ["helloworld_bundlee.go"],
)
# helloworld generates a Go source file called "helloworld.go" which embeds
# the helloworld_bundlee program.
embedded_binary_go_library(
name = "helloworld",
binary = ":helloworld_bundlee",
visibility = [
"//tools/embeddedbinary/test:__subpackages__",
],
)