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

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  package(default_applicable_licenses = ["//:license"])
     5  
     6  licenses(["notice"])
     7  
     8  go_template_instance(
     9      name = "request_list",
    10      out = "request_list.go",
    11      package = "fuse",
    12      prefix = "request",
    13      template = "//pkg/ilist:generic_list",
    14      types = {
    15          "Element": "*Request",
    16          "Linker": "*Request",
    17      },
    18  )
    19  
    20  go_template_instance(
    21      name = "inode_refs",
    22      out = "inode_refs.go",
    23      package = "fuse",
    24      prefix = "inode",
    25      template = "//pkg/refs:refs_template",
    26      types = {
    27          "T": "inode",
    28      },
    29  )
    30  
    31  go_template_instance(
    32      name = "seqatomic_time",
    33      out = "seqatomic_time_unsafe.go",
    34      imports = {
    35          "time": "gvisor.dev/gvisor/pkg/sentry/kernel/time",
    36      },
    37      package = "fuse",
    38      suffix = "Time",
    39      template = "//pkg/sync/seqatomic:generic_seqatomic",
    40      types = {
    41          "Value": "time.Time",
    42      },
    43  )
    44  
    45  go_library(
    46      name = "fuse",
    47      srcs = [
    48          "connection.go",
    49          "connection_control.go",
    50          "dev.go",
    51          "dev_state.go",
    52          "directory.go",
    53          "file.go",
    54          "fusefs.go",
    55          "inode.go",
    56          "inode_refs.go",
    57          "read_write.go",
    58          "register.go",
    59          "regular_file.go",
    60          "request_list.go",
    61          "request_response.go",
    62          "save_restore.go",
    63          "seqatomic_time_unsafe.go",
    64      ],
    65      marshal = True,
    66      visibility = ["//pkg/sentry:internal"],
    67      deps = [
    68          "//pkg/abi/linux",
    69          "//pkg/atomicbitops",
    70          "//pkg/context",
    71          "//pkg/errors/linuxerr",
    72          "//pkg/hostarch",
    73          "//pkg/log",
    74          "//pkg/marshal",
    75          "//pkg/marshal/primitive",
    76          "//pkg/refs",
    77          "//pkg/safemem",
    78          "//pkg/sentry/fsimpl/kernfs",
    79          "//pkg/sentry/fsutil",
    80          "//pkg/sentry/kernel",
    81          "//pkg/sentry/kernel/auth",
    82          "//pkg/sentry/kernel/pipe",
    83          "//pkg/sentry/kernel/time",
    84          "//pkg/sentry/memmap",
    85          "//pkg/sentry/vfs",
    86          "//pkg/sync",
    87          "//pkg/usermem",
    88          "//pkg/waiter",
    89          "@org_golang_x_sys//unix:go_default_library",
    90      ],
    91  )
    92  
    93  go_test(
    94      name = "fuse_test",
    95      size = "small",
    96      srcs = [
    97          "connection_test.go",
    98          "dev_test.go",
    99          "utils_test.go",
   100      ],
   101      library = ":fuse",
   102      deps = [
   103          "//pkg/abi/linux",
   104          "//pkg/errors/linuxerr",
   105          "//pkg/marshal/primitive",
   106          "//pkg/sentry/fsimpl/testutil",
   107          "//pkg/sentry/kernel",
   108          "//pkg/sentry/kernel/auth",
   109          "//pkg/sentry/vfs",
   110          "//pkg/usermem",
   111          "//pkg/waiter",
   112          "@org_golang_x_sys//unix:go_default_library",
   113      ],
   114  )