gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/pkg/sentry/fsimpl/gofer/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 = "string_list",
    10      out = "string_list.go",
    11      package = "gofer",
    12      prefix = "string",
    13      template = "//pkg/ilist:generic_list",
    14      types = {
    15          "Element": "*stringListElem",
    16          "Linker": "*stringListElem",
    17      },
    18  )
    19  
    20  go_template_instance(
    21      name = "dentry_list",
    22      out = "dentry_list.go",
    23      package = "gofer",
    24      prefix = "dentry",
    25      template = "//pkg/ilist:generic_list",
    26      types = {
    27          "Element": "*dentryListElem",
    28          "Linker": "*dentryListElem",
    29      },
    30  )
    31  
    32  go_template_instance(
    33      name = "special_fd_list",
    34      out = "special_fd_list.go",
    35      package = "gofer",
    36      prefix = "specialFD",
    37      template = "//pkg/ilist:generic_list",
    38      types = {
    39          "Element": "*specialFileFD",
    40          "Linker": "*specialFileFD",
    41      },
    42  )
    43  
    44  go_template_instance(
    45      name = "fstree",
    46      out = "fstree.go",
    47      package = "gofer",
    48      prefix = "generic",
    49      template = "//pkg/sentry/vfs/genericfstree:generic_fstree",
    50      types = {
    51          "Dentry": "dentry",
    52      },
    53  )
    54  
    55  go_library(
    56      name = "gofer",
    57      srcs = [
    58          "dentry_impl.go",
    59          "dentry_list.go",
    60          "directfs_dentry.go",
    61          "directory.go",
    62          "filesystem.go",
    63          "fstree.go",
    64          "gofer.go",
    65          "handle.go",
    66          "host_named_pipe.go",
    67          "lisafs_dentry.go",
    68          "regular_file.go",
    69          "revalidate.go",
    70          "save_restore.go",
    71          "socket.go",
    72          "special_fd_list.go",
    73          "special_file.go",
    74          "string_list.go",
    75          "symlink.go",
    76          "time.go",
    77      ],
    78      visibility = ["//pkg/sentry:internal"],
    79      deps = [
    80          "//pkg/abi/linux",
    81          "//pkg/atomicbitops",
    82          "//pkg/cleanup",
    83          "//pkg/context",
    84          "//pkg/errors/linuxerr",
    85          "//pkg/fd",
    86          "//pkg/fdnotifier",
    87          "//pkg/fspath",
    88          "//pkg/fsutil",
    89          "//pkg/hostarch",
    90          "//pkg/lisafs",
    91          "//pkg/log",
    92          "//pkg/marshal",
    93          "//pkg/marshal/primitive",
    94          "//pkg/metric",
    95          "//pkg/refs",
    96          "//pkg/safemem",
    97          "//pkg/sentry/fsimpl/host",
    98          "//pkg/sentry/fsimpl/lock",
    99          "//pkg/sentry/fsmetric",
   100          "//pkg/sentry/fsutil",
   101          "//pkg/sentry/hostfd",
   102          "//pkg/sentry/kernel",
   103          "//pkg/sentry/kernel/auth",
   104          "//pkg/sentry/kernel/pipe",
   105          "//pkg/sentry/kernel/time",
   106          "//pkg/sentry/memmap",
   107          "//pkg/sentry/pgalloc",
   108          "//pkg/sentry/platform",
   109          "//pkg/sentry/socket/control",
   110          "//pkg/sentry/socket/unix",
   111          "//pkg/sentry/socket/unix/transport",
   112          "//pkg/sentry/usage",
   113          "//pkg/sentry/vfs",
   114          "//pkg/sync",
   115          "//pkg/syserr",
   116          "//pkg/unet",
   117          "//pkg/usermem",
   118          "//pkg/waiter",
   119          "@org_golang_x_sys//unix:go_default_library",
   120      ],
   121  )
   122  
   123  go_test(
   124      name = "gofer_test",
   125      srcs = ["gofer_test.go"],
   126      library = ":gofer",
   127      deps = [
   128          "//pkg/abi/linux",
   129          "//pkg/lisafs",
   130          "//pkg/sentry/contexttest",
   131          "//pkg/sentry/kernel/time",
   132          "//pkg/sentry/pgalloc",
   133      ],
   134  )