Skip to content

Commit

Permalink
Remove dependency on rules_proto
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 682265731
Change-Id: Ide77c3f8a80e7c85ad5c78c55f83dbcbeca9e2b3
  • Loading branch information
comius authored and copybara-github committed Oct 4, 2024
1 parent af004d1 commit 9c452c6
Show file tree
Hide file tree
Showing 13 changed files with 10 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ filegroup(
"@rules_java//:WORKSPACE",
"@rules_license//:WORKSPACE",
"@rules_pkg//:WORKSPACE",
"@rules_proto//proto:defs",
"@rules_python//:WORKSPACE",
"@rules_testing//:LICENSE",
] + select({
Expand Down
1 change: 0 additions & 1 deletion src/MODULE.tools
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
module(name = "bazel_tools")

bazel_dep(name = "rules_license", version = "0.0.7")
bazel_dep(name = "rules_proto", version = "6.0.2")

bazel_dep(name = "buildozer", version = "7.1.2")
bazel_dep(name = "platforms", version = "0.0.10")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ gen_workspace_stanza(
"rules_cc", # For auto-load cc rules symbols
"rules_python", # For auto-load python rules symbols
"rules_license", # for license attestations
"rules_proto",
],
use_maybe = 1,
visibility = ["//:__pkg__"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ public void setupMockClient(MockToolsConfig config, List<String> workspaceConten
"rules_java_workspace",
"rules_python_workspace",
"protobuf_workspace",
"third_party/bazel_rules/rules_proto",
"build_bazel_apple_support",
"local_config_xcode_workspace",
"third_party/bazel_rules/rules_cc");
Expand Down Expand Up @@ -662,9 +661,6 @@ function rlocation() {
config.create("embedded_tools/objcproto/empty.cc");
config.create("embedded_tools/objcproto/well_known_type.proto");

config.create("third_party/bazel_rules/rules_proto/WORKSPACE");
config.create("third_party/bazel_rules/rules_proto/MODULE.bazel", "module(name='rules_proto')");

// Copies bazel_skylib from real @bazel_skylib (needed by rules_python)
PathFragment path = PathFragment.create(runfiles.rlocation("bazel_skylib/lib/paths.bzl"));
config.copyDirectory(
Expand Down Expand Up @@ -841,7 +837,6 @@ public ImmutableMap<String, NonRegistryOverride> getBuiltinModules(BlazeDirector
.put("rules_python_internal", "rules_python_internal_workspace")
.put("bazel_skylib", "bazel_skylib_workspace")
.put("protobuf", "protobuf_workspace")
.put("rules_proto", "third_party/bazel_rules/rules_proto")
.put("build_bazel_apple_support", "build_bazel_apple_support")
.put("local_config_xcode", "local_config_xcode_workspace")
.put("rules_cc", "third_party/bazel_rules/rules_cc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ gen_workspace_stanza(
preamble = "load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')",
repos = [
"rules_cc",
"rules_proto",
"rules_python",
],
visibility = ["//visibility:private"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1757,11 +1757,6 @@ protected void useReducedSetOfRules() throws Exception {
helper.writeFile(
"/workspace/build_bazel_apple_support/MODULE.bazel",
"module(name='build_bazel_apple_support')");
helper.writeFile("/workspace/third_party/bazel_rules/rules_proto/BUILD");
helper.writeFile("/workspace/third_party/bazel_rules/rules_proto/WORKSPACE");
helper.writeFile(
"/workspace/third_party/bazel_rules/rules_proto/MODULE.bazel",
"module(name='rules_proto')");
helper.writeFile("/workspace/third_party/bazel_rules/rules_cc/BUILD");
helper.writeFile("/workspace/third_party/bazel_rules/rules_cc/WORKSPACE");
helper.writeFile(
Expand Down
3 changes: 2 additions & 1 deletion src/test/shell/bazel/runfiles_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${CURRENT_DIR}/../integration_test_setup.sh" \
|| { echo "integration_test_setup.sh not found!" >&2; exit 1; }

function test_runfiles_without_bzlmod() {
# TODO - ilist@: reenable when java_tools depends on protobuf
function disable_test_runfiles_without_bzlmod() {
name="blorp_malorp"
echo "workspace(name = '$name')" > WORKSPACE
mkdir foo
Expand Down
9 changes: 4 additions & 5 deletions src/test/shell/integration/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ filegroup(
)

gen_workspace_stanza(
name = "rules_proto_stanza",
out = "rules_proto_stanza.txt",
name = "protobuf_stanza",
out = "protobuf_stanza.txt",
repos = [
"rules_proto",
"rules_python",
],
)
Expand Down Expand Up @@ -374,12 +373,12 @@ sh_test(
name = "modify_execution_info_test",
srcs = ["modify_execution_info_test.sh"],
data = [
":rules_proto_stanza.txt",
":protobuf_stanza.txt",
":test-deps",
"//third_party/zlib",
"@bazel_tools//tools/bash/runfiles",
],
tags = ["requires-network"], # Allow this test to access internet to fetch rules_proto dependencies.
tags = ["requires-network"], # Allow this test to access internet to fetch protobuf dependencies.
)

sh_test(
Expand Down
2 changes: 1 addition & 1 deletion third_party/grpc/bazel/generate_cc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This is an internal rule used by cc_grpc_library, and shouldn't be used
directly.
"""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load("@protobuf//bazel/common:proto_info.bzl", "ProtoInfo")
load(
":protobuf.bzl",
"get_include_directory",
Expand Down
2 changes: 1 addition & 1 deletion third_party/grpc/bazel/protobuf.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.
"""Utility functions for generating protobuf code."""

load("@rules_proto//proto:defs.bzl", "ProtoInfo")
load("@protobuf//bazel/common:proto_info.bzl", "ProtoInfo")

_PROTO_EXTENSION = ".proto"
_VIRTUAL_IMPORTS = "/_virtual_imports/"
Expand Down
4 changes: 2 additions & 2 deletions third_party/pprof/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@rules_java//java:defs.bzl", "java_proto_library")
load("@protobuf//bazel:java_proto_library.bzl", "java_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_license//rules:license.bzl", "license")
load("@rules_proto//proto:defs.bzl", "proto_library")

package(
default_applicable_licenses = [":license"],
Expand Down
1 change: 0 additions & 1 deletion third_party/remoteapis/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module(
)

bazel_dep(name = "rules_java", version = "4.0.0")
bazel_dep(name = "rules_proto", version = "4.0.0")
bazel_dep(name = "protobuf", version = "3.19.0")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a")
bazel_dep(name = "bazel", version = "", repo_name = "io_bazel")
7 changes: 0 additions & 7 deletions workspace_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ WORKSPACE_REPOS = {
"sha256": "dfbadbb37a79eb9e1cc1e156ecb8f817edf3899b28bc02410a6c1eb88b1a6862",
"urls": ["https://github.com/bazelbuild/rules_java/releases/download/7.12.1/rules_java-7.12.1.tar.gz"],
},
# Used in src/test/java/com/google/devtools/build/lib/blackbox/framework/blackbox.WORKSAPCE
"rules_proto": {
"archive": "5.3.0-21.7.tar.gz",
"sha256": "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd",
"strip_prefix": "rules_proto-5.3.0-21.7",
"urls": ["https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz"],
},
"bazel_skylib": {
"archive": "bazel-skylib-1.6.1.tar.gz",
"sha256": "9f38886a40548c6e96c106b752f242130ee11aaa068a56ba7e56f4511f33e4f2",
Expand Down

0 comments on commit 9c452c6

Please sign in to comment.