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

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(licenses = ["notice"])
     5  
     6  go_template_instance(
     7      name = "mappable_range",
     8      out = "mappable_range.go",
     9      package = "memmap",
    10      prefix = "Mappable",
    11      template = "//pkg/segment:generic_range",
    12      types = {
    13          "T": "uint64",
    14      },
    15  )
    16  
    17  go_template_instance(
    18      name = "mapping_set_impl",
    19      out = "mapping_set_impl.go",
    20      package = "memmap",
    21      prefix = "Mapping",
    22      template = "//pkg/segment:generic_set",
    23      types = {
    24          "Key": "uint64",
    25          "Range": "MappableRange",
    26          "Value": "MappingsOfRange",
    27          "Functions": "mappingSetFunctions",
    28      },
    29  )
    30  
    31  go_template_instance(
    32      name = "file_range",
    33      out = "file_range.go",
    34      package = "memmap",
    35      prefix = "File",
    36      template = "//pkg/segment:generic_range",
    37      types = {
    38          "T": "uint64",
    39      },
    40  )
    41  
    42  go_library(
    43      name = "memmap",
    44      srcs = [
    45          "file_range.go",
    46          "mappable_range.go",
    47          "mapping_set.go",
    48          "mapping_set_impl.go",
    49          "memmap.go",
    50      ],
    51      visibility = ["//pkg/sentry:internal"],
    52      deps = [
    53          "//pkg/context",
    54          "//pkg/hostarch",
    55          "//pkg/log",
    56          "//pkg/safemem",
    57          "//pkg/syserror",
    58          "//pkg/usermem",
    59      ],
    60  )
    61  
    62  go_test(
    63      name = "memmap_test",
    64      size = "small",
    65      srcs = ["mapping_set_test.go"],
    66      library = ":memmap",
    67      deps = ["//pkg/hostarch"],
    68  )