diff --git a/BUILD b/BUILD index 68a57162c54168..a9bac6d31b7e2e 100644 --- a/BUILD +++ b/BUILD @@ -111,6 +111,7 @@ pkg_tar( srcs = [ "//third_party/googleapis:dist_jars", "//third_party/grpc-java:grpc_jars", + "@async_profiler//file", "@com_google_protobuf//:protobuf_java", "@com_google_protobuf//:protobuf_java_util", "@com_google_protobuf//:protobuf_javalite", diff --git a/MODULE.bazel b/MODULE.bazel index 9c07e2c1f48cc2..057a76b5224ffb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -187,7 +187,6 @@ maven.install( "org.threeten:threeten-extra:1.5.0", "org.tukaani:xz:1.9", "org.yaml:snakeyaml:1.28", - "tools.profiler:async-profiler:3.0", # The following jars are for testing. # junit is not test only due to //src/java_tools/junitrunner/java/com/google/testing/junit/junit4:runner, # and hamcrest is a dependency of junit. @@ -364,6 +363,15 @@ http_file( urls = ["https://github.com/jqlang/jq/releases/download/jq-1.5/jq-win64.exe"], ) +async_profiler_repos = use_extension("//:repositories.bzl", "async_profiler_repos") +use_repo( + async_profiler_repos, + "async_profiler", + "async_profiler_linux_arm64", + "async_profiler_linux_x64", + "async_profiler_macos", +) + # ========================================= # Other Bazel testing dependencies # ========================================= diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index d16e09ac48812a..492159ed745c69 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -233,6 +233,211 @@ }, "selectedYankedVersions": {}, "moduleExtensions": { + "//:repositories.bzl%async_profiler_repos": { + "general": { + "bzlTransitiveDigest": "JeHW4jAtkA9bf6sLhCHFDp7GGtqyJhsYXZQyawGd8tQ=", + "usagesDigest": "fv/Ru+up/1CLlox7G1yNn9y4JOVK1qeU6uQCAkCcMaM=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "async_profiler": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "downloaded_file_path": "async-profiler.jar", + "sha256": "da95a5292fb203966196ecb68a39a8c26ad7276aeef642ec1de872513be1d8b3", + "urls": [ + "https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler.jar" + ] + } + }, + "async_profiler_linux_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nload(\"@bazel_skylib//rules:copy_file.bzl\", \"copy_file\")\n\ncopy_file(\n name = \"libasyncProfiler\",\n src = \"libasyncProfiler.so\",\n out = \"linux-arm64/libasyncProfiler.so\",\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "7c6243bb91272a2797acb8cc44acf3e406e0b658a94d90d9391ca375fc961857", + "strip_prefix": "async-profiler-3.0-f0ceda6-linux-arm64/lib", + "urls": [ + "https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-arm64.tar.gz" + ] + } + }, + "async_profiler_linux_x64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nload(\"@bazel_skylib//rules:copy_file.bzl\", \"copy_file\")\n\ncopy_file(\n name = \"libasyncProfiler\",\n src = \"libasyncProfiler.so\",\n out = \"linux-x64/libasyncProfiler.so\",\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "448a3dc681375860eba2264d6cae7a848bd3f07f81f547a9ce58b742a1541d25", + "strip_prefix": "async-profiler-3.0-f0ceda6-linux-x64/lib", + "urls": [ + "https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-x64.tar.gz" + ] + } + }, + "async_profiler_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "build_file_content": "\nload(\"@bazel_skylib//rules:copy_file.bzl\", \"copy_file\")\n\ncopy_file(\n name = \"libasyncProfiler\",\n src = \"libasyncProfiler.dylib\",\n out = \"macos/libasyncProfiler.so\",\n visibility = [\"//visibility:public\"],\n)\n", + "sha256": "0651004c78d080f67763cddde6e1f58cd0d0c4cb0b57034beef80b450ff5adf2", + "strip_prefix": "async-profiler-3.0-f0ceda6-macos/lib", + "urls": [ + "https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-macos.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [ + [ + "", + "abseil-cpp", + "abseil-cpp+" + ], + [ + "", + "apple_support", + "apple_support+" + ], + [ + "", + "async_profiler", + "+async_profiler_repos+async_profiler" + ], + [ + "", + "async_profiler_linux_arm64", + "+async_profiler_repos+async_profiler_linux_arm64" + ], + [ + "", + "async_profiler_linux_x64", + "+async_profiler_repos+async_profiler_linux_x64" + ], + [ + "", + "async_profiler_macos", + "+async_profiler_repos+async_profiler_macos" + ], + [ + "", + "bazel_skylib", + "bazel_skylib+" + ], + [ + "", + "bazel_tools", + "bazel_tools" + ], + [ + "", + "blake3", + "blake3+" + ], + [ + "", + "c-ares", + "c-ares+" + ], + [ + "", + "com_github_grpc_grpc", + "grpc+" + ], + [ + "", + "com_google_protobuf", + "protobuf+" + ], + [ + "", + "googleapis", + "googleapis+" + ], + [ + "", + "grpc-java", + "grpc-java+" + ], + [ + "", + "io_bazel_skydoc", + "stardoc+" + ], + [ + "", + "platforms", + "platforms" + ], + [ + "", + "rules_cc", + "rules_cc+" + ], + [ + "", + "rules_go", + "rules_go+" + ], + [ + "", + "rules_graalvm", + "rules_graalvm+" + ], + [ + "", + "rules_java", + "rules_java+" + ], + [ + "", + "rules_jvm_external", + "rules_jvm_external+" + ], + [ + "", + "rules_kotlin", + "rules_kotlin+" + ], + [ + "", + "rules_license", + "rules_license+" + ], + [ + "", + "rules_pkg", + "rules_pkg+" + ], + [ + "", + "rules_proto", + "rules_proto+" + ], + [ + "", + "rules_python", + "rules_python+" + ], + [ + "", + "rules_shell", + "rules_shell+" + ], + [ + "", + "zlib", + "zlib+" + ], + [ + "", + "zstd-jni", + "zstd-jni+" + ] + ] + } + }, "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": { "general": { "bzlTransitiveDigest": "ltCGFbl/LQQZXn/LEMXfKX7pGwyqNiOCHcmiQW0tmjM=", diff --git a/maven_install.json b/maven_install.json index 3d67587dd163e7..8cbf84df1a7a1e 100644 --- a/maven_install.json +++ b/maven_install.json @@ -1,7 +1,7 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": 1401292213, - "__RESOLVED_ARTIFACTS_HASH": 1825399554, + "__INPUT_ARTIFACTS_HASH": -1894968954, + "__RESOLVED_ARTIFACTS_HASH": 1572252411, "conflict_resolution": { "com.google.api.grpc:proto-google-common-protos:2.29.0": "com.google.api.grpc:proto-google-common-protos:2.41.0", "com.google.auth:google-auth-library-credentials:1.6.0": "com.google.auth:google-auth-library-credentials:1.23.0", @@ -1014,12 +1014,6 @@ "jar": "880c9d896e4b74a06c549c15ca496450165d6909fa15d7e662bee8f6a66d7afa" }, "version": "2.0" - }, - "tools.profiler:async-profiler": { - "shasums": { - "jar": "8f798860049d01f4a2f853596d28c85d2983f0c098f165a32909b7da9c74209f" - }, - "version": "3.0" } }, "dependencies": { @@ -1068,7 +1062,9 @@ "com.google.auto:auto-common", "com.google.guava:guava" ], - "com.google.auto:auto-common": ["com.google.guava:guava"], + "com.google.auto:auto-common": [ + "com.google.guava:guava" + ], "com.google.caliper:caliper": [ "com.google.caliper:caliper-core", "com.google.caliper:caliper-runner", @@ -1136,14 +1132,18 @@ "org.ow2.asm:asm-tree", "org.ow2.asm:asm-util" ], - "com.google.dagger:dagger": ["javax.inject:javax.inject"], + "com.google.dagger:dagger": [ + "javax.inject:javax.inject" + ], "com.google.dagger:dagger-producers": [ "com.google.dagger:dagger", "com.google.guava:guava", "javax.inject:javax.inject", "org.checkerframework:checker-compat-qual" ], - "com.google.errorprone:error_prone_annotation": ["com.google.guava:guava"], + "com.google.errorprone:error_prone_annotation": [ + "com.google.guava:guava" + ], "com.google.errorprone:error_prone_check_api": [ "com.github.ben-manes.caffeine:caffeine", "com.github.kevinstern:software-and-algorithms", @@ -1170,12 +1170,16 @@ "org.jspecify:jspecify", "org.pcollections:pcollections" ], - "com.google.flogger:flogger": ["org.checkerframework:checker-compat-qual"], + "com.google.flogger:flogger": [ + "org.checkerframework:checker-compat-qual" + ], "com.google.flogger:flogger-system-backend": [ "com.google.flogger:flogger", "org.checkerframework:checker-compat-qual" ], - "com.google.flogger:google-extensions": ["com.google.flogger:flogger"], + "com.google.flogger:google-extensions": [ + "com.google.flogger:flogger" + ], "com.google.guava:guava": [ "com.google.code.findbugs:jsr305", "com.google.errorprone:error_prone_annotations", @@ -1207,7 +1211,9 @@ "com.google.code.gson:gson", "com.google.http-client:google-http-client" ], - "com.google.jimfs:jimfs": ["com.google.guava:guava"], + "com.google.jimfs:jimfs": [ + "com.google.guava:guava" + ], "com.google.oauth-client:google-oauth-client": [ "com.google.guava:guava", "com.google.http-client:google-http-client", @@ -1292,13 +1298,19 @@ "com.google.code.gson:gson", "io.sweers.autotransient:autotransient" ], - "com.squareup.okhttp:okhttp": ["com.squareup.okio:okio"], + "com.squareup.okhttp:okhttp": [ + "com.squareup.okio:okio" + ], "com.squareup.okio:okio": [ "org.jetbrains.kotlin:kotlin-stdlib", "org.jetbrains.kotlin:kotlin-stdlib-common" ], - "com.sun.jersey:jersey-client": ["com.sun.jersey:jersey-core"], - "com.sun.jersey:jersey-core": ["javax.ws.rs:jsr311-api"], + "com.sun.jersey:jersey-client": [ + "com.sun.jersey:jersey-core" + ], + "com.sun.jersey:jersey-core": [ + "javax.ws.rs:jsr311-api" + ], "io.grpc:grpc-api": [ "com.google.code.findbugs:jsr305", "com.google.errorprone:error_prone_annotations", @@ -1309,7 +1321,9 @@ "com.google.guava:guava", "io.grpc:grpc-api" ], - "io.grpc:grpc-context": ["io.grpc:grpc-api"], + "io.grpc:grpc-context": [ + "io.grpc:grpc-api" + ], "io.grpc:grpc-core": [ "com.google.android:annotations", "com.google.code.gson:gson", @@ -1361,7 +1375,9 @@ "io.grpc:grpc-core", "org.codehaus.mojo:animal-sniffer-annotations" ], - "io.netty:netty-buffer": ["io.netty:netty-common"], + "io.netty:netty-buffer": [ + "io.netty:netty-common" + ], "io.netty:netty-codec": [ "io.netty:netty-buffer", "io.netty:netty-common", @@ -1410,7 +1426,9 @@ "io.netty:netty-common", "io.netty:netty-transport" ], - "io.netty:netty-resolver": ["io.netty:netty-common"], + "io.netty:netty-resolver": [ + "io.netty:netty-common" + ], "io.netty:netty-resolver-dns": [ "io.netty:netty-buffer", "io.netty:netty-codec", @@ -1533,7 +1551,9 @@ "io.netty:netty-common", "io.netty:netty-transport" ], - "io.opencensus:opencensus-api": ["io.grpc:grpc-context"], + "io.opencensus:opencensus-api": [ + "io.grpc:grpc-context" + ], "io.opencensus:opencensus-contrib-grpc-metrics": [ "com.google.guava:guava", "io.opencensus:opencensus-api" @@ -1542,8 +1562,12 @@ "com.google.guava:guava", "io.opencensus:opencensus-api" ], - "io.reactivex.rxjava3:rxjava": ["org.reactivestreams:reactive-streams"], - "junit:junit": ["org.hamcrest:hamcrest-core"], + "io.reactivex.rxjava3:rxjava": [ + "org.reactivestreams:reactive-streams" + ], + "junit:junit": [ + "org.hamcrest:hamcrest-core" + ], "org.apache.commons:commons-compress": [ "commons-codec:commons-codec", "commons-io:commons-io", @@ -1559,7 +1583,9 @@ "org.jetbrains.kotlin:kotlin-metadata-jvm": [ "org.jetbrains.kotlin:kotlin-stdlib" ], - "org.jetbrains.kotlin:kotlin-stdlib": ["org.jetbrains:annotations"], + "org.jetbrains.kotlin:kotlin-stdlib": [ + "org.jetbrains:annotations" + ], "org.mockito:mockito-core": [ "net.bytebuddy:byte-buddy", "net.bytebuddy:byte-buddy-agent", @@ -1569,20 +1595,30 @@ "net.sf.jopt-simple:jopt-simple", "org.apache.commons:commons-math3" ], - "org.openjdk.jmh:jmh-generator-annprocess": ["org.openjdk.jmh:jmh-core"], - "org.osgi:org.osgi.util.function": ["org.osgi:osgi.annotation"], + "org.openjdk.jmh:jmh-generator-annprocess": [ + "org.openjdk.jmh:jmh-core" + ], + "org.osgi:org.osgi.util.function": [ + "org.osgi:osgi.annotation" + ], "org.osgi:org.osgi.util.promise": [ "org.osgi:org.osgi.util.function", "org.osgi:osgi.annotation" ], - "org.osgi:org.osgi.util.tracker": ["org.osgi:osgi.annotation"], - "org.ow2.asm:asm-analysis": ["org.ow2.asm:asm-tree"], + "org.osgi:org.osgi.util.tracker": [ + "org.osgi:osgi.annotation" + ], + "org.ow2.asm:asm-analysis": [ + "org.ow2.asm:asm-tree" + ], "org.ow2.asm:asm-commons": [ "org.ow2.asm:asm", "org.ow2.asm:asm-analysis", "org.ow2.asm:asm-tree" ], - "org.ow2.asm:asm-tree": ["org.ow2.asm:asm"], + "org.ow2.asm:asm-tree": [ + "org.ow2.asm:asm" + ], "org.ow2.asm:asm-util": [ "org.ow2.asm:asm", "org.ow2.asm:asm-analysis", @@ -1764,8 +1800,12 @@ "blogspot.software_and_algorithms.stern_library.optimization", "blogspot.software_and_algorithms.stern_library.string" ], - "com.github.stephenc.jcip:jcip-annotations": ["net.jcip.annotations"], - "com.google.android:annotations": ["android.annotation"], + "com.github.stephenc.jcip:jcip-annotations": [ + "net.jcip.annotations" + ], + "com.google.android:annotations": [ + "android.annotation" + ], "com.google.api-client:google-api-client": [ "com.google.api.client.googleapis", "com.google.api.client.googleapis.apache", @@ -1808,7 +1848,9 @@ "com.google.shopping.type", "com.google.type" ], - "com.google.auth:google-auth-library-credentials": ["com.google.auth"], + "com.google.auth:google-auth-library-credentials": [ + "com.google.auth" + ], "com.google.auth:google-auth-library-oauth2-http": [ "com.google.auth.http", "com.google.auth.oauth2" @@ -1863,7 +1905,9 @@ "com.google.auto.value.extension.serializable", "com.google.auto.value.extension.toprettystring" ], - "com.google.auto:auto-common": ["com.google.auto.common"], + "com.google.auto:auto-common": [ + "com.google.auto.common" + ], "com.google.caliper:caliper": [ "com.google.caliper.runner", "com.google.caliper.runner.instrument", @@ -1903,7 +1947,9 @@ "com.google.caliper.worker.handler", "com.google.caliper.worker.instrument" ], - "com.google.caliper:caliper-worker-jvm": ["com.google.caliper.worker"], + "com.google.caliper:caliper-worker-jvm": [ + "com.google.caliper.worker" + ], "com.google.code.findbugs:jsr305": [ "javax.annotation", "javax.annotation.concurrent", @@ -1962,7 +2008,9 @@ "dagger.producers.monitoring", "dagger.producers.monitoring.internal" ], - "com.google.errorprone:error_prone_annotation": ["com.google.errorprone"], + "com.google.errorprone:error_prone_annotation": [ + "com.google.errorprone" + ], "com.google.errorprone:error_prone_annotations": [ "com.google.errorprone.annotations", "com.google.errorprone.annotations.concurrent" @@ -2021,7 +2069,9 @@ "com.google.flogger:flogger-system-backend": [ "com.google.common.flogger.backend.system" ], - "com.google.flogger:google-extensions": ["com.google.common.flogger"], + "com.google.flogger:google-extensions": [ + "com.google.common.flogger" + ], "com.google.guava:failureaccess": [ "com.google.common.util.concurrent.internal" ], @@ -2079,8 +2129,12 @@ "com.google.http-client:google-http-client-gson": [ "com.google.api.client.json.gson" ], - "com.google.j2objc:j2objc-annotations": ["com.google.j2objc.annotations"], - "com.google.jimfs:jimfs": ["com.google.common.jimfs"], + "com.google.j2objc:j2objc-annotations": [ + "com.google.j2objc.annotations" + ], + "com.google.jimfs:jimfs": [ + "com.google.common.jimfs" + ], "com.google.oauth-client:google-oauth-client": [ "com.google.api.client.auth.oauth", "com.google.api.client.auth.oauth2", @@ -2090,8 +2144,12 @@ "com.google.protobuf", "com.google.protobuf.compiler" ], - "com.google.protobuf:protobuf-javalite": ["com.google.protobuf"], - "com.google.re2j:re2j": ["com.google.re2j"], + "com.google.protobuf:protobuf-javalite": [ + "com.google.protobuf" + ], + "com.google.re2j:re2j": [ + "com.google.re2j" + ], "com.google.testing.compile:compile-testing": [ "com.google.testing.compile" ], @@ -2104,7 +2162,9 @@ "com.google.truth.extensions:truth-proto-extension": [ "com.google.common.truth.extensions.proto" ], - "com.google.truth:truth": ["com.google.common.truth"], + "com.google.truth:truth": [ + "com.google.common.truth" + ], "com.google.turbine:turbine": [ "com.google.turbine.binder", "com.google.turbine.binder.bound", @@ -2293,8 +2353,13 @@ "com.squareup.okhttp.internal.io", "com.squareup.okhttp.internal.tls" ], - "com.squareup.okio:okio": ["okio", "okio.internal"], - "com.squareup:javapoet": ["com.squareup.javapoet"], + "com.squareup.okio:okio": [ + "okio", + "okio.internal" + ], + "com.squareup:javapoet": [ + "com.squareup.javapoet" + ], "com.sun.jersey:jersey-client": [ "com.sun.jersey.api.client", "com.sun.jersey.api.client.async", @@ -2383,7 +2448,9 @@ "org.apache.commons.lang.text", "org.apache.commons.lang.time" ], - "info.picocli:picocli": ["picocli"], + "info.picocli:picocli": [ + "picocli" + ], "io.github.eisop:dataflow-errorprone": [ "org.checkerframework.dataflow.qual", "org.checkerframework.errorprone.checker.builder.qual", @@ -2461,16 +2528,38 @@ "com.github.difflib.text", "com.github.difflib.unifieddiff" ], - "io.grpc:grpc-api": ["io.grpc"], - "io.grpc:grpc-auth": ["io.grpc.auth"], - "io.grpc:grpc-core": ["io.grpc.internal"], - "io.grpc:grpc-inprocess": ["io.grpc.inprocess"], - "io.grpc:grpc-netty": ["io.grpc.netty"], - "io.grpc:grpc-protobuf": ["io.grpc.protobuf"], - "io.grpc:grpc-protobuf-lite": ["io.grpc.protobuf.lite"], - "io.grpc:grpc-stub": ["io.grpc.stub", "io.grpc.stub.annotations"], - "io.grpc:grpc-util": ["io.grpc.util"], - "io.netty:netty-buffer": ["io.netty.buffer", "io.netty.buffer.search"], + "io.grpc:grpc-api": [ + "io.grpc" + ], + "io.grpc:grpc-auth": [ + "io.grpc.auth" + ], + "io.grpc:grpc-core": [ + "io.grpc.internal" + ], + "io.grpc:grpc-inprocess": [ + "io.grpc.inprocess" + ], + "io.grpc:grpc-netty": [ + "io.grpc.netty" + ], + "io.grpc:grpc-protobuf": [ + "io.grpc.protobuf" + ], + "io.grpc:grpc-protobuf-lite": [ + "io.grpc.protobuf.lite" + ], + "io.grpc:grpc-stub": [ + "io.grpc.stub", + "io.grpc.stub.annotations" + ], + "io.grpc:grpc-util": [ + "io.grpc.util" + ], + "io.netty:netty-buffer": [ + "io.netty.buffer", + "io.netty.buffer.search" + ], "io.netty:netty-codec": [ "io.netty.handler.codec", "io.netty.handler.codec.base64", @@ -2483,7 +2572,9 @@ "io.netty.handler.codec.string", "io.netty.handler.codec.xml" ], - "io.netty:netty-codec-dns": ["io.netty.handler.codec.dns"], + "io.netty:netty-codec-dns": [ + "io.netty.handler.codec.dns" + ], "io.netty:netty-codec-http": [ "io.netty.handler.codec.http", "io.netty.handler.codec.http.cookie", @@ -2495,7 +2586,9 @@ "io.netty.handler.codec.rtsp", "io.netty.handler.codec.spdy" ], - "io.netty:netty-codec-http2": ["io.netty.handler.codec.http2"], + "io.netty:netty-codec-http2": [ + "io.netty.handler.codec.http2" + ], "io.netty:netty-codec-socks": [ "io.netty.handler.codec.socks", "io.netty.handler.codec.socksx", @@ -2527,10 +2620,18 @@ "io.netty.handler.timeout", "io.netty.handler.traffic" ], - "io.netty:netty-handler-proxy": ["io.netty.handler.proxy"], - "io.netty:netty-resolver": ["io.netty.resolver"], - "io.netty:netty-resolver-dns": ["io.netty.resolver.dns"], - "io.netty:netty-tcnative-classes": ["io.netty.internal.tcnative"], + "io.netty:netty-handler-proxy": [ + "io.netty.handler.proxy" + ], + "io.netty:netty-resolver": [ + "io.netty.resolver" + ], + "io.netty:netty-resolver-dns": [ + "io.netty.resolver.dns" + ], + "io.netty:netty-tcnative-classes": [ + "io.netty.internal.tcnative" + ], "io.netty:netty-transport": [ "io.netty.bootstrap", "io.netty.channel", @@ -2545,9 +2646,15 @@ "io.netty.channel.socket.nio", "io.netty.channel.socket.oio" ], - "io.netty:netty-transport-classes-epoll": ["io.netty.channel.epoll"], - "io.netty:netty-transport-classes-kqueue": ["io.netty.channel.kqueue"], - "io.netty:netty-transport-native-unix-common": ["io.netty.channel.unix"], + "io.netty:netty-transport-classes-epoll": [ + "io.netty.channel.epoll" + ], + "io.netty:netty-transport-classes-kqueue": [ + "io.netty.channel.kqueue" + ], + "io.netty:netty-transport-native-unix-common": [ + "io.netty.channel.unix" + ], "io.netty:netty-transport-native-unix-common:jar:linux-aarch_64": [ "io.netty.channel.unix" ], @@ -2586,7 +2693,9 @@ "io.opencensus.contrib.http", "io.opencensus.contrib.http.util" ], - "io.perfmark:perfmark-api": ["io.perfmark"], + "io.perfmark:perfmark-api": [ + "io.perfmark" + ], "io.reactivex.rxjava3:rxjava": [ "io.reactivex.rxjava3.annotations", "io.reactivex.rxjava3.core", @@ -2621,7 +2730,9 @@ "io.reactivex.rxjava3.subjects", "io.reactivex.rxjava3.subscribers" ], - "io.sweers.autotransient:autotransient": ["io.sweers.autotransient"], + "io.sweers.autotransient:autotransient": [ + "io.sweers.autotransient" + ], "it.unimi.dsi:fastutil": [ "it.unimi.dsi.fastutil", "it.unimi.dsi.fastutil.booleans", @@ -2635,13 +2746,17 @@ "it.unimi.dsi.fastutil.objects", "it.unimi.dsi.fastutil.shorts" ], - "javax.activation:javax.activation-api": ["javax.activation"], + "javax.activation:javax.activation-api": [ + "javax.activation" + ], "javax.annotation:javax.annotation-api": [ "javax.annotation", "javax.annotation.security", "javax.annotation.sql" ], - "javax.inject:javax.inject": ["javax.inject"], + "javax.inject:javax.inject": [ + "javax.inject" + ], "javax.ws.rs:jsr311-api": [ "javax.ws.rs", "javax.ws.rs.core", @@ -3095,8 +3210,12 @@ "org.intellij.lang.annotations", "org.jetbrains.annotations" ], - "org.json:json": ["org.json"], - "org.jspecify:jspecify": ["org.jspecify.annotations"], + "org.json:json": [ + "org.json" + ], + "org.jspecify:jspecify": [ + "org.jspecify.annotations" + ], "org.mockito:mockito-core": [ "org.mockito", "org.mockito.codegen", @@ -3194,7 +3313,9 @@ "org.openjdk.jmh.generators", "org.openjdk.jmh.generators.annotations" ], - "org.osgi:org.osgi.dto": ["org.osgi.dto"], + "org.osgi:org.osgi.dto": [ + "org.osgi.dto" + ], "org.osgi:org.osgi.framework": [ "org.osgi.framework", "org.osgi.framework.dto", @@ -3213,22 +3334,47 @@ "org.osgi.resource", "org.osgi.resource.dto" ], - "org.osgi:org.osgi.service.log": ["org.osgi.service.log"], - "org.osgi:org.osgi.service.repository": ["org.osgi.service.repository"], - "org.osgi:org.osgi.util.function": ["org.osgi.util.function"], - "org.osgi:org.osgi.util.promise": ["org.osgi.util.promise"], - "org.osgi:org.osgi.util.tracker": ["org.osgi.util.tracker"], + "org.osgi:org.osgi.service.log": [ + "org.osgi.service.log" + ], + "org.osgi:org.osgi.service.repository": [ + "org.osgi.service.repository" + ], + "org.osgi:org.osgi.util.function": [ + "org.osgi.util.function" + ], + "org.osgi:org.osgi.util.promise": [ + "org.osgi.util.promise" + ], + "org.osgi:org.osgi.util.tracker": [ + "org.osgi.util.tracker" + ], "org.osgi:osgi.annotation": [ "org.osgi.annotation.bundle", "org.osgi.annotation.versioning" ], - "org.ow2.asm:asm": ["org.objectweb.asm", "org.objectweb.asm.signature"], - "org.ow2.asm:asm-analysis": ["org.objectweb.asm.tree.analysis"], - "org.ow2.asm:asm-commons": ["org.objectweb.asm.commons"], - "org.ow2.asm:asm-tree": ["org.objectweb.asm.tree"], - "org.ow2.asm:asm-util": ["org.objectweb.asm.util"], - "org.pcollections:pcollections": ["org.pcollections"], - "org.reactivestreams:reactive-streams": ["org.reactivestreams"], + "org.ow2.asm:asm": [ + "org.objectweb.asm", + "org.objectweb.asm.signature" + ], + "org.ow2.asm:asm-analysis": [ + "org.objectweb.asm.tree.analysis" + ], + "org.ow2.asm:asm-commons": [ + "org.objectweb.asm.commons" + ], + "org.ow2.asm:asm-tree": [ + "org.objectweb.asm.tree" + ], + "org.ow2.asm:asm-util": [ + "org.objectweb.asm.util" + ], + "org.pcollections:pcollections": [ + "org.pcollections" + ], + "org.reactivestreams:reactive-streams": [ + "org.reactivestreams" + ], "org.slf4j:slf4j-api": [ "org.slf4j", "org.slf4j.event", @@ -3275,8 +3421,7 @@ "org.yaml.snakeyaml.serializer", "org.yaml.snakeyaml.tokens", "org.yaml.snakeyaml.util" - ], - "tools.profiler:async-profiler": ["one.profiler"] + ] }, "repositories": { "https://repo1.maven.org/maven2/": [ @@ -3452,8 +3597,7 @@ "org.slf4j:slf4j-api", "org.threeten:threeten-extra", "org.tukaani:xz", - "org.yaml:snakeyaml", - "tools.profiler:async-profiler" + "org.yaml:snakeyaml" ] }, "services": { @@ -3588,8 +3732,12 @@ "io.grpc.netty.NettyChannelProvider", "io.grpc.netty.UdsNettyChannelProvider" ], - "io.grpc.NameResolverProvider": ["io.grpc.netty.UdsNameResolverProvider"], - "io.grpc.ServerProvider": ["io.grpc.netty.NettyServerProvider"] + "io.grpc.NameResolverProvider": [ + "io.grpc.netty.UdsNameResolverProvider" + ], + "io.grpc.ServerProvider": [ + "io.grpc.netty.NettyServerProvider" + ] }, "io.grpc:grpc-util": { "io.grpc.LoadBalancerProvider": [ diff --git a/repositories.bzl b/repositories.bzl index 208ac98822cf27..34e5c2c26c2098 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -15,7 +15,7 @@ """ -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") load("//src/tools/bzlmod:utils.bzl", "get_canonical_repo_name") ################################################################################## @@ -27,6 +27,10 @@ DIST_ARCHIVE_REPOS = [get_canonical_repo_name(repo) for repo in [ # keep sorted "abseil-cpp", "apple_support", + "async_profiler", + "async_profiler_linux_arm64", + "async_profiler_linux_x64", + "async_profiler_macos", "bazel_skylib", "blake3", "c-ares", @@ -74,49 +78,108 @@ def embedded_jdk_repositories(): """OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.""" http_file( name = "openjdk_linux_vanilla", - integrity = "sha256-UyCjNxT1jAEEGR0kR1napqbUaBnURzR7qQAxMuVInZI=", + integrity = "sha256-rAFnZr8+a29vrXmSXwUQ7rgX6G8DgPvAioHSdU64kJI=", downloaded_file_path = "zulu-linux-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_x64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu23.30.13-ca-jdk23.0.1-linux_x64.tar.gz", ) http_file( name = "openjdk_linux_aarch64_vanilla", - integrity = "sha256-i9OHMVYgu2aoSUWlG867kBY1S1V8dH6U1IN+aOpAd+w=", + integrity = "sha256-YsWDS56XxBqVacn8HoiUhPL3bongmOyj5tSkN5RREW8=", downloaded_file_path = "zulu-linux-aarch64-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-linux_aarch64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu23.30.13-ca-jdk23.0.1-linux_aarch64.tar.gz", ) http_file( name = "openjdk_linux_s390x_vanilla", - integrity = "sha256-UafKQswujLXz56MmwokS7oT/B5GhymZlCoxTrwdRCnw=", + integrity = "sha256-OUGdcggvrqbSUBIj8cv2qRKLwjAArft7fues/OQiUJw=", downloaded_file_path = "adoptopenjdk-s390x-vanilla.tar.gz", - url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jdk_s390x_linux_hotspot_21.0.5_11.tar.gz", + url = "https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jdk_s390x_linux_hotspot_23.0.1_11.tar.gz", ) http_file( name = "openjdk_linux_ppc64le_vanilla", - integrity = "sha256-PG9MNY+s+2wZ2Q+vAr/g/HUS1rDoCsGBRrvX4NAd7u8=", + integrity = "sha256-GIWrFB/nuO1r63e4FLHByZ/VRxM5m/kX7bakAgVFrd4=", downloaded_file_path = "adoptopenjdk-ppc64le-vanilla.tar.gz", - url = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.5%2B11/OpenJDK21U-jdk_ppc64le_linux_hotspot_21.0.5_11.tar.gz", + url = "https://github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%2B11/OpenJDK23U-jdk_ppc64le_linux_hotspot_23.0.1_11.tar.gz", ) http_file( name = "openjdk_macos_x86_64_vanilla", - integrity = "sha256-zXTl63OMkUWdS45eEOrJGK4qBdIan8fKXcLaZOZbzr0=", + integrity = "sha256-aYyf1SKQGgO5wPb+fBfJg19s+qUVmHvemh6xDwXQtpc=", downloaded_file_path = "zulu-macos-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_x64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu23.30.13-ca-jdk23.0.1-macosx_x64.tar.gz", ) http_file( name = "openjdk_macos_aarch64_vanilla", - integrity = "sha256-gP/CXfeblVZTGNv8gwnFFXJv9C6b21MwYe3HrSbxPfI=", + integrity = "sha256-OIXfVgx6ipx3uALCLcGUbNLuEp2d/NdFWKj/npRZ5s8=", downloaded_file_path = "zulu-macos-aarch64-vanilla.tar.gz", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-macosx_aarch64.tar.gz", + url = "https://cdn.azul.com/zulu/bin/zulu23.30.13-ca-jdk23.0.1-macosx_aarch64.tar.gz", ) http_file( name = "openjdk_win_vanilla", - integrity = "sha256-jepE/TpvetD0LzirwTcQdXELWL7ZvY8JPC7y1FDdJnI=", + integrity = "sha256-wnqLLUrcL778vxk874CEJJHs1pclQU0w5Z5RR2nzWMw=", downloaded_file_path = "zulu-win-vanilla.zip", - url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_x64.zip", + url = "https://cdn.azul.com/zulu/bin/zulu23.30.13-ca-jdk23.0.1-win_x64.zip", ) + + # Later version of the JDK for Windows ARM64 are not available yet. http_file( name = "openjdk_win_arm64_vanilla", integrity = "sha256-9a1/U5900StiSMD9n0tBZFXc9oA5ALKOjRkFTz3Mbpg=", downloaded_file_path = "zulu-win-arm64.zip", url = "https://cdn.azul.com/zulu/bin/zulu21.38.21-ca-jdk21.0.5-win_aarch64.zip", ) + +def _async_profiler_repos(ctx): + http_file( + name = "async_profiler", + downloaded_file_path = "async-profiler.jar", + # At commit f0ceda6356f05b7ad0a6593670c8c113113bf0b3 (2024-12-09). + sha256 = "da95a5292fb203966196ecb68a39a8c26ad7276aeef642ec1de872513be1d8b3", + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler.jar"], + ) + + _ASYNC_PROFILER_BUILD_TEMPLATE = """ +load("@bazel_skylib//rules:copy_file.bzl", "copy_file") + +copy_file( + name = "libasyncProfiler", + src = "libasyncProfiler.{ext}", + out = "{tag}/libasyncProfiler.so", + visibility = ["//visibility:public"], +) +""" + + http_archive( + name = "async_profiler_linux_arm64", + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( + ext = "so", + tag = "linux-arm64", + ), + sha256 = "7c6243bb91272a2797acb8cc44acf3e406e0b658a94d90d9391ca375fc961857", + strip_prefix = "async-profiler-3.0-f0ceda6-linux-arm64/lib", + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-arm64.tar.gz"], + ) + + http_archive( + name = "async_profiler_linux_x64", + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( + ext = "so", + tag = "linux-x64", + ), + sha256 = "448a3dc681375860eba2264d6cae7a848bd3f07f81f547a9ce58b742a1541d25", + strip_prefix = "async-profiler-3.0-f0ceda6-linux-x64/lib", + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-linux-x64.tar.gz"], + ) + + http_archive( + name = "async_profiler_macos", + build_file_content = _ASYNC_PROFILER_BUILD_TEMPLATE.format( + ext = "dylib", + tag = "macos", + ), + sha256 = "0651004c78d080f67763cddde6e1f58cd0d0c4cb0b57034beef80b450ff5adf2", + strip_prefix = "async-profiler-3.0-f0ceda6-macos/lib", + urls = ["https://mirror.bazel.build/github.com/async-profiler/async-profiler/releases/download/nightly/async-profiler-3.0-f0ceda6-macos.zip"], + ) + +# This is an extension (instead of use_repo_rule usages) only to create a +# lockfile entry for the distribution repo module extension. +async_profiler_repos = module_extension(_async_profiler_repos) diff --git a/src/main/java/com/google/devtools/build/lib/profiler/BUILD b/src/main/java/com/google/devtools/build/lib/profiler/BUILD index eb8a7b2a9e5c50..734f78251f837d 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/BUILD +++ b/src/main/java/com/google/devtools/build/lib/profiler/BUILD @@ -81,10 +81,10 @@ java_library( "//src/main/java/com/google/devtools/build/lib/events", "//src/main/java/com/google/devtools/build/lib/vfs", "//src/main/java/com/google/devtools/common/options", + "//third_party:async_profiler", "//third_party:flogger", "//third_party:guava", "//third_party:jsr305", - "@maven//:tools_profiler_async_profiler", ], ) diff --git a/src/tools/bzlmod/blazel_utils.bzl b/src/tools/bzlmod/blazel_utils.bzl index 0ad4d4ab6a3fdd..6cf12020299c57 100644 --- a/src/tools/bzlmod/blazel_utils.bzl +++ b/src/tools/bzlmod/blazel_utils.bzl @@ -20,3 +20,10 @@ def get_canonical_repo_name(apparent_repo_name): apparent_repo_name = "@" + apparent_repo_name return Label(apparent_repo_name).workspace_name + +def get_repo_root(apparent_repo_name): + """Returns the directory of the repo with the given apparent repo name seen by the module this bzl file belongs to.""" + if not apparent_repo_name.startswith("@"): + apparent_repo_name = "@" + apparent_repo_name + + return Label(apparent_repo_name).workspace_root diff --git a/src/tools/bzlmod/utils.bzl b/src/tools/bzlmod/utils.bzl index eaf3ed83652ba2..79ddf4391ee35f 100644 --- a/src/tools/bzlmod/utils.bzl +++ b/src/tools/bzlmod/utils.bzl @@ -14,9 +14,10 @@ """Helper functions for Bzlmod build""" -load(":blazel_utils.bzl", _get_canonical_repo_name = "get_canonical_repo_name") +load(":blazel_utils.bzl", _get_canonical_repo_name = "get_canonical_repo_name", _get_repo_root = "get_repo_root") get_canonical_repo_name = _get_canonical_repo_name +get_repo_root = _get_repo_root def extract_url(attributes): """Extracts the url from the given attributes. diff --git a/third_party/BUILD b/third_party/BUILD index 7d2789f10acd71..6550d6ded71dbc 100644 --- a/third_party/BUILD +++ b/third_party/BUILD @@ -1,5 +1,6 @@ load("@rules_java//java:defs.bzl", "java_import", "java_library", "java_plugin") load("@rules_license//rules:license.bzl", "license") +load("//src/tools/bzlmod:utils.bzl", "get_repo_root") load("//tools/distributions:distribution_rules.bzl", "distrib_jar_filegroup", "distrib_java_import") package(default_visibility = ["//visibility:public"]) @@ -275,6 +276,28 @@ distrib_jar_filegroup( enable_distributions = ["debian"], ) +java_import( + name = "async_profiler", + jars = ["@async_profiler//file"], + runtime_deps = [":async_profiler_native"], +) + +java_library( + name = "async_profiler_native", + resource_strip_prefix = select({ + "//src/conditions:darwin": get_repo_root("async_profiler_macos"), + "//src/conditions:linux_arm": get_repo_root("async_profiler_linux_arm64"), + "//src/conditions:linux_x86_64": get_repo_root("async_profiler_linux_x64"), + "//conditions:default": None, + }), + resources = select({ + "//src/conditions:darwin": ["@async_profiler_macos//:libasyncProfiler"], + "//src/conditions:linux_arm": ["@async_profiler_linux_arm64//:libasyncProfiler"], + "//src/conditions:linux_x86_64": ["@async_profiler_linux_x64//:libasyncProfiler"], + "//conditions:default": [], + }), +) + alias( name = "checker_framework_annotations", actual = "@maven//:org_checkerframework_checker_qual", diff --git a/tools/BUILD.tools b/tools/BUILD.tools index de8f676127b28f..7ce6fba5d8de2a 100644 --- a/tools/BUILD.tools +++ b/tools/BUILD.tools @@ -23,4 +23,4 @@ filegroup( "//tools/test:bzl_srcs", "//tools/windows:bzl_srcs", ], -) \ No newline at end of file +)