| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| ### |
| # Setup rules_js |
| ### |
| local_repository( |
| name = "aspect_rules_js", |
| path = "../..", |
| ) |
| |
| load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies") |
| |
| rules_js_dependencies() |
| |
| load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains") |
| |
| rules_js_register_toolchains(node_version = "16.14.2") |
| |
| load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock") |
| |
| npm_translate_lock( |
| name = "npm", |
| npmrc = "//:.npmrc", |
| pnpm_lock = "//:pnpm-lock.yaml", |
| verify_node_modules_ignored = "//:.bazelignore", |
| ) |
| |
| load("@npm//:repositories.bzl", "npm_repositories") |
| |
| npm_repositories() |
| |
| ### |
| # Setup rules_oci |
| ### |
| |
| http_archive( |
| name = "rules_oci", |
| sha256 = "e96d70faa4bace3e09fdb1d7d1441b838920f491588889ff9a7e2615afca5799", |
| strip_prefix = "rules_oci-2.0.0-alpha2", |
| url = "https://github.com/bazel-contrib/rules_oci/releases/download/v2.0.0-alpha2/rules_oci-v2.0.0-alpha2.tar.gz", |
| ) |
| |
| load("@rules_oci//oci:dependencies.bzl", "rules_oci_dependencies") |
| |
| rules_oci_dependencies() |
| |
| load("@rules_oci//oci:repositories.bzl", "oci_register_toolchains") |
| |
| oci_register_toolchains(name = "oci") |
| |
| ## Pull base images |
| load("@rules_oci//oci:pull.bzl", "oci_pull") |
| |
| oci_pull( |
| name = "debian", |
| digest = "sha256:3d868b5eb908155f3784317b3dda2941df87bbbbaa4608f84881de66d9bb297b", |
| image = "debian", |
| platforms = [ |
| "linux/386", |
| "linux/amd64", |
| "linux/arm/v5", |
| "linux/arm/v7", |
| "linux/arm64/v8", |
| "linux/mips64le", |
| "linux/ppc64le", |
| "linux/s390x", |
| ], |
| ) |
| |
| ### |
| # Setup container_structure_test |
| ### |
| http_archive( |
| name = "container_structure_test", |
| integrity = "sha256-LaE9pMT+ydRifUCEsSK+D00Ri9At+lKFf/EY/eiOT6o=", |
| strip_prefix = "container-structure-test-1.16.0", |
| urls = ["https://github.com/GoogleContainerTools/container-structure-test/archive/v1.16.0.zip"], |
| ) |
| |
| load("@container_structure_test//:repositories.bzl", "container_structure_test_register_toolchain") |
| |
| container_structure_test_register_toolchain(name = "container_structure_test_toolchain") |
| |
| ## Test repo |
| local_repository( |
| name = "repo", |
| path = "./repo", |
| ) |
| |
| # GRPC |
| http_archive( |
| name = "rules_proto", |
| sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", |
| strip_prefix = "rules_proto-5.3.0-21.7", |
| urls = [ |
| "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", |
| ], |
| ) |
| |
| load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") |
| |
| rules_proto_dependencies() |
| |
| rules_proto_toolchains() |
| |
| http_archive( |
| name = "com_google_googleapis", |
| sha256 = "65d053dbcde1b8722be785e639d69d66f245337a1bb6da716681bce2ae8d2a45", |
| strip_prefix = "googleapis-6adf7b1787284ca71b90439d886a88a239d115c4", |
| urls = ["https://github.com/googleapis/googleapis/archive/6adf7b1787284ca71b90439d886a88a239d115c4.tar.gz"], |
| ) |
| |
| load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") |
| |
| switched_rules_by_language(name = "com_google_googleapis_imports") |
| |
| # LLVM |
| http_archive( |
| name = "com_grail_bazel_toolchain", |
| sha256 = "a9fc7cf01d0ea0a935bd9e3674dd3103766db77dfc6aafcb447a7ddd6ca24a78", |
| strip_prefix = "toolchains_llvm-c65ef7a45907016a754e5bf5bfabac76eb702fd3", |
| urls = ["https://github.com/bazel-contrib/toolchains_llvm/archive/c65ef7a45907016a754e5bf5bfabac76eb702fd3.tar.gz"], |
| ) |
| |
| _SYSROOT_LINUX_BUILD_FILE = """ |
| filegroup( |
| name = "sysroot", |
| srcs = glob(["*/**"]), |
| visibility = ["//visibility:public"], |
| ) |
| """ |
| |
| _SYSROOT_DARWIN_BUILD_FILE = """ |
| filegroup( |
| name = "sysroot", |
| srcs = glob( |
| include = ["**"], |
| exclude = ["**/*:*"], |
| ), |
| visibility = ["//visibility:public"], |
| ) |
| """ |
| |
| http_archive( |
| name = "org_chromium_sysroot_linux_arm64", |
| build_file_content = _SYSROOT_LINUX_BUILD_FILE, |
| sha256 = "cf2fefded0449f06d3cf634bfa94ffed60dbe47f2a14d2900b00eb9bcfb104b8", |
| urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/80fc74e431f37f590d0c85f16a9d8709088929e8/debian_bullseye_arm64_sysroot.tar.xz"], |
| ) |
| |
| http_archive( |
| name = "org_chromium_sysroot_linux_x86_64", |
| build_file_content = _SYSROOT_LINUX_BUILD_FILE, |
| sha256 = "04b94ba1098b71f8543cb0ba6c36a6ea2890d4d417b04a08b907d96b38a48574", |
| urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/f5f68713249b52b35db9e08f67184cac392369ab/debian_bullseye_amd64_sysroot.tar.xz"], |
| ) |
| |
| http_archive( |
| name = "sysroot_darwin_universal", |
| build_file_content = _SYSROOT_DARWIN_BUILD_FILE, |
| # The ruby header has an infinite symlink that we need to remove. |
| patch_cmds = ["rm System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby/ruby"], |
| sha256 = "71ae00a90be7a8c382179014969cec30d50e6e627570af283fbe52132958daaf", |
| strip_prefix = "MacOSX11.3.sdk", |
| urls = ["https://s3.us-east-2.amazonaws.com/static.aspect.build/sysroots/MacOSX11.3.sdk.tar.xz"], |
| ) |
| |
| load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") |
| |
| bazel_toolchain_dependencies() |
| |
| load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") |
| |
| llvm_toolchain( |
| name = "llvm_toolchain", |
| llvm_version = "14.0.0", |
| sha256 = { |
| "darwin-aarch64": "1b8975db6b638b308c1ee437291f44cf8f67a2fb926eb2e6464efd180e843368", |
| "linux-x86_64": "564fcbd79c991e93fdf75f262fa7ac6553ec1dd04622f5d7db2a764c5dc7fac6", |
| }, |
| strip_prefix = { |
| "darwin-aarch64": "clang+llvm-14.0.0-arm64-apple-darwin", |
| "linux-x86_64": "clang+llvm-14.0.0-x86_64-linux-gnu", |
| }, |
| sysroot = { |
| "linux-aarch64": "@org_chromium_sysroot_linux_arm64//:sysroot", |
| "linux-x86_64": "@org_chromium_sysroot_linux_x86_64//:sysroot", |
| "darwin-aarch64": "@sysroot_darwin_universal//:sysroot", |
| "darwin-x86_64": "@sysroot_darwin_universal//:sysroot", |
| }, |
| urls = { |
| "darwin-aarch64": ["https://github.com/aspect-forks/llvm-project/releases/download/aspect-release-14.0.0/clang+llvm-14.0.0-arm64-apple-darwin.tar.xz"], |
| "linux-x86_64": ["https://github.com/aspect-forks/llvm-project/releases/download/aspect-release-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu.tar.xz"], |
| }, |
| ) |
| |
| load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains") |
| |
| llvm_register_toolchains() |