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

     1  load("//tools:defs.bzl", "default_platform", "go_library", "go_test", "most_shards", "platforms")
     2  
     3  package(
     4      default_applicable_licenses = ["//:license"],
     5      licenses = ["notice"],
     6  )
     7  
     8  go_library(
     9      name = "container",
    10      srcs = [
    11          "container.go",
    12          "hook.go",
    13          "state_file.go",
    14          "status.go",
    15      ],
    16      visibility = [
    17          "//runsc:__subpackages__",
    18          "//test:__subpackages__",
    19      ],
    20      deps = [
    21          "//pkg/abi/linux",
    22          "//pkg/cleanup",
    23          "//pkg/log",
    24          "//pkg/sentry/control",
    25          "//pkg/sentry/fsimpl/erofs",
    26          "//pkg/sentry/fsimpl/tmpfs",
    27          "//pkg/sentry/pgalloc",
    28          "//pkg/sighandling",
    29          "//pkg/state/statefile",
    30          "//pkg/sync",
    31          "//runsc/boot",
    32          "//runsc/cgroup",
    33          "//runsc/config",
    34          "//runsc/console",
    35          "//runsc/donation",
    36          "//runsc/sandbox",
    37          "//runsc/specutils",
    38          "@com_github_cenkalti_backoff//:go_default_library",
    39          "@com_github_gofrs_flock//:go_default_library",
    40          "@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
    41          "@org_golang_x_sys//unix:go_default_library",
    42      ],
    43  )
    44  
    45  go_test(
    46      name = "container_test",
    47      size = "large",
    48      srcs = [
    49          "console_test.go",
    50          "container_test.go",
    51          "metric_server_test.go",
    52          "multi_container_test.go",
    53          "shared_volume_test.go",
    54          "trace_test.go",
    55      ],
    56      # Only run the default platform for the tsan test, which should
    57      # be compatible. For non-tsan builds, run all platforms.
    58      args = select({
    59          "//conditions:default": [
    60              "--test_platforms=%s" % ",".join([p for (p, tags) in platforms.items() if "manual" not in tags]) or default_platform,
    61          ],
    62          "//tools:gotsan": [
    63              "--test_platforms=%s" % default_platform,
    64          ],
    65      }),
    66      data = [
    67          "//runsc",
    68          "//test/cmd/test_app",
    69      ],
    70      library = ":container",
    71      shard_count = most_shards,
    72      tags = ["requires-kvm"],
    73      deps = [
    74          "//pkg/abi/linux",
    75          "//pkg/bits",
    76          "//pkg/cleanup",
    77          "//pkg/log",
    78          "//pkg/sentry/control",
    79          "//pkg/sentry/fsimpl/erofs",
    80          "//pkg/sentry/kernel",
    81          "//pkg/sentry/kernel/auth",
    82          "//pkg/sentry/limits",
    83          "//pkg/sentry/pgalloc",
    84          "//pkg/sentry/platform",
    85          "//pkg/sentry/seccheck",
    86          "//pkg/sentry/seccheck/points:points_go_proto",
    87          "//pkg/sentry/seccheck/sinks/remote/test",
    88          "//pkg/state/statefile",
    89          "//pkg/sync",
    90          "//pkg/test/testutil",
    91          "//pkg/unet",
    92          "//runsc/boot",
    93          "//runsc/cgroup",
    94          "//runsc/config",
    95          "//runsc/flag",
    96          "//runsc/specutils",
    97          "//test/metricclient",
    98          "@com_github_cenkalti_backoff//:go_default_library",
    99          "@com_github_google_go_cmp//cmp:go_default_library",
   100          "@com_github_kr_pty//:go_default_library",
   101          "@com_github_opencontainers_runtime_spec//specs-go:go_default_library",
   102          "@org_golang_google_grpc//:go_default_library",
   103          "@org_golang_google_protobuf//proto:go_default_library",
   104          "@org_golang_x_sys//unix:go_default_library",
   105      ],
   106  )
   107  
   108  go_test(
   109      name = "serialization_test",
   110      srcs = ["serialization_test.go"],
   111      deps = [
   112          ":container",
   113          "//runsc/sandbox",
   114          "@org_golang_google_protobuf//proto:go_default_library",
   115      ],
   116  )