github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sentry/fsimpl/ext/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 = "dirent_list",
     8      out = "dirent_list.go",
     9      package = "ext",
    10      prefix = "dirent",
    11      template = "//pkg/ilist:generic_list",
    12      types = {
    13          "Element": "*dirent",
    14          "Linker": "*dirent",
    15      },
    16  )
    17  
    18  go_template_instance(
    19      name = "fstree",
    20      out = "fstree.go",
    21      package = "ext",
    22      prefix = "generic",
    23      template = "//pkg/sentry/vfs/genericfstree:generic_fstree",
    24      types = {
    25          "Dentry": "dentry",
    26      },
    27  )
    28  
    29  go_library(
    30      name = "ext",
    31      srcs = [
    32          "block_map_file.go",
    33          "dentry.go",
    34          "directory.go",
    35          "dirent_list.go",
    36          "ext.go",
    37          "extent_file.go",
    38          "file_description.go",
    39          "filesystem.go",
    40          "fstree.go",
    41          "inode.go",
    42          "regular_file.go",
    43          "symlink.go",
    44          "utils.go",
    45      ],
    46      visibility = ["//pkg/sentry:internal"],
    47      deps = [
    48          "//pkg/abi/linux",
    49          "//pkg/context",
    50          "//pkg/errors/linuxerr",
    51          "//pkg/fd",
    52          "//pkg/fspath",
    53          "//pkg/log",
    54          "//pkg/marshal",
    55          "//pkg/marshal/primitive",
    56          "//pkg/safemem",
    57          "//pkg/sentry/arch",
    58          "//pkg/sentry/fs",
    59          "//pkg/sentry/fs/lock",
    60          "//pkg/sentry/fsimpl/ext/disklayout",
    61          "//pkg/sentry/kernel/auth",
    62          "//pkg/sentry/memmap",
    63          "//pkg/sentry/socket/unix/transport",
    64          "//pkg/sentry/syscalls/linux",
    65          "//pkg/sentry/vfs",
    66          "//pkg/sync",
    67          "//pkg/syserror",
    68          "//pkg/usermem",
    69          "//pkg/waiter",
    70      ],
    71  )
    72  
    73  go_test(
    74      name = "ext_test",
    75      size = "small",
    76      srcs = [
    77          "block_map_test.go",
    78          "ext_test.go",
    79          "extent_test.go",
    80      ],
    81      data = [
    82          "//pkg/sentry/fsimpl/ext:assets/bigfile.txt",
    83          "//pkg/sentry/fsimpl/ext:assets/file.txt",
    84          "//pkg/sentry/fsimpl/ext:assets/tiny.ext2",
    85          "//pkg/sentry/fsimpl/ext:assets/tiny.ext3",
    86          "//pkg/sentry/fsimpl/ext:assets/tiny.ext4",
    87      ],
    88      library = ":ext",
    89      deps = [
    90          "//pkg/abi/linux",
    91          "//pkg/context",
    92          "//pkg/errors/linuxerr",
    93          "//pkg/fspath",
    94          "//pkg/marshal/primitive",
    95          "//pkg/sentry/contexttest",
    96          "//pkg/sentry/fsimpl/ext/disklayout",
    97          "//pkg/sentry/kernel/auth",
    98          "//pkg/sentry/vfs",
    99          "//pkg/test/testutil",
   100          "//pkg/usermem",
   101          "@com_github_google_go_cmp//cmp:go_default_library",
   102          "@com_github_google_go_cmp//cmp/cmpopts:go_default_library",
   103      ],
   104  )