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

     1  load("//tools:defs.bzl", "go_library", "go_test")
     2  load("//tools/go_generics:defs.bzl", "go_template_instance")
     3  
     4  licenses(["notice"])
     5  
     6  go_template_instance(
     7      name = "dentry_list",
     8      out = "dentry_list.go",
     9      package = "tmpfs",
    10      prefix = "dentry",
    11      template = "//pkg/ilist:generic_list",
    12      types = {
    13          "Element": "*dentry",
    14          "Linker": "*dentry",
    15      },
    16  )
    17  
    18  go_template_instance(
    19      name = "fstree",
    20      out = "fstree.go",
    21      package = "tmpfs",
    22      prefix = "generic",
    23      template = "//pkg/sentry/vfs/genericfstree:generic_fstree",
    24      types = {
    25          "Dentry": "dentry",
    26      },
    27  )
    28  
    29  go_template_instance(
    30      name = "inode_refs",
    31      out = "inode_refs.go",
    32      package = "tmpfs",
    33      prefix = "inode",
    34      template = "//pkg/refsvfs2:refs_template",
    35      types = {
    36          "T": "inode",
    37      },
    38  )
    39  
    40  go_library(
    41      name = "tmpfs",
    42      srcs = [
    43          "dentry_list.go",
    44          "device_file.go",
    45          "directory.go",
    46          "filesystem.go",
    47          "fstree.go",
    48          "inode_refs.go",
    49          "named_pipe.go",
    50          "regular_file.go",
    51          "save_restore.go",
    52          "socket_file.go",
    53          "symlink.go",
    54          "tmpfs.go",
    55      ],
    56      visibility = ["//pkg/sentry:internal"],
    57      deps = [
    58          "//pkg/abi/linux",
    59          "//pkg/amutex",
    60          "//pkg/context",
    61          "//pkg/errors/linuxerr",
    62          "//pkg/fspath",
    63          "//pkg/hostarch",
    64          "//pkg/log",
    65          "//pkg/refs",
    66          "//pkg/refsvfs2",
    67          "//pkg/safemem",
    68          "//pkg/sentry/arch",
    69          "//pkg/sentry/fs",
    70          "//pkg/sentry/fs/fsutil",
    71          "//pkg/sentry/fs/lock",
    72          "//pkg/sentry/fsmetric",
    73          "//pkg/sentry/kernel/auth",
    74          "//pkg/sentry/kernel/pipe",
    75          "//pkg/sentry/kernel/time",
    76          "//pkg/sentry/memmap",
    77          "//pkg/sentry/pgalloc",
    78          "//pkg/sentry/platform",
    79          "//pkg/sentry/socket/unix/transport",
    80          "//pkg/sentry/uniqueid",
    81          "//pkg/sentry/usage",
    82          "//pkg/sentry/vfs",
    83          "//pkg/sentry/vfs/memxattr",
    84          "//pkg/sync",
    85          "//pkg/syserror",
    86          "//pkg/usermem",
    87      ],
    88  )
    89  
    90  go_test(
    91      name = "benchmark_test",
    92      size = "small",
    93      srcs = ["benchmark_test.go"],
    94      deps = [
    95          ":tmpfs",
    96          "//pkg/abi/linux",
    97          "//pkg/context",
    98          "//pkg/errors/linuxerr",
    99          "//pkg/fspath",
   100          "//pkg/refs",
   101          "//pkg/sentry/contexttest",
   102          "//pkg/sentry/fs",
   103          "//pkg/sentry/fs/tmpfs",
   104          "//pkg/sentry/kernel/auth",
   105          "//pkg/sentry/vfs",
   106          "//pkg/syserror",
   107      ],
   108  )
   109  
   110  go_test(
   111      name = "tmpfs_test",
   112      size = "small",
   113      srcs = [
   114          "pipe_test.go",
   115          "regular_file_test.go",
   116          "stat_test.go",
   117          "tmpfs_test.go",
   118      ],
   119      library = ":tmpfs",
   120      deps = [
   121          "//pkg/abi/linux",
   122          "//pkg/context",
   123          "//pkg/errors/linuxerr",
   124          "//pkg/fspath",
   125          "//pkg/sentry/contexttest",
   126          "//pkg/sentry/fs/lock",
   127          "//pkg/sentry/kernel/auth",
   128          "//pkg/sentry/vfs",
   129          "//pkg/syserror",
   130          "//pkg/usermem",
   131      ],
   132  )