gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/BUILD (about)

     1  load("@rules_license//rules:license.bzl", "license")
     2  load("//tools:defs.bzl", "build_test", "gazelle", "go_path")
     3  load("//tools/nogo:defs.bzl", "nogo_config")
     4  load("//tools/yamltest:defs.bzl", "yaml_test")
     5  load("//website:defs.bzl", "doc")
     6  
     7  package(
     8      default_applicable_licenses = ["//:license"],
     9      licenses = ["notice"],
    10  )
    11  
    12  license(
    13      name = "license",
    14      package_name = "gvisor",
    15  )
    16  
    17  exports_files(["LICENSE"])
    18  
    19  nogo_config(
    20      name = "nogo_config",
    21      srcs = ["nogo.yaml"],
    22      visibility = ["//:sandbox"],
    23  )
    24  
    25  doc(
    26      name = "contributing",
    27      src = "CONTRIBUTING.md",
    28      category = "Project",
    29      permalink = "/contributing/",
    30      visibility = ["//website:__pkg__"],
    31      weight = "20",
    32  )
    33  
    34  doc(
    35      name = "security",
    36      src = "SECURITY.md",
    37      category = "Project",
    38      permalink = "/security/",
    39      visibility = ["//website:__pkg__"],
    40      weight = "30",
    41  )
    42  
    43  doc(
    44      name = "governance",
    45      src = "GOVERNANCE.md",
    46      category = "Project",
    47      permalink = "/community/governance/",
    48      subcategory = "Community",
    49      visibility = ["//website:__pkg__"],
    50      weight = "20",
    51  )
    52  
    53  doc(
    54      name = "code_of_conduct",
    55      src = "CODE_OF_CONDUCT.md",
    56      category = "Project",
    57      permalink = "/community/code_of_conduct/",
    58      subcategory = "Community",
    59      visibility = ["//website:__pkg__"],
    60      weight = "99",
    61  )
    62  
    63  yaml_test(
    64      name = "nogo_config_test",
    65      srcs = glob(["nogo*.yaml"]),
    66      schema = "//tools/nogo/config:schema.json",
    67  )
    68  
    69  yaml_test(
    70      name = "github_workflows_test",
    71      srcs = glob([".github/workflows/*.yml"]),
    72      schema = "@github_workflow_schema//file",
    73  )
    74  
    75  filegroup(
    76      name = "buildkite_pipelines",
    77      srcs = glob([".buildkite/*.yaml"]),
    78      visibility = ["//:sandbox"],
    79  )
    80  
    81  yaml_test(
    82      name = "buildkite_pipelines_test",
    83      srcs = glob([".buildkite/*.yaml"]),
    84      schema = "@buildkite_pipeline_schema//file",
    85  )
    86  
    87  # The sandbox filegroup is used for sandbox-internal dependencies.
    88  package_group(
    89      name = "sandbox",
    90      packages = ["//..."],
    91  )
    92  
    93  # For targets that will not normally build internally, we ensure that they are
    94  # least build by a static BUILD test.
    95  build_test(
    96      name = "build_test",
    97      targets = [
    98          "//test/e2e:integration_test",
    99          "//test/image:image_test",
   100          "//test/root:root_test",
   101          "//test/benchmarks/base:startup_test",
   102          "//test/benchmarks/base:size_test",
   103          "//test/benchmarks/base:sysbench_test",
   104          "//test/benchmarks/database:redis_test",
   105          "//test/benchmarks/fs:bazel_test",
   106          "//test/benchmarks/fs:fio_test",
   107          "//test/benchmarks/media:ffmpeg_test",
   108          "//test/benchmarks/ml:tensorflow_test",
   109          "//test/benchmarks/network:httpd_test",
   110          "//test/benchmarks/network:nginx_test",
   111          "//test/benchmarks/network:node_test",
   112          "//test/benchmarks/network:ruby_test",
   113      ],
   114  )
   115  
   116  # gopath defines a directory that is structured in a way that is compatible
   117  # with standard Go tools. Things like godoc, editors and refactor tools should
   118  # work as expected.
   119  #
   120  # The files in this tree are symlinks to the true sources.
   121  go_path(
   122      name = "gopath",
   123      mode = "archive",
   124      deps = [
   125          # Main binaries.
   126          #
   127          # For reasons related to reproducibility of the generated
   128          # files, in order to ensure that :gopath produces only a
   129          # a single "pure" version of all files, we can only depend
   130          # on go_library targets here, and not go_binary. Thus the
   131          # binaries have been factored into a cli package, which is
   132          # a good practice in any case.
   133          "//runsc/cli",
   134          "//shim/cli",
   135          "//webhook/pkg/cli",
   136          "//tools/checklocks",
   137  
   138          # Packages that are not dependencies of the above.
   139          "//pkg/sentry/kernel/memevent",
   140          "//pkg/tcpip/adapters/gonet",
   141          "//pkg/tcpip/faketime",
   142          "//pkg/tcpip/link/channel",
   143          "//pkg/tcpip/link/ethernet",
   144          "//pkg/tcpip/link/muxed",
   145          "//pkg/tcpip/link/pipe",
   146          "//pkg/tcpip/link/sharedmem",
   147          "//pkg/tcpip/link/sharedmem/pipe",
   148          "//pkg/tcpip/link/sharedmem/queue",
   149          "//pkg/tcpip/link/tun",
   150          "//pkg/tcpip/link/waitable",
   151          "//pkg/tcpip/sample/tun_tcp_connect",
   152          "//pkg/tcpip/sample/tun_tcp_echo",
   153          "//pkg/tcpip/transport/tcpconntrack",
   154      ],
   155  )
   156  
   157  # CC toolchain targets for cross-compilation.
   158  # Required to be explicitly specified in bazel >= 5.
   159  toolchain(
   160      name = "cc_toolchain_k8",
   161      target_compatible_with = [
   162          "@platforms//os:linux",
   163          "@platforms//cpu:x86_64",
   164      ],
   165      toolchain = "@crosstool//:cc-compiler-k8",
   166      toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
   167  )
   168  
   169  toolchain(
   170      name = "cc_toolchain_aarch64",
   171      target_compatible_with = [
   172          "@platforms//os:linux",
   173          "@platforms//cpu:aarch64",
   174      ],
   175      toolchain = "@crosstool//:cc-compiler-aarch64",
   176      toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
   177  )
   178  
   179  # gazelle is a set of build tools.
   180  #
   181  # To update the WORKSPACE from go.mod, use:
   182  #   bazel run //:gazelle -- update-repos -from_file=go.mod
   183  gazelle(name = "gazelle")