|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 15 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") |
16 | 16 | load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
|
17 | 17 | load("//third_party:bazel.bzl", "bazel_sha256", "bazel_version")
|
18 | 18 | load("//third_party:bazel_skylib.bzl", "skylib_sha256", "skylib_version")
|
@@ -175,3 +175,59 @@ def _non_module_deps(_):
|
175 | 175 | )
|
176 | 176 |
|
177 | 177 | non_module_deps = module_extension(implementation = _non_module_deps)
|
| 178 | + |
| 179 | +def _async_profiler_repos(ctx): |
| 180 | + http_file( |
| 181 | + name = "async_profiler", |
| 182 | + downloaded_file_path = "async-profiler.jar", |
| 183 | + # At commit f0ceda6356f05b7ad0a6593670c8c113113bf0b3 (2024-12-09). |
| 184 | + sha256 = "da95a5292fb203966196ecb68a39a8c26ad7276aeef642ec1de872513be1d8b3", |
| 185 | + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler.jar"], |
| 186 | + ) |
| 187 | + |
| 188 | + _ASYNC_PROFILER_BUILD_TEMPLATE = """ |
| 189 | +load("@bazel_skylib//rules:copy_file.bzl", "copy_file") |
| 190 | +copy_file( |
| 191 | + name = "libasyncProfiler", |
| 192 | + src = "libasyncProfiler.{ext}", |
| 193 | + out = "{tag}/libasyncProfiler.so", |
| 194 | + visibility = ["//visibility:public"], |
| 195 | +) |
| 196 | +""" |
| 197 | + |
| 198 | + http_archive( |
| 199 | + name = "async_profiler_linux_arm64", |
| 200 | + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( |
| 201 | + ext = "so", |
| 202 | + tag = "linux-arm64", |
| 203 | + ), |
| 204 | + sha256 = "7c6243bb91272a2797acb8cc44acf3e406e0b658a94d90d9391ca375fc961857", |
| 205 | + strip_prefix = "async-profiler-3.0-f0ceda6-linux-arm64/lib", |
| 206 | + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-arm64.tar.gz"], |
| 207 | + ) |
| 208 | + |
| 209 | + http_archive( |
| 210 | + name = "async_profiler_linux_x64", |
| 211 | + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( |
| 212 | + ext = "so", |
| 213 | + tag = "linux-x64", |
| 214 | + ), |
| 215 | + sha256 = "448a3dc681375860eba2264d6cae7a848bd3f07f81f547a9ce58b742a1541d25", |
| 216 | + strip_prefix = "async-profiler-3.0-f0ceda6-linux-x64/lib", |
| 217 | + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-x64.tar.gz"], |
| 218 | + ) |
| 219 | + |
| 220 | + http_archive( |
| 221 | + name = "async_profiler_macos", |
| 222 | + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( |
| 223 | + ext = "dylib", |
| 224 | + tag = "macos", |
| 225 | + ), |
| 226 | + sha256 = "0651004c78d080f67763cddde6e1f58cd0d0c4cb0b57034beef80b450ff5adf2", |
| 227 | + strip_prefix = "async-profiler-3.0-f0ceda6-macos/lib", |
| 228 | + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-macos.zip"], |
| 229 | + ) |
| 230 | + |
| 231 | +# This is an extension (instead of use_repo_rule usages) only to create a |
| 232 | +# lockfile entry for the distribution repo module extension. |
| 233 | +async_profiler_repos = module_extension(_async_profiler_repos) |
0 commit comments