gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/fsimpl/lock/BUILD (about)

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(
     5      default_applicable_licenses = ["//:license"],
     6      licenses = ["notice"],
     7  )
     8  
     9  go_template_instance(
    10      name = "lock_range",
    11      out = "lock_range.go",
    12      package = "lock",
    13      prefix = "Lock",
    14      template = "//pkg/segment:generic_range",
    15      types = {
    16          "T": "uint64",
    17      },
    18  )
    19  
    20  go_template_instance(
    21      name = "lock_set",
    22      out = "lock_set.go",
    23      consts = {
    24          "minDegree": "3",
    25      },
    26      package = "lock",
    27      prefix = "Lock",
    28      template = "//pkg/segment:generic_set",
    29      types = {
    30          "Key": "uint64",
    31          "Range": "LockRange",
    32          "Value": "Lock",
    33          "Functions": "lockSetFunctions",
    34      },
    35  )
    36  
    37  go_library(
    38      name = "lock",
    39      srcs = [
    40          "lock.go",
    41          "lock_range.go",
    42          "lock_set.go",
    43          "lock_set_functions.go",
    44      ],
    45      visibility = ["//pkg/sentry:internal"],
    46      deps = [
    47          "//pkg/abi/linux",
    48          "//pkg/context",
    49          "//pkg/errors/linuxerr",
    50          "//pkg/log",
    51          "//pkg/sync",
    52          "//pkg/waiter",
    53          "@org_golang_x_sys//unix:go_default_library",
    54      ],
    55  )
    56  
    57  go_test(
    58      name = "lock_test",
    59      size = "small",
    60      srcs = [
    61          "lock_range_test.go",
    62          "lock_test.go",
    63      ],
    64      library = ":lock",
    65      deps = [
    66          "//pkg/errors/linuxerr",
    67          "@org_golang_x_sys//unix:go_default_library",
    68      ],
    69  )