From ed029a9b8ddb83803bf053ace88cad52db41e919 Mon Sep 17 00:00:00 2001 From: Haiko Schol Date: Tue, 23 Jan 2024 18:28:17 +0700 Subject: [PATCH] feat(package-manager): Add initial support for Bazel This is based on #264. Signed-off-by: Haiko Schol --- .../BazelModuleRegistryClientFunTest.kt | 10 +- .../main/kotlin/BazelModuleRegistryClient.kt | 15 +- .../src/main/kotlin/Model.kt | 4 +- .../package-managers/bazel/build.gradle.kts | 60 + .../src/funTest/assets/fixtures/MODULE.bazel | 5 + .../funTest/assets/fixtures/MODULE.bazel.lock | 1535 +++++++++++++++++ .../fixtures/bazel_mod_graph_output.json | 78 + .../assets/fixtures/bazel_query_output.txt | 720 ++++++++ .../synthetic/project-expected-output.yml | 235 +++ .../projects/synthetic/project/MODULE.bazel | 3 + .../projects/synthetic/project/lib/BUILD | 7 + .../synthetic/project/lib/cookie-jar.cc | 5 + .../synthetic/project/lib/cookie-jar.h | 6 + .../projects/synthetic/project/main/BUILD | 11 + .../projects/synthetic/project/main/main.cc | 10 + .../synthetic/project/test/BUILD.bazel | 11 + .../synthetic/project/test/cookies.cc | 8 + .../projects/synthetic/project/test/main.cc | 7 + .../bazel/src/funTest/kotlin/BazelFunTest.kt | 40 + .../bazel/src/main/kotlin/Bazel.kt | 221 +++ .../bazel/src/main/kotlin/BazelModel.kt | 119 ++ .../bazel/src/main/kotlin/StarlarkParser.kt | 239 +++ ...viewtoolkit.analyzer.PackageManagerFactory | 1 + .../bazel/src/test/kotlin/BazelTest.kt | 113 ++ .../src/test/kotlin/StarlarkParserTest.kt | 170 ++ website/docs/tools/analyzer.md | 3 + 26 files changed, 3620 insertions(+), 16 deletions(-) create mode 100644 plugins/package-managers/bazel/build.gradle.kts create mode 100644 plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel create mode 100644 plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel.lock create mode 100644 plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_mod_graph_output.json create mode 100644 plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_query_output.txt create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project-expected-output.yml create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/MODULE.bazel create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/BUILD create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.cc create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.h create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/BUILD create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/main.cc create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/BUILD.bazel create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/cookies.cc create mode 100644 plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/main.cc create mode 100644 plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt create mode 100644 plugins/package-managers/bazel/src/main/kotlin/Bazel.kt create mode 100644 plugins/package-managers/bazel/src/main/kotlin/BazelModel.kt create mode 100644 plugins/package-managers/bazel/src/main/kotlin/StarlarkParser.kt create mode 100644 plugins/package-managers/bazel/src/main/resources/META-INF/services/org.ossreviewtoolkit.analyzer.PackageManagerFactory create mode 100644 plugins/package-managers/bazel/src/test/kotlin/BazelTest.kt create mode 100644 plugins/package-managers/bazel/src/test/kotlin/StarlarkParserTest.kt diff --git a/clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryClientFunTest.kt b/clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryClientFunTest.kt index 8ba41c5a52cc5..615d3fb6f5086 100644 --- a/clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryClientFunTest.kt +++ b/clients/bazel-module-registry/src/funTest/kotlin/BazelModuleRegistryClientFunTest.kt @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021 The ORT Project Authors (see ) + * Copyright (C) 2024 The ORT Project Authors (see ) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,13 @@ import io.kotest.matchers.collections.shouldContain import io.kotest.matchers.comparables.shouldBeGreaterThan import io.kotest.matchers.shouldBe -class BazelModuleRegistryClientTest : WordSpec({ - val service = BazelModuleRegistryClient.create() +class BazelModuleRegistryClientFunTest : WordSpec({ + val client = BazelModuleRegistryClient.create() val repoUrl = "https://github.com/google/glog" "getModuleMetadata" should { "include a homepage URL and version 0.5.0 for the 'glog' module" { - val metadata = service.getModuleMetadata("glog") + val metadata = client.getModuleMetadata("glog") metadata.homepage.toString() shouldBe repoUrl metadata.versions.size shouldBeGreaterThan 1 @@ -40,7 +40,7 @@ class BazelModuleRegistryClientTest : WordSpec({ "getModuleSource" should { "include URL and hash data" { - val sourceInfo = service.getModuleSourceInfo("glog", "0.5.0") + val sourceInfo = client.getModuleSourceInfo("glog", "0.5.0") sourceInfo.url.toString() shouldBe "$repoUrl/archive/refs/tags/v0.5.0.tar.gz" sourceInfo.integrity shouldBe "sha256-7t5x8oNxvzmqabRd4jsynTchQBbiBVJps7Xnz9QLWfU=" diff --git a/clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryClient.kt b/clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryClient.kt index e217846edbe39..eec966863ce6d 100644 --- a/clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryClient.kt +++ b/clients/bazel-module-registry/src/main/kotlin/BazelModuleRegistryClient.kt @@ -39,25 +39,22 @@ private val JSON = Json { namingStrategy = JsonNamingStrategy.SnakeCase } -/** - * The service uses the Bazel Central Registry by default. - */ -private const val DEFAULT_URL = "https://bcr.bazel.build" - /** * Interface for a Bazel Module Registry, based on the directory structure of https://bcr.bazel.build * and the git repository it is based on (https://github.com/bazelbuild/bazel-central-registry/). */ interface BazelModuleRegistryClient { companion object { + /** + * The service uses the Bazel Central Registry by default. + */ + const val DEFAULT_URL = "https://bcr.bazel.build" + /** * Create a Bazel Module Registry service instance for communicating with a server running at the given [url], * defaulting to the Bazel Central Registry, optionally with a pre-built OkHttp [client]. */ - fun create( - url: String? = null, - client: OkHttpClient? = null - ): BazelModuleRegistryClient { + fun create(url: String? = null, client: OkHttpClient? = null): BazelModuleRegistryClient { val bmrClient = client ?: OkHttpClient() val contentType = "application/json".toMediaType() diff --git a/clients/bazel-module-registry/src/main/kotlin/Model.kt b/clients/bazel-module-registry/src/main/kotlin/Model.kt index f004b5d53f5c7..55c77ac894033 100644 --- a/clients/bazel-module-registry/src/main/kotlin/Model.kt +++ b/clients/bazel-module-registry/src/main/kotlin/Model.kt @@ -43,7 +43,7 @@ data class ModuleMetadata( val repository: List? = null, val versions: List, // The key in the map is the version, the value the reason for yanking it. - val yankedVersions: Map, + val yankedVersions: Map ) { @Serializable data class Maintainer( @@ -61,5 +61,5 @@ data class ModuleSourceInfo( val patchStrip: Int? = null, val patches: Map? = null, val stripPrefix: String? = null, - @Serializable(URISerializer::class) val url: URI, + @Serializable(URISerializer::class) val url: URI ) diff --git a/plugins/package-managers/bazel/build.gradle.kts b/plugins/package-managers/bazel/build.gradle.kts new file mode 100644 index 0000000000000..4c42a377fa726 --- /dev/null +++ b/plugins/package-managers/bazel/build.gradle.kts @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + // Apply precompiled plugins. + id("ort-library-conventions") + + // Apply third-party plugins. + alias(libs.plugins.kotlinSerialization) +} + +dependencies { + api(projects.analyzer) + api(projects.model) + api(projects.utils.commonUtils) { + because("This is a CommandLineTool.") + } + + api(libs.semver4j) { + because("This is a CommandLineTool.") + } + + implementation(projects.downloader) + implementation(projects.clients.bazelModuleRegistryClient) + implementation(projects.utils.ortUtils) + implementation(projects.utils.spdxUtils) + + implementation(libs.bundles.kotlinxSerialization) + implementation(libs.kotlinx.coroutines) + + funTestImplementation(testFixtures(projects.analyzer)) +} + +tasks.withType().configureEach { + val customCompilerArgs = listOf( + "-opt-in=kotlinx.serialization.ExperimentalSerializationApi" + ) + + compilerOptions { + freeCompilerArgs.addAll(customCompilerArgs) + } +} diff --git a/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel b/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel new file mode 100644 index 0000000000000..d97ffe29a8576 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel @@ -0,0 +1,5 @@ +module(name="bazel-test-module", version="0.42.23", compatibility_level=0) + +bazel_dep(name = "glog", version = "0.5.0", repo_name = "com_github_google_glog") +bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest", dev_dependency = True) + diff --git a/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel.lock b/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel.lock new file mode 100644 index 0000000000000..4089071da02cf --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/fixtures/MODULE.bazel.lock @@ -0,0 +1,1535 @@ +{ + "lockFileVersion": 3, + "moduleFileHash": "fd6394b9fc120f8c268f24bd0eeb4754350da0323e72824894777f563fb03df0", + "flags": { + "cmdRegistries": [ + "https://registry.example.com/" + ], + "cmdModuleOverrides": {}, + "allowedYankedVersions": [], + "envVarAllowedYankedVersions": "", + "ignoreDevDependency": false, + "directDependenciesMode": "WARNING", + "compatibilityMode": "ERROR" + }, + "localOverrideHashes": { + "bazel_tools": "922ea6752dc9105de5af957f7a99a6933c0a6a712d23df6aad16a9c399f7e787" + }, + "moduleDepGraph": { + "": { + "name": "", + "version": "", + "key": "", + "repoName": "", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_github_google_glog": "glog@0.5.0", + "com_google_googletest": "googletest@1.14.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + } + }, + "glog@0.5.0": { + "name": "glog", + "version": "0.5.0", + "key": "glog@0.5.0", + "repoName": "glog", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_github_gflags_gflags": "gflags@2.2.2", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "glog~0.5.0", + "urls": [ + "https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz" + ], + "integrity": "sha256-7t5x8oNxvzmqabRd4jsynTchQBbiBVJps7Xnz9QLWfU=", + "strip_prefix": "glog-0.5.0", + "remote_patches": { + "https://bcr.bazel.build/modules/glog/0.5.0/patches/remove_only_the_first_leading_at.patch": "sha256-ieceuBwB5MiGzs1ES3FKKLTCuHwxxERo2clZn5h8S3g=", + "https://bcr.bazel.build/modules/glog/0.5.0/patches/module_dot_bazel.patch": "sha256-MRfd07vZhtuP1CiKn4zLeP2kRCgt1pZgMkt52mBect4=" + }, + "remote_patch_strip": 1 + } + } + }, + "googletest@1.14.0": { + "name": "googletest", + "version": "1.14.0", + "key": "googletest@1.14.0", + "repoName": "googletest", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "com_google_absl": "abseil-cpp@20230125.1", + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "googletest~1.14.0", + "urls": [ + "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" + ], + "integrity": "sha256-itWYxzrXluDYKAsILOvYKmMNc+c808cAV5OKZQG7pdc=", + "strip_prefix": "googletest-1.14.0", + "remote_patches": { + "https://bcr.bazel.build/modules/googletest/1.14.0/patches/module_dot_bazel.patch": "sha256-CSomzvti38LCuURDG5EEoa3O1tQF3cKKt/mknnP1qcc=" + }, + "remote_patch_strip": 0 + } + } + }, + "bazel_tools@_": { + "name": "bazel_tools", + "version": "", + "key": "bazel_tools@_", + "repoName": "bazel_tools", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all", + "@local_config_sh//:local_sh_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 17, + "column": 29 + }, + "imports": { + "local_config_cc": "local_config_cc", + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/osx:xcode_configure.bzl", + "extensionName": "xcode_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 21, + "column": 32 + }, + "imports": { + "local_config_xcode": "local_config_xcode" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 24, + "column": 32 + }, + "imports": { + "local_jdk": "local_jdk", + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/sh:sh_configure.bzl", + "extensionName": "sh_configure_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 35, + "column": 39 + }, + "imports": { + "local_config_sh": "local_config_sh" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/test:extensions.bzl", + "extensionName": "remote_coverage_tools_extension", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 39, + "column": 48 + }, + "imports": { + "remote_coverage_tools": "remote_coverage_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@bazel_tools//tools/android:android_extensions.bzl", + "extensionName": "remote_android_tools_extensions", + "usingModule": "bazel_tools@_", + "location": { + "file": "@@bazel_tools//:MODULE.bazel", + "line": 42, + "column": 42 + }, + "imports": { + "android_gmaven_r8": "android_gmaven_r8", + "android_tools": "android_tools" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "rules_java": "rules_java@7.1.0", + "rules_license": "rules_license@0.0.7", + "rules_proto": "rules_proto@4.0.0", + "rules_python": "rules_python@0.4.0", + "platforms": "platforms@0.0.7", + "com_google_protobuf": "protobuf@3.19.6", + "zlib": "zlib@1.3", + "build_bazel_apple_support": "apple_support@1.5.0", + "local_config_platform": "local_config_platform@_" + } + }, + "local_config_platform@_": { + "name": "local_config_platform", + "version": "", + "key": "local_config_platform@_", + "repoName": "local_config_platform", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_" + } + }, + "gflags@2.2.2": { + "name": "gflags", + "version": "2.2.2", + "key": "gflags@2.2.2", + "repoName": "gflags", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "gflags~2.2.2", + "urls": [ + "https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz" + ], + "integrity": "sha256-NK8vFc9zZ1E7NSvc0kk6sUzkNpLS3NnfxJlJKWbGTc8=", + "strip_prefix": "gflags-2.2.2", + "remote_patches": { + "https://bcr.bazel.build/modules/gflags/2.2.2/patches/module_dot_bazel.patch": "sha256-BVSk+8ijV+s6djcokSgSZGlP153Q+rvF2h9W/AG53Zo=" + }, + "remote_patch_strip": 0 + } + } + }, + "abseil-cpp@20230125.1": { + "name": "abseil-cpp", + "version": "20230125.1", + "key": "abseil-cpp@20230125.1", + "repoName": "abseil-cpp", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_cc": "rules_cc@0.0.9", + "platforms": "platforms@0.0.7", + "bazel_skylib": "bazel_skylib@1.4.1", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "abseil-cpp~20230125.1", + "urls": [ + "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.1.tar.gz" + ], + "integrity": "sha256-gTEcF1mbNxIGne0gzKCaYqsL8qid+haZN4bIeCt+0UU=", + "strip_prefix": "abseil-cpp-20230125.1", + "remote_patches": { + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/patches/module_dot_bazel.patch": "sha256-L1wChhBmDOnRbPbD4MENVXHjOBT2KFrDxT6D+aoThxk=" + }, + "remote_patch_strip": 0 + } + } + }, + "platforms@0.0.7": { + "name": "platforms", + "version": "0.0.7", + "key": "platforms@0.0.7", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "platforms", + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" + ], + "integrity": "sha256-OlYcmee9vpFzqmU/1Xn+hJ8djWc5V4CrR3Cx84FDHVE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_cc@0.0.9": { + "name": "rules_cc", + "version": "0.0.9", + "key": "rules_cc@0.0.9", + "repoName": "rules_cc", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@bazel_tools//tools/cpp:cc_configure.bzl", + "extensionName": "cc_configure_extension", + "usingModule": "rules_cc@0.0.9", + "location": { + "file": "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel", + "line": 9, + "column": 29 + }, + "imports": { + "local_config_cc_toolchains": "local_config_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_cc~0.0.9", + "urls": [ + "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + ], + "integrity": "sha256-IDeHW5pEVtzkp50RKorohbvEqtlo5lh9ym5k86CQDN8=", + "strip_prefix": "rules_cc-0.0.9", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_cc/0.0.9/patches/module_dot_bazel_version.patch": "sha256-mM+qzOI0SgAdaJBlWOSMwMPKpaA9b7R37Hj/tp5bb4g=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_java@7.1.0": { + "name": "rules_java", + "version": "7.1.0", + "key": "rules_java@7.1.0", + "repoName": "rules_java", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains:all", + "@local_jdk//:runtime_toolchain_definition", + "@local_jdk//:bootstrap_runtime_toolchain_definition", + "@remotejdk11_linux_toolchain_config_repo//:all", + "@remotejdk11_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk11_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk11_linux_s390x_toolchain_config_repo//:all", + "@remotejdk11_macos_toolchain_config_repo//:all", + "@remotejdk11_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk11_win_toolchain_config_repo//:all", + "@remotejdk11_win_arm64_toolchain_config_repo//:all", + "@remotejdk17_linux_toolchain_config_repo//:all", + "@remotejdk17_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk17_linux_ppc64le_toolchain_config_repo//:all", + "@remotejdk17_linux_s390x_toolchain_config_repo//:all", + "@remotejdk17_macos_toolchain_config_repo//:all", + "@remotejdk17_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk17_win_toolchain_config_repo//:all", + "@remotejdk17_win_arm64_toolchain_config_repo//:all", + "@remotejdk21_linux_toolchain_config_repo//:all", + "@remotejdk21_linux_aarch64_toolchain_config_repo//:all", + "@remotejdk21_macos_toolchain_config_repo//:all", + "@remotejdk21_macos_aarch64_toolchain_config_repo//:all", + "@remotejdk21_win_toolchain_config_repo//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_java//java:extensions.bzl", + "extensionName": "toolchains", + "usingModule": "rules_java@7.1.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_java/7.1.0/MODULE.bazel", + "line": 19, + "column": 27 + }, + "imports": { + "remote_java_tools": "remote_java_tools", + "remote_java_tools_linux": "remote_java_tools_linux", + "remote_java_tools_windows": "remote_java_tools_windows", + "remote_java_tools_darwin_x86_64": "remote_java_tools_darwin_x86_64", + "remote_java_tools_darwin_arm64": "remote_java_tools_darwin_arm64", + "local_jdk": "local_jdk", + "remotejdk11_linux_toolchain_config_repo": "remotejdk11_linux_toolchain_config_repo", + "remotejdk11_linux_aarch64_toolchain_config_repo": "remotejdk11_linux_aarch64_toolchain_config_repo", + "remotejdk11_linux_ppc64le_toolchain_config_repo": "remotejdk11_linux_ppc64le_toolchain_config_repo", + "remotejdk11_linux_s390x_toolchain_config_repo": "remotejdk11_linux_s390x_toolchain_config_repo", + "remotejdk11_macos_toolchain_config_repo": "remotejdk11_macos_toolchain_config_repo", + "remotejdk11_macos_aarch64_toolchain_config_repo": "remotejdk11_macos_aarch64_toolchain_config_repo", + "remotejdk11_win_toolchain_config_repo": "remotejdk11_win_toolchain_config_repo", + "remotejdk11_win_arm64_toolchain_config_repo": "remotejdk11_win_arm64_toolchain_config_repo", + "remotejdk17_linux_toolchain_config_repo": "remotejdk17_linux_toolchain_config_repo", + "remotejdk17_linux_aarch64_toolchain_config_repo": "remotejdk17_linux_aarch64_toolchain_config_repo", + "remotejdk17_linux_ppc64le_toolchain_config_repo": "remotejdk17_linux_ppc64le_toolchain_config_repo", + "remotejdk17_linux_s390x_toolchain_config_repo": "remotejdk17_linux_s390x_toolchain_config_repo", + "remotejdk17_macos_toolchain_config_repo": "remotejdk17_macos_toolchain_config_repo", + "remotejdk17_macos_aarch64_toolchain_config_repo": "remotejdk17_macos_aarch64_toolchain_config_repo", + "remotejdk17_win_toolchain_config_repo": "remotejdk17_win_toolchain_config_repo", + "remotejdk17_win_arm64_toolchain_config_repo": "remotejdk17_win_arm64_toolchain_config_repo", + "remotejdk21_linux_toolchain_config_repo": "remotejdk21_linux_toolchain_config_repo", + "remotejdk21_linux_aarch64_toolchain_config_repo": "remotejdk21_linux_aarch64_toolchain_config_repo", + "remotejdk21_macos_toolchain_config_repo": "remotejdk21_macos_toolchain_config_repo", + "remotejdk21_macos_aarch64_toolchain_config_repo": "remotejdk21_macos_aarch64_toolchain_config_repo", + "remotejdk21_win_toolchain_config_repo": "remotejdk21_win_toolchain_config_repo" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_skylib": "bazel_skylib@1.4.1", + "rules_proto": "rules_proto@4.0.0", + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0", + "urls": [ + "https://github.com/bazelbuild/rules_java/releases/download/7.1.0/rules_java-7.1.0.tar.gz" + ], + "integrity": "sha256-o3pOX2OrgnFuXdau75iO2EYcegC46TYnImKJn1h81OE=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_license@0.0.7": { + "name": "rules_license", + "version": "0.0.7", + "key": "rules_license@0.0.7", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_license~0.0.7", + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + ], + "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "rules_proto@4.0.0": { + "name": "rules_proto", + "version": "4.0.0", + "key": "rules_proto@4.0.0", + "repoName": "rules_proto", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_proto~4.0.0", + "urls": [ + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/4.0.0.zip" + ], + "integrity": "sha256-Lr5z6xyuRA19pNtRYMGjKaynwQpck4H/lwYyVjyhoq4=", + "strip_prefix": "rules_proto-4.0.0", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_proto/4.0.0/patches/module_dot_bazel.patch": "sha256-MclJO7tIAM2ElDAmscNId9pKTpOuDGHgVlW/9VBOIp0=" + }, + "remote_patch_strip": 0 + } + } + }, + "rules_python@0.4.0": { + "name": "rules_python", + "version": "0.4.0", + "key": "rules_python@0.4.0", + "repoName": "rules_python", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@bazel_tools//tools/python:autodetecting_toolchain" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_python//bzlmod:extensions.bzl", + "extensionName": "pip_install", + "usingModule": "rules_python@0.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel", + "line": 7, + "column": 28 + }, + "imports": { + "pypi__click": "pypi__click", + "pypi__pip": "pypi__pip", + "pypi__pip_tools": "pypi__pip_tools", + "pypi__pkginfo": "pypi__pkginfo", + "pypi__setuptools": "pypi__setuptools", + "pypi__wheel": "pypi__wheel" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0", + "urls": [ + "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz" + ], + "integrity": "sha256-lUqom0kb5KCDMEosuDgBnIuMNyCnq7nEy4GseiQjDOo=", + "strip_prefix": "", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/propagate_pip_install_dependencies.patch": "sha256-v7S/dem/mixg63MF4KoRGDA4KEol9ab/tIVp+6Xq0D0=", + "https://bcr.bazel.build/modules/rules_python/0.4.0/patches/module_dot_bazel.patch": "sha256-kG4VIfWxQazzTuh50mvsx6pmyoRVA4lfH5rkto/Oq+Y=" + }, + "remote_patch_strip": 1 + } + } + }, + "protobuf@3.19.6": { + "name": "protobuf", + "version": "3.19.6", + "key": "protobuf@3.19.6", + "repoName": "protobuf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "zlib": "zlib@1.3", + "rules_python": "rules_python@0.4.0", + "rules_cc": "rules_cc@0.0.9", + "rules_proto": "rules_proto@4.0.0", + "rules_java": "rules_java@7.1.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "protobuf~3.19.6", + "urls": [ + "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.19.6.zip" + ], + "integrity": "sha256-OH4sVZuyx8G8N5jE5s/wFTgaebJ1hpavy/johzC0c4k=", + "strip_prefix": "protobuf-3.19.6", + "remote_patches": { + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/relative_repo_names.patch": "sha256-w/5gw/zGv8NFId+669hcdw1Uus2lxgYpulATHIwIByI=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/remove_dependency_on_rules_jvm_external.patch": "sha256-THUTnVgEBmjA0W7fKzIyZOVG58DnW9HQTkr4D2zKUUc=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/add_module_dot_bazel_for_examples.patch": "sha256-s/b1gi3baK3LsXefI2rQilhmkb2R5jVJdnT6zEcdfHY=", + "https://bcr.bazel.build/modules/protobuf/3.19.6/patches/module_dot_bazel.patch": "sha256-S0DEni8zgx7rHscW3z/rCEubQnYec0XhNet640cw0h4=" + }, + "remote_patch_strip": 1 + } + } + }, + "zlib@1.3": { + "name": "zlib", + "version": "1.3", + "key": "zlib@1.3", + "repoName": "zlib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "rules_cc": "rules_cc@0.0.9", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "zlib~1.3", + "urls": [ + "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + ], + "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", + "strip_prefix": "zlib-1.3", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", + "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + }, + "remote_patch_strip": 0 + } + } + }, + "apple_support@1.5.0": { + "name": "apple_support", + "version": "1.5.0", + "key": "apple_support@1.5.0", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.5.0", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", + "line": 17, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.4.1", + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "apple_support~1.5.0", + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + ], + "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, + "bazel_skylib@1.4.1": { + "name": "bazel_skylib", + "version": "1.4.1", + "key": "bazel_skylib@1.4.1", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_skylib~1.4.1", + "urls": [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz" + ], + "integrity": "sha256-uKFSeQF3QYCvx5iusoxGNL3M8ZxNmOe90c550f6aqtc=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + } + }, + "moduleExtensions": { + "@@apple_support~1.5.0//crosstool:setup.bzl%apple_cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "pMLFCYaRPkgXPQ8vtuNkMfiHfPmRBy6QJfnid4sWfv0=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_apple_cc": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc" + } + }, + "local_config_apple_cc_toolchains": { + "bzlFile": "@@apple_support~1.5.0//crosstool:setup.bzl", + "ruleClassName": "_apple_cc_autoconf_toolchains", + "attributes": { + "name": "apple_support~1.5.0~apple_cc_configure_extension~local_config_apple_cc_toolchains" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "apple_support~1.5.0", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/android:android_extensions.bzl%remote_android_tools_extensions": { + "general": { + "bzlTransitiveDigest": "4x/FXzwoadac6uV9ItZ4eGOyCculGHHrKUhLFNWo3lA=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "android_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_tools~remote_android_tools_extensions~android_tools", + "sha256": "2b661a761a735b41c41b3a78089f4fc1982626c76ddb944604ae3ff8c545d3c2", + "url": "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.30.0.tar" + } + }, + "android_gmaven_r8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_jar", + "attributes": { + "name": "bazel_tools~remote_android_tools_extensions~android_gmaven_r8", + "sha256": "57a696749695a09381a87bc2f08c3a8ed06a717a5caa3ef878a3077e0d3af19d", + "url": "https://maven.google.com/com/android/tools/r8/8.1.56/r8-8.1.56.jar" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { + "general": { + "bzlTransitiveDigest": "mcsWHq3xORJexV5/4eCvNOLxFOQKV6eli3fkr+tEaqE=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_cc": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc" + } + }, + "local_config_cc_toolchains": { + "bzlFile": "@@bazel_tools//tools/cpp:cc_configure.bzl", + "ruleClassName": "cc_autoconf_toolchains", + "attributes": { + "name": "bazel_tools~cc_configure_extension~local_config_cc_toolchains" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "bazel_tools", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@bazel_tools//tools/osx:xcode_configure.bzl%xcode_configure_extension": { + "general": { + "bzlTransitiveDigest": "Qh2bWTU6QW6wkrd87qrU4YeY+SG37Nvw3A0PR4Y0L2Y=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_xcode": { + "bzlFile": "@@bazel_tools//tools/osx:xcode_configure.bzl", + "ruleClassName": "xcode_autoconf", + "attributes": { + "name": "bazel_tools~xcode_configure_extension~local_config_xcode", + "xcode_locator": "@bazel_tools//tools/osx:xcode_locator.m", + "remote_xcode": "" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/sh:sh_configure.bzl%sh_configure_extension": { + "general": { + "bzlTransitiveDigest": "hp4NgmNjEg5+xgvzfh6L83bt9/aiiWETuNpwNuF1MSU=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "local_config_sh": { + "bzlFile": "@@bazel_tools//tools/sh:sh_configure.bzl", + "ruleClassName": "sh_config", + "attributes": { + "name": "bazel_tools~sh_configure_extension~local_config_sh" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@bazel_tools//tools/test:extensions.bzl%remote_coverage_tools_extension": { + "general": { + "bzlTransitiveDigest": "y48q5zUu2oMiYv7yUyi7rFB0wt14eqiF/RQcWT6vP7I=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remote_coverage_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_tools~remote_coverage_tools_extension~remote_coverage_tools", + "sha256": "7006375f6756819b7013ca875eab70a541cf7d89142d9c511ed78ea4fefa38af", + "urls": [ + "https://mirror.bazel.build/bazel_coverage_output_generator/releases/coverage_output_generator-v2.6.zip" + ] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_java~7.1.0//java:extensions.bzl%toolchains": { + "general": { + "bzlTransitiveDigest": "D02GmifxnV/IhYgspsJMDZ/aE8HxAjXgek5gi6FSto4=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "remotejdk21_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk21_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "2a7a99a3ea263dbd8d32a67d1e6e363ba8b25c645c826f5e167a02bbafaff1fa", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "314b04568ec0ae9b36ba03c9cbd42adc9e1265f74678923b19297d66eb84dcca", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_aarch64.tar.gz" + ] + } + }, + "remote_java_tools_windows": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_windows", + "sha256": "c5c70c214a350f12cbf52da8270fa43ba629b795f3dd328028a38f8f0d39c2a1", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_windows-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_windows-v13.1.zip" + ] + } + }, + "remotejdk11_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "43408193ce2fa0862819495b5ae8541085b95660153f2adcf91a52d3a1710e83", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-win_x64.zip" + ] + } + }, + "remotejdk11_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "54174439f2b3fddd11f1048c397fe7bb45d4c9d66d452d6889b013d04d21c4de", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "b9482f2304a1a68a614dfacddcf29569a72f0fac32e6c74f83dc1b9a157b8340", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_linux_s390x_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:s390x\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_s390x//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux//:jdk\",\n)\n" + } + }, + "remotejdk11_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "bcaab11cfe586fae7583c6d9d311c64384354fb2638eb9a012eca4c3f1a1d9fd", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_x64.tar.gz" + ] + } + }, + "remotejdk11_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "b8a28e6e767d90acf793ea6f5bed0bb595ba0ba5ebdf8b99f395266161e53ec2", + "strip_prefix": "jdk-11.0.13+8", + "urls": [ + "https://mirror.bazel.build/aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-aarch64.zip" + ] + } + }, + "remotejdk17_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "640453e8afe8ffe0fb4dceb4535fb50db9c283c64665eebb0ba68b19e65f4b1f", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "9639b87db586d0c89f7a9892ae47f421e442c64b97baebdff31788fbe23265bd", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-macosx_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-macosx_x64.tar.gz" + ] + } + }, + "remotejdk21_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk17_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "192f2afca57701de6ec496234f7e45d971bf623ff66b8ee4a5c81582054e5637", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_x64.zip" + ] + } + }, + "remotejdk11_macos_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk21_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "0c0eadfbdc47a7ca64aeab51b9c061f71b6e4d25d2d87674512e9b6387e9e3a6", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_x64.tar.gz" + ] + } + }, + "remote_java_tools_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_linux", + "sha256": "d134da9b04c9023fb6e56a5d4bffccee73f7bc9572ddc4e747778dacccd7a5a7", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_linux-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_linux-v13.1.zip" + ] + } + }, + "remotejdk21_win": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "e9959d500a0d9a7694ac243baf657761479da132f0f94720cbffd092150bd802", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-win_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-win_x64.zip" + ] + } + }, + "remotejdk21_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 21,\n)\n", + "sha256": "1fb64b8036c5d463d8ab59af06bf5b6b006811e6012e3b0eb6bccf57f1c55835", + "strip_prefix": "zulu21.28.85-ca-jdk21.0.0-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu21.28.85-ca-jdk21.0.0-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk11_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a58fc0361966af0a5d5a31a2d8a208e3c9bb0f54f345596fd80b99ea9a39788b", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_s390x_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk17_linux_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6531cef61e416d5a7b691555c8cf2bdff689201b8a001ff45ab6740062b44313", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-linux_aarch64.tar.gz" + ] + } + }, + "remotejdk17_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win_arm64//:jdk\",\n)\n" + } + }, + "remotejdk11_linux": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a34b404f87a08a61148b38e1416d837189e1df7a040d949e743633daf4695a3c", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-linux_x64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-linux_x64.tar.gz" + ] + } + }, + "remotejdk11_macos_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:macos\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_macos//:jdk\",\n)\n" + } + }, + "remotejdk17_linux_ppc64le_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:ppc\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_linux_ppc64le//:jdk\",\n)\n" + } + }, + "remotejdk17_win_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_arm64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "6802c99eae0d788e21f52d03cab2e2b3bf42bc334ca03cbf19f71eb70ee19f85", + "strip_prefix": "zulu17.44.53-ca-jdk17.0.8.1-win_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip", + "https://cdn.azul.com/zulu/bin/zulu17.44.53-ca-jdk17.0.8.1-win_aarch64.zip" + ] + } + }, + "remote_java_tools_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_arm64", + "sha256": "dab5bb87ec43e980faea6e1cec14bafb217b8e2f5346f53aa784fd715929a930", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_arm64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_arm64-v13.1.zip" + ] + } + }, + "remotejdk17_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "00a4c07603d0218cd678461b5b3b7e25b3253102da4022d31fc35907f21a2efd", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_ppc64le_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk21_linux_aarch64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_linux_aarch64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:linux\", \"@platforms//cpu:aarch64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_linux_aarch64//:jdk\",\n)\n" + } + }, + "remotejdk11_win_arm64_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_win_arm64_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_11\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"11\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:arm64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk11_win_arm64//:jdk\",\n)\n" + } + }, + "local_jdk": { + "bzlFile": "@@rules_java~7.1.0//toolchains:local_java_repository.bzl", + "ruleClassName": "_local_java_repository_rule", + "attributes": { + "name": "rules_java~7.1.0~toolchains~local_jdk", + "java_home": "", + "version": "", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = {RUNTIME_VERSION},\n)\n" + } + }, + "remote_java_tools_darwin_x86_64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools_darwin_x86_64", + "sha256": "0db40d8505a2b65ef0ed46e4256757807db8162f7acff16225be57c1d5726dbc", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools_darwin_x86_64-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools_darwin_x86_64-v13.1.zip" + ] + } + }, + "remote_java_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remote_java_tools", + "sha256": "286bdbbd66e616fc4ed3f90101418729a73baa7e8c23a98ffbef558f74c0ad14", + "urls": [ + "https://mirror.bazel.build/bazel_java_tools/releases/java/v13.1/java_tools-v13.1.zip", + "https://github.com/bazelbuild/java_tools/releases/download/java_v13.1/java_tools-v13.1.zip" + ] + } + }, + "remotejdk17_linux_s390x": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_linux_s390x", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 17,\n)\n", + "sha256": "ffacba69c6843d7ca70d572489d6cc7ab7ae52c60f0852cedf4cf0d248b6fc37", + "strip_prefix": "jdk-17.0.8.1+1", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz", + "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.8.1%2B1/OpenJDK17U-jdk_s390x_linux_hotspot_17.0.8.1_1.tar.gz" + ] + } + }, + "remotejdk17_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk17_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_17\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"17\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk17_win//:jdk\",\n)\n" + } + }, + "remotejdk11_linux_ppc64le": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_linux_ppc64le", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "a8fba686f6eb8ae1d1a9566821dbd5a85a1108b96ad857fdbac5c1e4649fc56f", + "strip_prefix": "jdk-11.0.15+10", + "urls": [ + "https://mirror.bazel.build/github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz", + "https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.15+10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.15_10.tar.gz" + ] + } + }, + "remotejdk11_macos_aarch64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk11_macos_aarch64", + "build_file_content": "load(\"@rules_java//java:defs.bzl\", \"java_runtime\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"WORKSPACE\", \"BUILD.bazel\"])\n\nfilegroup(\n name = \"jre\",\n srcs = glob(\n [\n \"jre/bin/**\",\n \"jre/lib/**\",\n ],\n allow_empty = True,\n # In some configurations, Java browser plugin is considered harmful and\n # common antivirus software blocks access to npjp2.dll interfering with Bazel,\n # so do not include it in JRE on Windows.\n exclude = [\"jre/bin/plugin2/**\"],\n ),\n)\n\nfilegroup(\n name = \"jdk-bin\",\n srcs = glob(\n [\"bin/**\"],\n # The JDK on Windows sometimes contains a directory called\n # \"%systemroot%\", which is not a valid label.\n exclude = [\"**/*%*/**\"],\n ),\n)\n\n# This folder holds security policies.\nfilegroup(\n name = \"jdk-conf\",\n srcs = glob(\n [\"conf/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-include\",\n srcs = glob(\n [\"include/**\"],\n allow_empty = True,\n ),\n)\n\nfilegroup(\n name = \"jdk-lib\",\n srcs = glob(\n [\"lib/**\", \"release\"],\n allow_empty = True,\n exclude = [\n \"lib/missioncontrol/**\",\n \"lib/visualvm/**\",\n ],\n ),\n)\n\njava_runtime(\n name = \"jdk\",\n srcs = [\n \":jdk-bin\",\n \":jdk-conf\",\n \":jdk-include\",\n \":jdk-lib\",\n \":jre\",\n ],\n # Provide the 'java` binary explicitly so that the correct path is used by\n # Bazel even when the host platform differs from the execution platform.\n # Exactly one of the two globs will be empty depending on the host platform.\n # When --incompatible_disallow_empty_glob is enabled, each individual empty\n # glob will fail without allow_empty = True, even if the overall result is\n # non-empty.\n java = glob([\"bin/java.exe\", \"bin/java\"], allow_empty = True)[0],\n version = 11,\n)\n", + "sha256": "7632bc29f8a4b7d492b93f3bc75a7b61630894db85d136456035ab2a24d38885", + "strip_prefix": "zulu11.66.15-ca-jdk11.0.20-macosx_aarch64", + "urls": [ + "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz", + "https://cdn.azul.com/zulu/bin/zulu11.66.15-ca-jdk11.0.20-macosx_aarch64.tar.gz" + ] + } + }, + "remotejdk21_win_toolchain_config_repo": { + "bzlFile": "@@rules_java~7.1.0//toolchains:remote_java_repository.bzl", + "ruleClassName": "_toolchain_config", + "attributes": { + "name": "rules_java~7.1.0~toolchains~remotejdk21_win_toolchain_config_repo", + "build_file": "\nconfig_setting(\n name = \"prefix_version_setting\",\n values = {\"java_runtime_version\": \"remotejdk_21\"},\n visibility = [\"//visibility:private\"],\n)\nconfig_setting(\n name = \"version_setting\",\n values = {\"java_runtime_version\": \"21\"},\n visibility = [\"//visibility:private\"],\n)\nalias(\n name = \"version_or_prefix_version_setting\",\n actual = select({\n \":version_setting\": \":version_setting\",\n \"//conditions:default\": \":prefix_version_setting\",\n }),\n visibility = [\"//visibility:private\"],\n)\ntoolchain(\n name = \"toolchain\",\n target_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\ntoolchain(\n name = \"bootstrap_runtime_toolchain\",\n # These constraints are not required for correctness, but prevent fetches of remote JDK for\n # different architectures. As every Java compilation toolchain depends on a bootstrap runtime in\n # the same configuration, this constraint will not result in toolchain resolution failures.\n exec_compatible_with = [\"@platforms//os:windows\", \"@platforms//cpu:x86_64\"],\n target_settings = [\":version_or_prefix_version_setting\"],\n toolchain_type = \"@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type\",\n toolchain = \"@remotejdk21_win//:jdk\",\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_java~7.1.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_java~7.1.0", + "remote_java_tools", + "rules_java~7.1.0~toolchains~remote_java_tools" + ] + ] + } + }, + "@@rules_python~0.4.0//bzlmod:extensions.bzl%pip_install": { + "general": { + "bzlTransitiveDigest": "07IRaHKuUT2vn32xPW6gc6vmBsFK1VdVBMWxgn0SE6k=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "pypi__pkginfo": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__pkginfo", + "url": "https://files.pythonhosted.org/packages/77/83/1ef010f7c4563e218854809c0dff9548de65ebec930921dedf6ee5981f27/pkginfo-1.7.1-py2.py3-none-any.whl", + "sha256": "37ecd857b47e5f55949c41ed061eb51a0bee97a87c969219d144c0e023982779", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__wheel": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__wheel", + "url": "https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl", + "sha256": "78b5b185f0e5763c26ca1e324373aadd49182ca90e825f7853f4b2509215dc0e", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__click": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__click", + "url": "https://files.pythonhosted.org/packages/76/0a/b6c5f311e32aeb3b406e03c079ade51e905ea630fc19d1262a46249c1c86/click-8.0.1-py3-none-any.whl", + "sha256": "fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__pip", + "url": "https://files.pythonhosted.org/packages/47/ca/f0d790b6e18b3a6f3bd5e80c2ee4edbb5807286c21cdd0862ca933f751dd/pip-21.1.3-py3-none-any.whl", + "sha256": "78cb760711fedc073246543801c84dc5377affead832e103ad0211f99303a204", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__pip_tools", + "url": "https://files.pythonhosted.org/packages/6d/16/75d65bdccd48bb59a08e2bf167b01d8532f65604270d0a292f0f16b7b022/pip_tools-5.5.0-py2.py3-none-any.whl", + "sha256": "10841c1e56c234d610d0466447685b9ea4ee4a2c274f858c0ef3c33d9bd0d985", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__setuptools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "rules_python~0.4.0~pip_install~pypi__setuptools", + "url": "https://files.pythonhosted.org/packages/a2/e1/902fbc2f61ad6243cd3d57ffa195a9eb123021ec912ec5d811acf54a39f8/setuptools-57.1.0-py3-none-any.whl", + "sha256": "ddae4c1b9220daf1e32ba9d4e3714df6019c5b583755559be84ff8199f7e1fe3", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:defs.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\"**/*.py\", \"**/* *\", \"BUILD\", \"WORKSPACE\"]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_python~0.4.0", + "bazel_tools", + "bazel_tools" + ], + [ + "rules_python~0.4.0", + "rules_python", + "rules_python~0.4.0" + ] + ] + } + } + } +} diff --git a/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_mod_graph_output.json b/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_mod_graph_output.json new file mode 100644 index 0000000000000..07d7ec8869392 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_mod_graph_output.json @@ -0,0 +1,78 @@ +{ + "key": "\u003croot\u003e", + "dependencies": [ + { + "key": "glog@0.5.0", + "dependencies": [ + { + "key": "gflags@2.2.2", + "dependencies": [], + "indirectDependencies": [], + "cycles": [] + } + ], + "indirectDependencies": [], + "cycles": [] + }, + { + "key": "googletest@1.14.0", + "dependencies": [ + { + "key": "abseil-cpp@20230125.1", + "dependencies": [ + { + "key": "platforms@0.0.7", + "unexpanded": true + }, + { + "key": "rules_cc@0.0.9", + "unexpanded": true + }, + { + "key": "bazel_skylib@1.4.1", + "dependencies": [ + { + "key": "platforms@0.0.7", + "unexpanded": true + } + ], + "indirectDependencies": [], + "cycles": [] + } + ], + "indirectDependencies": [], + "cycles": [] + }, + { + "key": "platforms@0.0.7", + "dependencies": [ + { + "key": "rules_license@0.0.7", + "dependencies": [], + "indirectDependencies": [], + "cycles": [] + } + ], + "indirectDependencies": [], + "cycles": [] + }, + { + "key": "rules_cc@0.0.9", + "dependencies": [ + { + "key": "platforms@0.0.7", + "unexpanded": true + } + ], + "indirectDependencies": [], + "cycles": [] + } + ], + "indirectDependencies": [], + "cycles": [] + } + ], + "indirectDependencies": [], + "cycles": [], + "root": true +} diff --git a/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_query_output.txt b/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_query_output.txt new file mode 100644 index 0000000000000..b0783c4073793 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/fixtures/bazel_query_output.txt @@ -0,0 +1,720 @@ +{ + "type": "RULE", + "rule": { + "name": "//lib:cookie-jar", + "ruleClass": "cc_library", + "location": "/src/lib/BUILD:1:11", + "attribute": [ + { + "name": "$cc_toolchain", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/cpp:current_cc_toolchain", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$config_dependencies", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$def_parser", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/def_parser:def_parser", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$stl", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$use_auto_exec_groups", + "type": "BOOLEAN", + "intValue": 1, + "stringValue": "true", + "explicitlySpecified": false, + "booleanValue": true + }, + { + "name": ":action_listener", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "additional_compiler_inputs", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "additional_linker_inputs", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "alwayslink", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "applicable_licenses", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "aspect_hints", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "copts", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "data", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "defines", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "deprecation", + "type": "STRING", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "deps", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "exec_compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "exec_properties", + "type": "STRING_DICT", + "explicitlySpecified": false + }, + { + "name": "expect_failure", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "features", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_function", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_location", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_name", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "hdrs", + "type": "LABEL_LIST", + "stringListValue": [ + "//lib:cookie-jar.h" + ], + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "hdrs_check", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "implementation_deps", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "include_prefix", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "includes", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "licenses", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "linkopts", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "linkstamp", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "linkstatic", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "local_defines", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "name", + "type": "STRING", + "stringValue": "cookie-jar", + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "restricted_to", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "srcs", + "type": "LABEL_LIST", + "stringListValue": [ + "//lib:cookie-jar.cc" + ], + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "strip_include_prefix", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "tags", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "target_compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "testonly", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "textual_hdrs", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "toolchains", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "transitive_configs", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": true + }, + { + "name": "visibility", + "type": "STRING_LIST", + "stringListValue": [ + "//main:__pkg__" + ], + "explicitlySpecified": true, + "nodep": true + }, + { + "name": "win_def_file", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$rule_implementation_hash", + "type": "STRING", + "stringValue": "5b22d6bbd0748dc1626ce0e835a0fcea3cf11b07a4307f0380a182863470feba" + } + ], + "ruleInput": [ + "//lib:cookie-jar.cc", + "//lib:cookie-jar.h", + "@bazel_tools//tools/cpp:current_cc_toolchain", + "@bazel_tools//tools/def_parser:def_parser" + ] + } +} +{ + "type": "RULE", + "rule": { + "name": "//main:main", + "ruleClass": "cc_binary", + "location": "/src/main/BUILD:1:10", + "attribute": [ + { + "name": "$cc_binary", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "$cc_toolchain", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/cpp:current_cc_toolchain", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$cc_toolchain_type", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/cpp:toolchain_type", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$config_dependencies", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$def_parser", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/def_parser:def_parser", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$deps_analyzed_by_graph_structure_aspect", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$is_executable", + "type": "BOOLEAN", + "intValue": 1, + "stringValue": "true", + "explicitlySpecified": false, + "booleanValue": true + }, + { + "name": "$is_test", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "$stl", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$use_auto_exec_groups", + "type": "BOOLEAN", + "intValue": 1, + "stringValue": "true", + "explicitlySpecified": false, + "booleanValue": true + }, + { + "name": ":action_listener", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": ":default_malloc", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "additional_linker_inputs", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "applicable_licenses", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "args", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "aspect_hints", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "copts", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "data", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "defines", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "deprecation", + "type": "STRING", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "deps", + "type": "LABEL_LIST", + "stringListValue": [ + "//lib:cookie-jar", + "@com_github_google_glog//:glog" + ], + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "distribs", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "dynamic_deps", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "env", + "type": "STRING_DICT", + "explicitlySpecified": false + }, + { + "name": "exec_compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "exec_properties", + "type": "STRING_DICT", + "explicitlySpecified": false + }, + { + "name": "expect_failure", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "features", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_function", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_location", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "generator_name", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "hdrs_check", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "includes", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "licenses", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "link_extra_lib", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/cpp:link_extra_lib", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "linkopts", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "linkshared", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "linkstatic", + "type": "BOOLEAN", + "intValue": 1, + "stringValue": "true", + "explicitlySpecified": false, + "booleanValue": true + }, + { + "name": "local_defines", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "malloc", + "type": "LABEL", + "stringValue": "@bazel_tools//tools/cpp:malloc", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "name", + "type": "STRING", + "stringValue": "main", + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "nocopts", + "type": "STRING", + "stringValue": "", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "output_licenses", + "type": "LICENSE", + "license": { + "licenseType": [ + "NONE" + ] + }, + "explicitlySpecified": false + }, + { + "name": "reexport_deps", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "restricted_to", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "srcs", + "type": "LABEL_LIST", + "stringListValue": [ + "//main:main.cc" + ], + "explicitlySpecified": true, + "nodep": false + }, + { + "name": "stamp", + "type": "INTEGER", + "intValue": -1, + "explicitlySpecified": false + }, + { + "name": "tags", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "target_compatible_with", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "testonly", + "type": "BOOLEAN", + "intValue": 0, + "stringValue": "false", + "explicitlySpecified": false, + "booleanValue": false + }, + { + "name": "toolchains", + "type": "LABEL_LIST", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "transitive_configs", + "type": "STRING_LIST", + "explicitlySpecified": false, + "nodep": true + }, + { + "name": "visibility", + "type": "STRING_LIST", + "stringListValue": [ + "//visibility:private" + ], + "explicitlySpecified": false, + "nodep": true + }, + { + "name": "win_def_file", + "type": "LABEL", + "explicitlySpecified": false, + "nodep": false + }, + { + "name": "$rule_implementation_hash", + "type": "STRING", + "stringValue": "8d21926243b25c836337203ae3766e2fa80bea7568d8e2f7eedf646cce29d678" + } + ], + "ruleInput": [ + "//lib:cookie-jar", + "//main:main.cc", + "@bazel_tools//tools/cpp:current_cc_toolchain", + "@bazel_tools//tools/cpp:link_extra_lib", + "@bazel_tools//tools/cpp:malloc", + "@bazel_tools//tools/cpp:toolchain_type", + "@bazel_tools//tools/def_parser:def_parser", + "@com_github_google_glog//:glog" + ], + "ruleOutput": [ + "//main:main.stripped", + "//main:main.dwp" + ] + } +} diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project-expected-output.yml b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project-expected-output.yml new file mode 100644 index 0000000000000..bd3858c80f713 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project-expected-output.yml @@ -0,0 +1,235 @@ +--- +project: + id: "Bazel::root:" + definition_file_path: "" + declared_licenses: [] + declared_licenses_processed: {} + vcs: + type: "Git" + url: "" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "" + revision: "" + path: "" + homepage_url: "" + scopes: + - name: "dev" + dependencies: + - id: "Bazel::googletest:1.14.0" + linkage: "STATIC" + dependencies: + - id: "Bazel::abseil-cpp:20230125.1" + linkage: "STATIC" + dependencies: + - id: "Bazel::bazel_skylib:1.4.1" + linkage: "STATIC" + dependencies: + - id: "Bazel::platforms:0.0.7" + linkage: "STATIC" + - id: "Bazel::platforms:0.0.7" + linkage: "STATIC" + - id: "Bazel::rules_cc:0.0.9" + linkage: "STATIC" + - id: "Bazel::platforms:0.0.7" + linkage: "STATIC" + dependencies: + - id: "Bazel::rules_license:0.0.7" + linkage: "STATIC" + - id: "Bazel::rules_cc:0.0.9" + linkage: "STATIC" + dependencies: + - id: "Bazel::platforms:0.0.7" + linkage: "STATIC" + - name: "main" + dependencies: + - id: "Bazel::glog:0.5.0" + linkage: "STATIC" + dependencies: + - id: "Bazel::gflags:2.2.2" + linkage: "STATIC" +packages: +- id: "Bazel::abseil-cpp:20230125.1" + purl: "pkg:generic/abseil-cpp@20230125.1" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://github.com/abseil/abseil-cpp" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.1.tar.gz" + hash: + value: "81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/abseil/abseil-cpp" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/abseil/abseil-cpp.git" + revision: "" + path: "" +- id: "Bazel::bazel_skylib:1.4.1" + purl: "pkg:generic/bazel_skylib@1.4.1" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://github.com/bazelbuild/bazel-skylib" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz" + hash: + value: "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/bazelbuild/bazel-skylib" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/bazelbuild/bazel-skylib.git" + revision: "" + path: "" +- id: "Bazel::gflags:2.2.2" + purl: "pkg:generic/gflags@2.2.2" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://gflags.github.io/gflags/" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz" + hash: + value: "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/gflags/gflags" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/gflags/gflags.git" + revision: "" + path: "" +- id: "Bazel::glog:0.5.0" + purl: "pkg:generic/glog@0.5.0" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://github.com/google/glog" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/google/glog/archive/refs/tags/v0.5.0.tar.gz" + hash: + value: "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/google/glog" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/google/glog.git" + revision: "" + path: "" +- id: "Bazel::googletest:1.14.0" + purl: "pkg:generic/googletest@1.14.0" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://google.github.io/googletest/" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz" + hash: + value: "8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/google/googletest" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/google/googletest.git" + revision: "" + path: "" +- id: "Bazel::platforms:0.0.7" + purl: "pkg:generic/platforms@0.0.7" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://github.com/bazelbuild/platforms" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz" + hash: + value: "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51" + algorithm: "SHA-256" + vcs: + type: "Git" + url: "https://github.com/bazelbuild/platforms" + revision: "" + path: "" + vcs_processed: + type: "Git" + url: "https://github.com/bazelbuild/platforms.git" + revision: "" + path: "" +- id: "Bazel::rules_cc:0.0.9" + purl: "pkg:generic/rules_cc@0.0.9" + declared_licenses: [] + declared_licenses_processed: {} + description: "" + homepage_url: "https://github.com/bazelbuild/rules_cc" + binary_artifact: + url: "" + hash: + value: "" + algorithm: "" + source_artifact: + url: "https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz" + hash: + value: "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf" + algorithm: "SHA-256" + vcs: + type: "" + url: "" + revision: "" + path: "" + vcs_processed: + type: "" + url: "" + revision: "" + path: "" diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/MODULE.bazel b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/MODULE.bazel new file mode 100644 index 0000000000000..c88dbdb2d4fe9 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/MODULE.bazel @@ -0,0 +1,3 @@ +bazel_dep(name = "glog", version = "0.5.0", repo_name = "com_github_google_glog") +bazel_dep(name = "googletest", version = "1.14.0", repo_name = "com_google_googletest", dev_dependency = True) + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/BUILD b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/BUILD new file mode 100644 index 0000000000000..5790445652ed3 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/BUILD @@ -0,0 +1,7 @@ +cc_library( + name = "cookie-jar", + srcs = ["cookie-jar.cc"], + hdrs = ["cookie-jar.h"], + visibility = ["//main:__pkg__", "//test:__pkg__"], +) + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.cc b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.cc new file mode 100644 index 0000000000000..119b4473f8de8 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.cc @@ -0,0 +1,5 @@ +#include "lib/cookie-jar.h" + +int grab_cookies() { + return 42; +} diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.h b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.h new file mode 100644 index 0000000000000..e1c18fb7d7ede --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/lib/cookie-jar.h @@ -0,0 +1,6 @@ +#ifndef LIB_COOKIE_JAR_H_ +#define LIB_COOKIE_JAR_H_ + +int grab_cookies(); + +#endif diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/BUILD b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/BUILD new file mode 100644 index 0000000000000..6d051d9aad4af --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/BUILD @@ -0,0 +1,11 @@ +cc_binary( + name = "main", + srcs = [ + "main.cc", + ], + deps = [ + "//lib:cookie-jar", + "@com_github_google_glog//:glog", + ], +) + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/main.cc b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/main.cc new file mode 100644 index 0000000000000..ce356335faccb --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/main/main.cc @@ -0,0 +1,10 @@ +#include "lib/cookie-jar.h" +#include + +int main(int argc, char* argv[]) { + google::InitGoogleLogging(argv[0]); + + int num_cookies = grab_cookies(); + LOG(INFO) << "Found " << num_cookies << " cookies"; +} + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/BUILD.bazel b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/BUILD.bazel new file mode 100644 index 0000000000000..c6418dcf134d7 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/BUILD.bazel @@ -0,0 +1,11 @@ +cc_test( + name = "test", + srcs = glob([ + "*.cc", + ]), + deps = [ + "//lib:cookie-jar", + "@com_google_googletest//:gtest_main", + ], +) + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/cookies.cc b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/cookies.cc new file mode 100644 index 0000000000000..c850e614e52c8 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/cookies.cc @@ -0,0 +1,8 @@ +#include "lib/cookie-jar.h" +#include "gtest/gtest.h" + +TEST(CookieTest, TakingOut) { + int num_cookies = grab_cookies(); + EXPECT_EQ(num_cookies, 42); +} + diff --git a/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/main.cc b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/main.cc new file mode 100644 index 0000000000000..f2721dc04035f --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/assets/projects/synthetic/project/test/main.cc @@ -0,0 +1,7 @@ +#include "gtest/gtest.h" + +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + diff --git a/plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt b/plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt new file mode 100644 index 0000000000000..3b21bae7988a7 --- /dev/null +++ b/plugins/package-managers/bazel/src/funTest/kotlin/BazelFunTest.kt @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +import io.kotest.core.spec.style.StringSpec +import io.kotest.matchers.should + +import org.ossreviewtoolkit.analyzer.create +import org.ossreviewtoolkit.analyzer.resolveSingleProject +import org.ossreviewtoolkit.model.toYaml +import org.ossreviewtoolkit.utils.test.getAssetFile +import org.ossreviewtoolkit.utils.test.matchExpectedResult + +class BazelFunTest : StringSpec({ + "Dependencies are detected correctly" { + val definitionFile = getAssetFile("projects/synthetic/project/MODULE.bazel") + val expectedResultFile = getAssetFile("projects/synthetic/project-expected-output.yml") + + val result = create("Bazel").resolveSingleProject(definitionFile) + + result.toYaml() should matchExpectedResult(expectedResultFile, definitionFile) + } +}) diff --git a/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt b/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt new file mode 100644 index 0000000000000..3ab3b07e9ac71 --- /dev/null +++ b/plugins/package-managers/bazel/src/main/kotlin/Bazel.kt @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +import java.io.File + +import kotlinx.coroutines.runBlocking +import kotlinx.serialization.json.Json + +import org.apache.logging.log4j.kotlin.logger + +import org.ossreviewtoolkit.analyzer.AbstractPackageManagerFactory +import org.ossreviewtoolkit.analyzer.PackageManager +import org.ossreviewtoolkit.clients.bazelmoduleregistry.BazelModuleRegistryClient +import org.ossreviewtoolkit.clients.bazelmoduleregistry.ModuleMetadata +import org.ossreviewtoolkit.clients.bazelmoduleregistry.ModuleSourceInfo +import org.ossreviewtoolkit.downloader.VersionControlSystem +import org.ossreviewtoolkit.model.Identifier +import org.ossreviewtoolkit.model.Package +import org.ossreviewtoolkit.model.PackageLinkage +import org.ossreviewtoolkit.model.PackageReference +import org.ossreviewtoolkit.model.Project +import org.ossreviewtoolkit.model.ProjectAnalyzerResult +import org.ossreviewtoolkit.model.RemoteArtifact +import org.ossreviewtoolkit.model.Scope +import org.ossreviewtoolkit.model.config.AnalyzerConfiguration +import org.ossreviewtoolkit.model.config.RepositoryConfiguration +import org.ossreviewtoolkit.utils.common.CommandLineTool + +import org.semver4j.RangesList +import org.semver4j.RangesListFactory + +import retrofit2.HttpException + +const val BZLMOD_LOCK_FILE = "MODULE.bazel.lock" + +private val json = Json { + ignoreUnknownKeys = true +} + +class Bazel( + name: String, + analysisRoot: File, + analyzerConfig: AnalyzerConfiguration, + repoConfig: RepositoryConfiguration +) : PackageManager(name, analysisRoot, analyzerConfig, repoConfig), CommandLineTool { + class Factory : AbstractPackageManagerFactory("Bazel") { + override val globsForDefinitionFiles = listOf("MODULE", "MODULE.bazel") + + override fun create( + analysisRoot: File, + analyzerConfig: AnalyzerConfiguration, + repoConfig: RepositoryConfiguration + ) = Bazel(type, analysisRoot, analyzerConfig, repoConfig) + } + + override fun command(workingDir: File?) = "bazel" + + override fun getVersionArguments() = "version" + + override fun transformVersion(output: String) = transformBazelVersion(output) + + // Bazel 6.0 already supports bzlmod but it is not enabled by default. + // Supporting it would require adding the flag "--enable_bzlmod=true" at the correct position of all bazel + // invocations. + override fun getVersionRequirement(): RangesList = RangesListFactory.create(">=7.0") + + override fun resolveDependencies(definitionFile: File, labels: Map): List { + val projectDir = definitionFile.parentFile + val lockFile = projectDir.resolve(BZLMOD_LOCK_FILE) + val projectVcs = processProjectVcs(projectDir) + val moduleMetadata = Parser(definitionFile.readText()).parse() + val depDirectives = moduleMetadata.dependencies.associateBy { "${it.name}@${it.version}" } + val scopes = getDependencyGraph(projectDir, depDirectives) + + // If no lock file is present, getDependencyGraph() runs "bazel mod graph", which creates a MODULE.bazel.lock + // file as a side effect. That file contains the URL of the Bazel module registry that was used for dependency + // resolution. + val lockFileData = parseLockfile(lockFile) + + val bmrClient = BazelModuleRegistryClient.create(lockFileData.registryUrl()) + val packages = scopes.flatMap { getPackages(it.dependencies, bmrClient) }.filterNotNull() + + return listOf( + ProjectAnalyzerResult( + project = Project( + id = Identifier( + type = managerName, + name = moduleMetadata.module?.name ?: "root", + version = moduleMetadata.module?.version.orEmpty(), + namespace = "" + ), + definitionFilePath = VersionControlSystem.getPathInfo(definitionFile).path, + authors = emptySet(), + declaredLicenses = emptySet(), + vcs = projectVcs, + vcsProcessed = projectVcs, + homepageUrl = "", + scopeDependencies = scopes + ), + packages = packages.toSet() + ) + ) + } + + private fun getPackages( + graph: Set, + bmrClient: BazelModuleRegistryClient, + seen: MutableSet = mutableSetOf() + ): Set { + val result = mutableSetOf() + + graph.forEach { ref -> + if (ref.id !in seen) { + seen.add(ref.id) + + if (ref.id.name != "") { + result.add(packageFromPackageReference(ref, bmrClient)) + } + result.addAll(getPackages(ref.dependencies, bmrClient, seen)) + } + } + + return result + } + + private fun packageFromPackageReference(ref: PackageReference, bmrClient: BazelModuleRegistryClient): Package? { + val metadata: ModuleMetadata + try { + metadata = runBlocking { bmrClient.getModuleMetadata(ref.id.name) } + } catch (e: HttpException) { + logger.warn { "Failed to fetch metadata for Bazel module ${ref.id.name}: $e" } + return null + } + + val sourceInfo: ModuleSourceInfo + try { + sourceInfo = runBlocking { bmrClient.getModuleSourceInfo(ref.id.name, ref.id.version) } + } catch (e: HttpException) { + logger.warn { "Failed to fetch source info for Bazel module ${ref.id.name}@${ref.id.version}: $e" } + return null + } + + return Package( + id = ref.id, + declaredLicenses = emptySet(), + description = "", + homepageUrl = metadata.homepage?.toString().orEmpty(), + binaryArtifact = RemoteArtifact.EMPTY, + sourceArtifact = sourceInfo.remoteArtifact(), + vcs = metadata.vcsInfo() + ) + } + + private fun getDependencyGraph(projectDir: File, depDirectives: Map): Set { + val modGraphProcess = run("mod", "graph", "--output", "json", workingDir = projectDir) + return parseModuleGraph(modGraphProcess.stdout, depDirectives, managerName) + } +} + +internal fun parseModuleGraph( + output: String, + depDirectives: Map, + idRefType: String +): Set { + val node = json.decodeFromString(output) + val devDeps = node.dependencies.filter { depDirectives[it.key]?.devDependency ?: false }.toSet() + val mainDeps = node.dependencies.toSet() - devDeps + + return setOf( + Scope( + name = "main", + dependencies = mainDeps.map { parseModuleGraphNode(it, idRefType) }.toSet() + ), + Scope( + name = "dev", + dependencies = devDeps.map { parseModuleGraphNode(it, idRefType) }.toSet() + ) + ) +} + +private fun parseModuleGraphNode(node: ModuleGraphNode, refType: String): PackageReference { + return PackageReference( + id = Identifier( + type = refType, + namespace = "", + name = node.name(), + version = node.version() + ), + // Static linking is the default for cc_binary targets. According to the documentation, it is off for cc_test, + // but according to experiments, it is on. + // See https://bazel.build/reference/be/c-cpp#cc_binary.linkstatic + linkage = PackageLinkage.STATIC, + dependencies = node.dependencies.map { parseModuleGraphNode(it, refType) }.toSet() + ) +} + +internal fun transformBazelVersion(output: String) = + output.lineSequence() + .find { it.startsWith("Build label") } + .orEmpty() + .split(":") + .getOrElse(1) { "" } + .trim() diff --git a/plugins/package-managers/bazel/src/main/kotlin/BazelModel.kt b/plugins/package-managers/bazel/src/main/kotlin/BazelModel.kt new file mode 100644 index 0000000000000..5e6865b06b515 --- /dev/null +++ b/plugins/package-managers/bazel/src/main/kotlin/BazelModel.kt @@ -0,0 +1,119 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +import java.io.File +import java.util.Base64 + +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.Json + +import org.ossreviewtoolkit.clients.bazelmoduleregistry.BazelModuleRegistryClient +import org.ossreviewtoolkit.clients.bazelmoduleregistry.ModuleMetadata +import org.ossreviewtoolkit.clients.bazelmoduleregistry.ModuleSourceInfo +import org.ossreviewtoolkit.model.Hash +import org.ossreviewtoolkit.model.HashAlgorithm +import org.ossreviewtoolkit.model.RemoteArtifact +import org.ossreviewtoolkit.model.VcsInfo +import org.ossreviewtoolkit.model.VcsType + +private val json = Json { ignoreUnknownKeys = true } + +/** + * The data model for MODULE.bazel.lock. + */ +@Serializable +internal data class LockFile( + val lockFileVersion: Int, + val flags: Flags +) { + // TODO Support multiple registries. + fun registryUrl(): String = flags.cmdRegistries.getOrElse(0) { BazelModuleRegistryClient.DEFAULT_URL } +} + +@Serializable +internal data class Flags( + val cmdRegistries: List +) + +internal fun parseLockfile(lockFile: File): LockFile = json.decodeFromString(lockFile.readText()) + +/** + * The data model for the output of "bazel mod graph --output json". + */ +@Serializable +internal data class ModuleGraphNode( + val key: String, + val name: String? = null, + val version: String? = null, + val dependencies: List = emptyList() +) { + fun name(): String { + if (name != null) { + return name + } + + val parts = key.split('@') + return parts.getOrElse(0) { "" } + } + + fun version(): String { + if (version != null) { + return version + } + + val parts = key.split('@') + return parts.getOrElse(1) { "" } + } +} + +fun ModuleMetadata.vcsInfo(): VcsInfo { + val repo = repository?.firstOrNull() ?: return VcsInfo.EMPTY + + // From looking at all current values of this field on BCR, it looks like only the special value "github:" + // exists. Otherwise it's just the repo URL. + val url = if (repo.startsWith("github:")) { + val path = repo.substringAfter("github:") + "https://github.com/$path" + } else { + repo + } + + return VcsInfo( + type = VcsType.GIT, + url = url, + revision = "", + path = "" + ) +} + +fun ModuleSourceInfo.remoteArtifact() = RemoteArtifact(url = url.toString(), hash = hash()) + +fun ModuleSourceInfo.hash(): Hash { + fun ByteArray.toHex(): String = joinToString(separator = "") { eachByte -> "%02x".format(eachByte) } + + val (algo, b64digest) = integrity.split("-", limit = 2) + val digest = Base64.getDecoder().decode(b64digest).toHex() + + return Hash( + value = digest, + algorithm = HashAlgorithm.fromString(algo) + ) +} diff --git a/plugins/package-managers/bazel/src/main/kotlin/StarlarkParser.kt b/plugins/package-managers/bazel/src/main/kotlin/StarlarkParser.kt new file mode 100644 index 0000000000000..613c937ab3ec0 --- /dev/null +++ b/plugins/package-managers/bazel/src/main/kotlin/StarlarkParser.kt @@ -0,0 +1,239 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +data class ModuleMetadata( + val module: ModuleDirective? = null, + val dependencies: List +) + +data class ModuleDirective( + val name: String, + val version: String, + val compatibilityLevel: Int +) + +data class BazelDepDirective( + val name: String, + val version: String, + val devDependency: Boolean +) + +enum class TokenType { + IDENTIFIER, STRING, NUMBER, BOOLEAN, EQUALS, COMMA, LPAREN, RPAREN, LBRACKET, RBRACKET, EOF +} + +data class Token(val type: TokenType, val value: String) + +class Lexer(private val input: String) { + private var pos = 0 + private val length = input.length + + private fun peek(offset: Int = 0): Char = if (pos + offset < length) input[pos + offset] else '\u0000' + + private fun advance(steps: Int = 1) { + pos += steps + } + + private fun isEOF(): Boolean = pos >= length + + private fun isDigit(c: Char): Boolean = c in '0'..'9' + + private fun isAlpha(c: Char): Boolean = c in 'a'..'z' || c in 'A'..'Z' || c == '_' + + private fun isMultilineString(): Boolean = peek() == '"' && peek(1) == '"' && peek(2) == '"' + + private fun tokenizeString(): Token { + if (isMultilineString()) { + advance(3) // Skip opening """. + val start = pos + + while (!isMultilineString() && !isEOF()) { + advance() + } + val str = input.substring(start, pos) + advance(3) // Skip closing """. + return Token(TokenType.STRING, str) + } else { + advance() + val start = pos + while (peek() != '"' && !isEOF()) { + advance() + } + val str = input.substring(start, pos) + advance() // Skip closing quote. + return Token(TokenType.STRING, str) + } + } + + private fun tokenizeIdentifier(): Token { + val start = pos + while (isAlpha(peek()) || isDigit(peek()) || peek() == '_') { + advance() + } + val str = input.substring(start, pos) + + if (str.lowercase() == "true" || str.lowercase() == "false") { + return Token(TokenType.BOOLEAN, str.lowercase()) + } + return Token(TokenType.IDENTIFIER, str) + } + + private fun tokenizeNumber(): Token { + val start = pos + while (isDigit(peek())) { + advance() + } + val number = input.substring(start, pos) + return Token(TokenType.NUMBER, number) + } + + fun nextToken(): Token { + while (!isEOF()) { + when (val c = peek()) { + '#' -> { // Skip comment. + while (peek() != '\n' && !isEOF()) { + advance() + } + } + ' ', '\n', '\r', '\t' -> advance() + '=' -> { + advance() + return Token(TokenType.EQUALS, "=") + } + '(' -> { + advance() + return Token(TokenType.LPAREN, "(") + } + ')' -> { + advance() + return Token(TokenType.RPAREN, ")") + } + '[' -> { + advance() + return Token(TokenType.LBRACKET, "[") + } + ']' -> { + advance() + return Token(TokenType.RBRACKET, "]") + } + ',' -> { + advance() + return Token(TokenType.COMMA, ",") + } + '"' -> { + return tokenizeString() + } + else -> { + if (isAlpha(c)) { + return tokenizeIdentifier() + } else if (isDigit(c)) { + return tokenizeNumber() + } else { + advance() // Skip anything else to avoid an endless loop. + } + } + } + } + return Token(TokenType.EOF, "") + } +} + +class Parser(input: String) { + private val lexer = Lexer(input) + private var currentToken: Token = lexer.nextToken() + + private fun eat(type: TokenType) { + require(currentToken.type == type) { "Unexpected token: ${currentToken.type}, expected: $type" } + currentToken = lexer.nextToken() + } + + private fun parseKeyValue(): Pair { + val key = currentToken.value + eat(TokenType.IDENTIFIER) + eat(TokenType.EQUALS) + var value = currentToken.value + + if (currentToken.type in setOf(TokenType.STRING, TokenType.NUMBER, TokenType.BOOLEAN)) { + eat(currentToken.type) + } else if (currentToken.type == TokenType.LBRACKET) { // Skip lists for now. + while (currentToken.type != TokenType.RBRACKET) { + eat(currentToken.type) + } + eat(TokenType.RBRACKET) + value = "TODO" + } + return key to value + } + + private fun parseBazelDepDirective(): BazelDepDirective { + eat(TokenType.IDENTIFIER) + eat(TokenType.LPAREN) + val params = mutableMapOf() + while (currentToken.type != TokenType.RPAREN) { + val (key, value) = parseKeyValue() + params[key] = value + if (currentToken.type == TokenType.COMMA) eat(TokenType.COMMA) + } + eat(TokenType.RPAREN) + + return BazelDepDirective( + name = params["name"] ?: throw IllegalArgumentException("Missing name in 'bazel_dep' directive"), + version = params["version"] ?: throw IllegalArgumentException("Missing version in 'bazel_dep' directive"), + devDependency = params["dev_dependency"]?.toBoolean() ?: false + ) + } + + private fun parseModuleDirective(): ModuleDirective { + eat(TokenType.IDENTIFIER) + eat(TokenType.LPAREN) + val params = mutableMapOf() + while (currentToken.type != TokenType.RPAREN) { + val (key, value) = parseKeyValue() + params[key] = value + if (currentToken.type == TokenType.COMMA) eat(TokenType.COMMA) + } + eat(TokenType.RPAREN) + + return ModuleDirective( + name = params["name"] ?: throw IllegalArgumentException("Missing name in 'module' directive"), + version = params["version"] ?: throw IllegalArgumentException("Missing version in 'module' directive"), + compatibilityLevel = params["compatibility_level"]?.toInt() ?: 0 + ) + } + + fun parse(): ModuleMetadata { + val dependencies = mutableListOf() + var moduleDirective: ModuleDirective? = null + + while (currentToken.type != TokenType.EOF) { + when (currentToken.value) { + "module" -> moduleDirective = parseModuleDirective() + "bazel_dep" -> dependencies.add(parseBazelDepDirective()) + else -> eat(currentToken.type) // Skip unknown tokens. + } + } + + return ModuleMetadata( + module = moduleDirective, + dependencies = dependencies + ) + } +} diff --git a/plugins/package-managers/bazel/src/main/resources/META-INF/services/org.ossreviewtoolkit.analyzer.PackageManagerFactory b/plugins/package-managers/bazel/src/main/resources/META-INF/services/org.ossreviewtoolkit.analyzer.PackageManagerFactory new file mode 100644 index 0000000000000..4a84c48bf6bd3 --- /dev/null +++ b/plugins/package-managers/bazel/src/main/resources/META-INF/services/org.ossreviewtoolkit.analyzer.PackageManagerFactory @@ -0,0 +1 @@ +org.ossreviewtoolkit.plugins.packagemanagers.bazel.Bazel$Factory diff --git a/plugins/package-managers/bazel/src/test/kotlin/BazelTest.kt b/plugins/package-managers/bazel/src/test/kotlin/BazelTest.kt new file mode 100644 index 0000000000000..5805de7a715bd --- /dev/null +++ b/plugins/package-managers/bazel/src/test/kotlin/BazelTest.kt @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +import io.kotest.core.spec.style.WordSpec +import io.kotest.matchers.shouldBe + +import org.ossreviewtoolkit.utils.test.getAssetFile + +class BazelTest : WordSpec({ + "transformBazelVersion()" should { + "remove everything except for the version number" { + val bazelVersionOutput = """ + Bazelisk version: development + WARNING: Invoking Bazel in batch mode since it is not invoked from within a workspace (below a directory having a WORKSPACE file). + OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release. + Build label: 7.0.1 + Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer + Build time: Thu Jan 18 18:05:58 2024 (1705601158) + Build timestamp: 1705601158 + Build timestamp as int: 1705601158 + """.trimIndent() + + val result = transformBazelVersion(bazelVersionOutput) + result shouldBe "7.0.1" + } + } + + "parseLockFileGraph()" should { + "produce two scopes and a dependency graph with glog as direct and gflags as indirect dependency" { + val lockFile = parseLockfile(getAssetFile("fixtures/MODULE.bazel.lock")) + + val depDirectives = mapOf( + "glog@0.5.0" to BazelDepDirective("glog", "0.5.0", false), + "googletest@1.14.0" to BazelDepDirective("googletest", "1.14.0", true) + ) + + val result = parseLockFileGraph(lockFile.moduleDepGraph, depDirectives, "Bazel") + result.size shouldBe 2 + + val mainScope = result.single { it.name == "main" } + + val glog = mainScope.dependencies.single { it.id.name == "glog" } + glog.id.name shouldBe "glog" + glog.id.version shouldBe "0.5.0" + + val gflags = glog.dependencies.single { it.id.name == "gflags" } + gflags.id.name shouldBe "gflags" + gflags.id.version shouldBe "2.2.2" + + val devScope = result.single { it.name == "dev" } + val googletest = devScope.dependencies.single { it.id.name == "googletest" } + googletest.id.name shouldBe "googletest" + googletest.id.version shouldBe "1.14.0" + + val abseil = googletest.dependencies.single { it.id.name == "abseil-cpp" } + abseil.id.version shouldBe "20230125.1" + } + } + + "parseBzlmodGraph()" should { + "produce two scopes and a dependency graph with glog as direct and gflags as indirect dependency" { + val graphOutput = getAssetFile("fixtures/bazel_mod_graph_output.json").readText() + val depDirectives = mapOf( + "glog@0.5.0" to BazelDepDirective(name = "glog", version = "0.5.0", devDependency = false), + "googletest@1.14.0" to BazelDepDirective(name = "googletest", version = "1.14.0", devDependency = true) + ) + + val result = parseModuleGraph(graphOutput, depDirectives, "Bazel") + result.size shouldBe 2 + + val mainScope = result.single { it.name == "main" } + mainScope.dependencies.size shouldBe 1 + + val directDep = mainScope.dependencies.first() + directDep.id.name shouldBe "glog" + directDep.id.version shouldBe "0.5.0" + directDep.dependencies.size shouldBe 1 + + val indirectDep = directDep.dependencies.first() + indirectDep.id.name shouldBe "gflags" + indirectDep.id.version shouldBe "2.2.2" + indirectDep.dependencies.size shouldBe 0 + + val devScope = result.single { it.name == "dev" } + devScope.dependencies.size shouldBe 1 + val directDevDep = devScope.dependencies.first() + directDevDep.id.name shouldBe "googletest" + directDevDep.id.version shouldBe "1.14.0" + directDevDep.dependencies.size shouldBe 3 + + val abseil = directDevDep.dependencies.single { it.id.name == "abseil-cpp" } + abseil.id.version shouldBe "20230125.1" + } + } +}) diff --git a/plugins/package-managers/bazel/src/test/kotlin/StarlarkParserTest.kt b/plugins/package-managers/bazel/src/test/kotlin/StarlarkParserTest.kt new file mode 100644 index 0000000000000..52bc4862a313d --- /dev/null +++ b/plugins/package-managers/bazel/src/test/kotlin/StarlarkParserTest.kt @@ -0,0 +1,170 @@ +/* + * Copyright (C) 2024 The ORT Project Authors (see ) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +package org.ossreviewtoolkit.plugins.packagemanagers.bazel + +import io.kotest.core.spec.style.WordSpec +import io.kotest.matchers.collections.shouldContainExactly +import io.kotest.matchers.collections.shouldHaveSize +import io.kotest.matchers.shouldBe + +import org.ossreviewtoolkit.utils.test.shouldNotBeNull + +class StarlarkParserTest : WordSpec({ + "Lexer" should { + "produce tokens" { + val moduleFileContent = """module(name = "yaml-cpp")""" + val lexer = Lexer(moduleFileContent) + + lexer.nextToken() shouldBe Token(TokenType.IDENTIFIER, "module") + lexer.nextToken() shouldBe Token(TokenType.LPAREN, "(") + lexer.nextToken() shouldBe Token(TokenType.IDENTIFIER, "name") + lexer.nextToken() shouldBe Token(TokenType.EQUALS, "=") + lexer.nextToken() shouldBe Token(TokenType.STRING, "yaml-cpp") + lexer.nextToken() shouldBe Token(TokenType.RPAREN, ")") + lexer.nextToken() shouldBe Token(TokenType.EOF, "") + } + "skip comments" { + val moduleFileContent = """ + # yaml-cpp is a YAML parser and emitter in c++ matching the YAML specification. + + module(name="yaml-cpp") # TODO add version + """.trimIndent() + val lexer = Lexer(moduleFileContent) + + lexer.nextToken() shouldBe Token(TokenType.IDENTIFIER, "module") + } + "support multi-line strings" { + val moduleFileContent = """ + ""${'"'} + yaml-cpp is a YAML parser and emitter in c++ + matching the YAML specification. + ""${'"'} + + module(name=""${'"'}yaml-cpp""${'"'}) + """.trimIndent() + val lexer = Lexer(moduleFileContent) + + lexer.nextToken() shouldBe Token( + TokenType.STRING, + "\nyaml-cpp is a YAML parser and emitter in c++\nmatching the YAML specification.\n" + ) + + lexer.nextToken() shouldBe Token(TokenType.IDENTIFIER, "module") + lexer.nextToken() shouldBe Token(TokenType.LPAREN, "(") + lexer.nextToken() shouldBe Token(TokenType.IDENTIFIER, "name") + lexer.nextToken() shouldBe Token(TokenType.EQUALS, "=") + lexer.nextToken() shouldBe Token(TokenType.STRING, "yaml-cpp") + } + } + + "Parser" should { + "handle a single line module directive" { + val moduleFileContent = """module(name = "yaml-cpp", compatibility_level = 1, version = "0.8.0")""" + + val result = Parser(moduleFileContent).parse() + result.module shouldNotBeNull { + name shouldBe "yaml-cpp" + version shouldBe "0.8.0" + compatibilityLevel shouldBe 1 + } + + result.dependencies shouldBe emptyList() + } + + "handle a multi line module directive and dependency declarations" { + val moduleFileContent = """ + ""${'"'} + yaml-cpp is a YAML parser and emitter in c++ matching the YAML specification. + ""${'"'} + + module( + name= "yaml-cpp", + compatibility_level=1, + version ="0.8.0", + ) + + bazel_dep(name = "platforms",version = "0.0.7") + bazel_dep(name="rules_cc", version="0.0.8") + bazel_dep(name="googletest",version="1.14.0" ,dev_dependency= True) + """.trimIndent() + + val result = Parser(moduleFileContent).parse() + result.module shouldNotBeNull { + name shouldBe "yaml-cpp" + version shouldBe "0.8.0" + compatibilityLevel shouldBe 1 + } + + result.dependencies.run { + shouldHaveSize(3) + + shouldContainExactly( + BazelDepDirective(name = "platforms", version = "0.0.7", devDependency = false), + BazelDepDirective(name = "rules_cc", version = "0.0.8", devDependency = false), + BazelDepDirective(name = "googletest", version = "1.14.0", devDependency = true) + ) + } + } + + "ignore everything other than module and bazel_dep directives" { + val moduleFileContent = """ + module( + name = "toolchain_utils", + version = "1.0.0-beta.1", + bazel_compatibility = [ + ">=7.0.0", + ], + compatibility_level = 1, + ) + + bazel_dep(name = "bazel_skylib", version = "1.4.2") + bazel_dep(name = "platforms", version = "0.0.7") + + triplet = use_repo_rule("//toolchain/local/triplet:defs.bzl", "toolchain_local_triplet") + + triplet( + name = "local", + ) + + launcher = use_repo_rule("//toolchain/launcher:repository.bzl", "launcher") + + launcher( + name = "launcher", + ) + """.trimIndent() + + val result = Parser(moduleFileContent).parse() + result.module shouldNotBeNull { + name shouldBe "toolchain_utils" + version shouldBe "1.0.0-beta.1" + compatibilityLevel shouldBe 1 + } + + result.dependencies.run { + shouldHaveSize(2) + + shouldContainExactly( + BazelDepDirective(name = "bazel_skylib", version = "1.4.2", devDependency = false), + BazelDepDirective(name = "platforms", version = "0.0.7", devDependency = false) + ) + } + } + } +}) diff --git a/website/docs/tools/analyzer.md b/website/docs/tools/analyzer.md index 4edf902dde9a3..54a76ca6a6e55 100644 --- a/website/docs/tools/analyzer.md +++ b/website/docs/tools/analyzer.md @@ -13,6 +13,9 @@ It can be further processed or manually edited before passing it to one of the o Currently, the following package managers (grouped by the programming language they are most commonly used with) are supported: * C / C++ + * [Bazel](https://bazel.build/) (**experimental**) (limitations: + bzlmod only, *very* basic parsing of `MODULE.bazel` files, patches to source artifacts are not included, + no support for dynamic linking) * [Conan](https://conan.io/) * Also see: [SPDX documents](#analyzer-for-spdx-documents) * Dart / Flutter