|
| 1 | +# Apple cc toolchain needs to be loaded before regular cc toolchain or else Apple will just use regular cc toolchain |
| 2 | +bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support") |
| 3 | +bazel_dep(name = "bazel_features", version = "1.10.0") |
| 4 | +single_version_override( |
| 5 | + module_name = "bazel_features", |
| 6 | + version = "1.10.0", |
| 7 | +) |
| 8 | + |
| 9 | +bazel_features_deps = use_extension("//bazel:bzlmod.bzl", "bazel_features_deps") |
| 10 | +use_repo(bazel_features_deps, "bazel_features_globals", "bazel_features_version") |
| 11 | + |
| 12 | +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 13 | + |
| 14 | +http_archive( |
| 15 | + name = "bazel_clang_tidy", |
| 16 | + integrity = "sha256-nar8iWq+4goJBEfmQZPWGsRlHdt+paVu5LY1WQ/BCZA=", |
| 17 | + strip_prefix = "bazel_clang_tidy-a46e57159bfe2d5d41135cec61f1c9cd514c1964", |
| 18 | + urls = [ |
| 19 | + # Implements retry by relisting each url multiple times to be used as a failover. |
| 20 | + # TODO(SERVER-86719): Re-implement http_archive to allow sleeping between retries |
| 21 | + "https://github.com/mongodb-forks/bazel_clang_tidy/archive/a46e57159bfe2d5d41135cec61f1c9cd514c1964.tar.gz", |
| 22 | + "https://github.com/mongodb-forks/bazel_clang_tidy/archive/a46e57159bfe2d5d41135cec61f1c9cd514c1964.tar.gz", |
| 23 | + "https://github.com/mongodb-forks/bazel_clang_tidy/archive/a46e57159bfe2d5d41135cec61f1c9cd514c1964.tar.gz", |
| 24 | + "https://github.com/mongodb-forks/bazel_clang_tidy/archive/a46e57159bfe2d5d41135cec61f1c9cd514c1964.tar.gz", |
| 25 | + "https://github.com/mongodb-forks/bazel_clang_tidy/archive/a46e57159bfe2d5d41135cec61f1c9cd514c1964.tar.gz", |
| 26 | + ], |
| 27 | +) |
| 28 | + |
| 29 | +bazel_dep(name = "platforms", version = "0.0.9") |
| 30 | +single_version_override( |
| 31 | + module_name = "platforms", |
| 32 | + version = "0.0.9", |
| 33 | +) |
| 34 | + |
| 35 | +# TODO move over from WORKSPACE |
| 36 | +# buf does not support s390x |
| 37 | +#bazel_dep(name = "aspect_rules_lint", version = "1.1.0") |
| 38 | +#single_version_override( |
| 39 | +# module_name = "aspect_rules_lint", |
| 40 | +# version = "1.1.0", |
| 41 | +#) |
| 42 | + |
| 43 | +bazel_dep(name = "rules_multirun", version = "0.9.0") |
| 44 | +bazel_dep(name = "aspect_bazel_lib", version = "2.13.0") |
| 45 | +single_version_override( |
| 46 | + module_name = "aspect_bazel_lib", |
| 47 | + version = "2.13.0", |
| 48 | +) |
| 49 | + |
| 50 | +bazel_dep(name = "aspect_rules_js", version = "2.1.3") |
| 51 | +single_version_override( |
| 52 | + module_name = "aspect_rules_js", |
| 53 | + version = "2.1.3", |
| 54 | +) |
| 55 | + |
| 56 | +bazel_dep(name = "rules_nodejs", version = "6.3.0") |
| 57 | +single_version_override( |
| 58 | + module_name = "rules_nodejs", |
| 59 | + version = "6.3.0", |
| 60 | +) |
| 61 | + |
| 62 | +bazel_dep(name = "rules_poetry", version = "") |
| 63 | +git_override( |
| 64 | + module_name = "rules_poetry", |
| 65 | + commit = "917630033c736c188605cf0f558c34afc1eca540", |
| 66 | + patches = ["//bazel/rules_poetry:rules_poetry.patch"], |
| 67 | + remote = "https://github.com/mongodb-forks/rules_poetry", |
| 68 | +) |
| 69 | + |
| 70 | +# |
| 71 | +## We need skylib to be able to use config_setting_group in rule_poetry below |
| 72 | +## https://github.com/bazelbuild/bazel-skylib/blob/main/docs/selects_doc.md#selectsconfig_setting_group |
| 73 | +bazel_dep(name = "bazel_skylib", version = "1.5.0") |
| 74 | +single_version_override( |
| 75 | + module_name = "bazel_skylib", |
| 76 | + version = "1.5.0", |
| 77 | +) |
| 78 | + |
| 79 | +bazel_dep(name = "rules_pkg", version = "0.9.1") |
| 80 | +bazel_dep(name = "zlib", version = "1.3.1") |
| 81 | +single_version_override( |
| 82 | + module_name = "zlib", |
| 83 | + version = "1.3.1", |
| 84 | +) |
| 85 | + |
| 86 | +bazel_dep(name = "abseil-cpp", version = "", repo_name = "com_google_absl") |
| 87 | +local_path_override( |
| 88 | + module_name = "abseil-cpp", |
| 89 | + path = "src/third_party/abseil-cpp/dist", |
| 90 | +) |
| 91 | + |
| 92 | +bazel_dep(name = "protobuf", version = "", repo_name = "com_google_protobuf") |
| 93 | +local_path_override( |
| 94 | + module_name = "protobuf", |
| 95 | + path = "src/third_party/protobuf/dist", |
| 96 | +) |
| 97 | + |
| 98 | +bazel_dep(name = "grpc", version = "", repo_name = "com_github_grpc_grpc") |
| 99 | +local_path_override( |
| 100 | + module_name = "grpc", |
| 101 | + path = "src/third_party/grpc/dist", |
| 102 | +) |
| 103 | + |
| 104 | +bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) |
| 105 | +single_version_override( |
| 106 | + module_name = "buildifier_prebuilt", |
| 107 | + version = "6.4.0", |
| 108 | +) |
| 109 | + |
| 110 | +# TODO port over from WORKSPACE |
| 111 | +# currently breaks pyright |
| 112 | +##node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) |
| 113 | +##node.toolchain(node_version = "18.20.4") |
| 114 | + |
| 115 | +## |
| 116 | +##npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) |
| 117 | +##npm.npm_translate_lock( |
| 118 | +## name = "npm", |
| 119 | +## npmrc = "//:.npmrc", |
| 120 | +## pnpm_lock = "//:pnpm-lock.yaml", |
| 121 | +## verify_node_modules_ignored = "//:.bazelignore", |
| 122 | +##) |
| 123 | +##use_repo(npm, "npm") |
| 124 | +## |
| 125 | +##pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") |
| 126 | +##use_repo(pnpm, "pnpm") |
| 127 | +# |
| 128 | +setup_local_config_platform = use_repo_rule("//bazel/platforms:local_config_platform.bzl", "setup_local_config_platform") |
| 129 | + |
| 130 | +setup_local_config_platform(name = "internal_platforms_do_not_use") |
| 131 | + |
| 132 | +register_execution_platforms("@internal_platforms_do_not_use//host:host") |
| 133 | + |
| 134 | +# TODO port over from WORKSPACE |
| 135 | +# cannot be moved without changing the path or creating a symlink |
| 136 | +# to _main~setup_mongo_toolchains~mongo_toolchain_v4 and _main~setup_mongo_toolchains~mongo_toolchain_v5 |
| 137 | +##setup_mongo_toolchains_extension = use_extension("//bazel/toolchains:mongo_toolchain.bzl", "setup_mongo_toolchains_extension") |
| 138 | +##use_repo( |
| 139 | +## setup_mongo_toolchains_extension, |
| 140 | +## "mongo_toolchain_v4", |
| 141 | +## "mongo_toolchain_v5", |
| 142 | +##) |
| 143 | +# |
| 144 | +mongo_apple_toolchain_config = use_repo_rule("//bazel/toolchains/mongo_apple:mongo_apple_toolchain.bzl", "mongo_apple_toolchain_config") |
| 145 | + |
| 146 | +mongo_apple_toolchain_setup = use_repo_rule("//bazel/toolchains/mongo_apple:mongo_apple_toolchain.bzl", "mongo_apple_toolchain_setup") |
| 147 | + |
| 148 | +mongo_apple_toolchain_config(name = "mongo_apple_toolchain_config") |
| 149 | + |
| 150 | +mongo_apple_toolchain_setup(name = "mongo_apple_toolchain") |
| 151 | + |
| 152 | +register_toolchains( |
| 153 | + "@mongo_apple_toolchain//...", |
| 154 | +) |
| 155 | + |
| 156 | +setup_mongo_python_toolchains = use_extension("//bazel:bzlmod.bzl", "setup_mongo_python_toolchains") |
| 157 | +use_repo( |
| 158 | + setup_mongo_python_toolchains, |
| 159 | + "py_host", |
| 160 | + "py_linux_arm64", |
| 161 | + "py_linux_ppc64le", |
| 162 | + "py_linux_s390x", |
| 163 | + "py_linux_x86_64", |
| 164 | + "py_macos_arm64", |
| 165 | + "py_macos_x86_64", |
| 166 | + "py_windows_x86_64", |
| 167 | +) |
| 168 | + |
| 169 | +register_toolchains( |
| 170 | + "@py_linux_arm64//:python_toolchain", |
| 171 | + "@py_linux_ppc64le//:python_toolchain", |
| 172 | + "@py_linux_s390x//:python_toolchain", |
| 173 | + "@py_linux_x86_64//:python_toolchain", |
| 174 | + "@py_macos_arm64//:python_toolchain", |
| 175 | + "@py_macos_x86_64//:python_toolchain", |
| 176 | + "@py_windows_x86_64//:python_toolchain", |
| 177 | +) |
| 178 | + |
| 179 | +# broken on windows currently |
| 180 | +setup_local_host_values = use_repo_rule("//bazel/platforms:local_host_values.bzl", "setup_local_host_values") |
| 181 | + |
| 182 | +setup_local_host_values(name = "local_host_values") |
0 commit comments