gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/runsc/cmd/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  
     3  package(
     4      default_applicable_licenses = ["//:license"],
     5      licenses = ["notice"],
     6  )
     7  
     8  config_setting(
     9      name = "metric_server_elided",
    10      values = {
    11          "compilation_mode": "fastbuild",
    12      },
    13  )
    14  
    15  # @unused
    16  glaze_ignore = [
    17      "metric_server_elided.go",
    18      "metric_server_embedded.go",
    19  ]
    20  
    21  # Use either metric_server_elided.go or metric_server_embedded.go
    22  # as metric_server.go.
    23  genrule(
    24      name = "metricserver_cmd",
    25      srcs = select({
    26          ":metric_server_elided": ["metric_server_elided.go"],
    27          "//conditions:default": ["metric_server_embedded.go"],
    28      }),
    29      outs = ["metric_server.go"],
    30      cmd = "cat < $(SRCS) > $(OUTS)",
    31  )
    32  
    33  go_library(
    34      name = "cmd",
    35      srcs = [
    36          "boot.go",
    37          "capability.go",
    38          "checkpoint.go",
    39          "chroot.go",
    40          "cmd.go",
    41          "create.go",
    42          "debug.go",
    43          "delete.go",
    44          "do.go",
    45          "events.go",
    46          "exec.go",
    47          "fd_mapping.go",
    48          "gofer.go",
    49          "help.go",
    50          "install.go",
    51          "kill.go",
    52          "list.go",
    53          "metric_export.go",
    54          "metric_metadata.go",
    55          "metric_server.go",
    56          "mitigate.go",
    57          "mitigate_extras.go",
    58          "path.go",
    59          "pause.go",
    60          "platforms.go",
    61          "portforward.go",
    62          "ps.go",
    63          "read_control.go",
    64          "restore.go",
    65          "resume.go",
    66          "run.go",
    67          "spec.go",
    68          "start.go",
    69          "state.go",
    70          "statefile.go",
    71          "symbolize.go",
    72          "syscalls.go",
    73          "umount_unsafe.go",
    74          "usage.go",
    75          "wait.go",
    76          "write_control.go",
    77      ],
    78      force_add_state_pkg = True,
    79      visibility = ["//runsc:__subpackages__"],
    80      deps = [
    81          "//pkg/abi/linux",
    82          "//pkg/cleanup",
    83          "//pkg/coretag",
    84          "//pkg/coverage",
    85          "//pkg/cpuid",
    86          "//pkg/fd",
    87          "//pkg/log",
    88          "//pkg/metric",
    89          "//pkg/prometheus",
    90          "//pkg/ring0",
    91          "//pkg/sentry/control",
    92          "//pkg/sentry/devices/tpuproxy",
    93          "//pkg/sentry/kernel",
    94          "//pkg/sentry/kernel/auth",
    95          "//pkg/sentry/pgalloc",
    96          "//pkg/sentry/platform",
    97          "//pkg/state/pretty",
    98          "//pkg/state/statefile",
    99          "//pkg/unet",
   100          "//pkg/urpc",
   101          "//runsc/boot",
   102          "//runsc/cmd/metricserver/metricservercmd",
   103          "//runsc/cmd/util",
   104          "//runsc/config",
   105          "//runsc/console",
   106          "//runsc/container",
   107          "//runsc/flag",
   108          "//runsc/fsgofer",
   109          "//runsc/fsgofer/filter",
   110          "//runsc/metricserver/containermetrics",
   111          "//runsc/mitigate",
   112          "//runsc/profile",
   113          "//runsc/specutils",
   114          "@com_github_google_subcommands//:go_default_library",
   115          "@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
   116          "@com_github_syndtr_gocapability//capability:go_default_library",
   117          "@org_golang_google_protobuf//encoding/prototext:go_default_library",
   118          "@org_golang_x_sys//unix:go_default_library",
   119      ] + select({
   120          ":metric_server_elided": [],
   121          "//conditions:default": [
   122              "//runsc/cmd/metricserver",
   123          ],
   124      }),
   125  )
   126  
   127  go_test(
   128      name = "cmd_test",
   129      size = "small",
   130      srcs = [
   131          "capability_test.go",
   132          "delete_test.go",
   133          "exec_test.go",
   134          "gofer_test.go",
   135          "install_test.go",
   136          "list_test.go",
   137          "mitigate_test.go",
   138      ],
   139      data = [
   140          "//runsc",
   141      ],
   142      library = ":cmd",
   143      deps = [
   144          "//pkg/abi/linux",
   145          "//pkg/log",
   146          "//pkg/sentry/control",
   147          "//pkg/sentry/kernel/auth",
   148          "//pkg/test/testutil",
   149          "//runsc/cmd/util",
   150          "//runsc/config",
   151          "//runsc/container",
   152          "//runsc/mitigate",
   153          "//runsc/specutils",
   154          "@com_github_google_go_cmp//cmp:go_default_library",
   155          "@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
   156          "@com_github_google_subcommands//:go_default_library",
   157          "@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
   158          "@com_github_syndtr_gocapability//capability:go_default_library",
   159      ],
   160  )