github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/runsc/BUILD (about)

     1  load("//tools:defs.bzl", "go_binary")
     2  
     3  package(licenses = ["notice"])
     4  
     5  go_binary(
     6      name = "runsc",
     7      srcs = [
     8          "main.go",
     9          "version.go",
    10      ],
    11      pure = True,
    12      tags = ["staging"],
    13      visibility = [
    14          "//visibility:public",
    15      ],
    16      x_defs = {"main.version": "{STABLE_VERSION}"},
    17      deps = ["//runsc/cli"],
    18  )
    19  
    20  # The runsc-race target is a race-compatible BUILD target. This must be built
    21  # via: bazel build --features=race :runsc-race
    22  #
    23  # This is neccessary because the race feature must apply to all dependencies
    24  # due a bug in gazelle file selection.  The pure attribute must be off because
    25  # the race detector requires linking with non-Go components, although we still
    26  # require a static binary.
    27  #
    28  # Note that in the future this might be convertible to a compatible target by
    29  # using the pure and static attributes within a select function, but select is
    30  # not currently compatible with string attributes [1].
    31  #
    32  # [1] https://github.com/bazelbuild/bazel/issues/1698
    33  go_binary(
    34      name = "runsc-race",
    35      srcs = [
    36          "main.go",
    37          "version.go",
    38      ],
    39      static = True,
    40      visibility = [
    41          "//visibility:public",
    42      ],
    43      x_defs = {"main.version": "{STABLE_VERSION}"},
    44      deps = ["//runsc/cli"],
    45  )
    46  
    47  sh_test(
    48      name = "version_test",
    49      size = "small",
    50      srcs = ["version_test.sh"],
    51      args = ["$(location :runsc)"],
    52      data = [":runsc"],
    53  )