From 1d3dae8a3c989833a17a26742a376b7ec55bd4d4 Mon Sep 17 00:00:00 2001 From: Tyler Williams Date: Thu, 20 Jun 2024 14:06:37 -0700 Subject: [PATCH 1/2] Increase visibility --- kythe/go/services/cli/BUILD | 2 +- kythe/go/services/explore/BUILD | 2 +- kythe/go/services/filetree/BUILD | 2 +- kythe/go/services/graph/BUILD | 2 +- kythe/go/services/graphstore/BUILD | 2 +- kythe/go/services/link/BUILD | 2 +- kythe/go/services/web/BUILD | 2 +- kythe/go/services/xrefs/BUILD | 2 +- kythe/go/serving/api/BUILD | 2 +- kythe/go/serving/explore/BUILD | 2 +- kythe/go/serving/filetree/BUILD | 2 +- kythe/go/serving/graph/BUILD | 2 +- kythe/go/serving/identifiers/BUILD | 2 +- kythe/go/serving/pipeline/BUILD | 2 +- kythe/go/serving/tools/BUILD | 2 +- kythe/go/serving/xrefs/BUILD | 2 +- kythe/proto/BUILD | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kythe/go/services/cli/BUILD b/kythe/go/services/cli/BUILD index 17bc7623dc..a8536dd9b5 100644 --- a/kythe/go/services/cli/BUILD +++ b/kythe/go/services/cli/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "cli", diff --git a/kythe/go/services/explore/BUILD b/kythe/go/services/explore/BUILD index a04f92ee51..4578601c98 100644 --- a/kythe/go/services/explore/BUILD +++ b/kythe/go/services/explore/BUILD @@ -1,7 +1,7 @@ load("//tools:build_rules/shims.bzl", "go_library") package( - default_visibility = ["//kythe:default_visibility"], + default_visibility = ["//visibility:public"], licenses = ["notice"], ) diff --git a/kythe/go/services/filetree/BUILD b/kythe/go/services/filetree/BUILD index de08c571f1..cc22169a74 100644 --- a/kythe/go/services/filetree/BUILD +++ b/kythe/go/services/filetree/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "filetree", diff --git a/kythe/go/services/graph/BUILD b/kythe/go/services/graph/BUILD index 527102ea4a..80b030af29 100644 --- a/kythe/go/services/graph/BUILD +++ b/kythe/go/services/graph/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "graph", diff --git a/kythe/go/services/graphstore/BUILD b/kythe/go/services/graphstore/BUILD index 9e3ecb8460..6d2cc1088a 100644 --- a/kythe/go/services/graphstore/BUILD +++ b/kythe/go/services/graphstore/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "graphstore", diff --git a/kythe/go/services/link/BUILD b/kythe/go/services/link/BUILD index 8fa2c48421..c4b7017d1b 100644 --- a/kythe/go/services/link/BUILD +++ b/kythe/go/services/link/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "link", diff --git a/kythe/go/services/web/BUILD b/kythe/go/services/web/BUILD index aefd111c77..536d6dd82c 100644 --- a/kythe/go/services/web/BUILD +++ b/kythe/go/services/web/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "web", diff --git a/kythe/go/services/xrefs/BUILD b/kythe/go/services/xrefs/BUILD index 3ad95120d2..873acc05da 100644 --- a/kythe/go/services/xrefs/BUILD +++ b/kythe/go/services/xrefs/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "xrefs", diff --git a/kythe/go/serving/api/BUILD b/kythe/go/serving/api/BUILD index c3ef56ddfe..975fb00fca 100644 --- a/kythe/go/serving/api/BUILD +++ b/kythe/go/serving/api/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "api", diff --git a/kythe/go/serving/explore/BUILD b/kythe/go/serving/explore/BUILD index bcdb82c73d..a35fdf6869 100644 --- a/kythe/go/serving/explore/BUILD +++ b/kythe/go/serving/explore/BUILD @@ -1,7 +1,7 @@ load("//tools:build_rules/shims.bzl", "go_library", "go_test") package( - default_visibility = ["//kythe:default_visibility"], + default_visibility = ["//visibility:public"], licenses = ["notice"], ) diff --git a/kythe/go/serving/filetree/BUILD b/kythe/go/serving/filetree/BUILD index 4e3141c3b2..3c527d5296 100644 --- a/kythe/go/serving/filetree/BUILD +++ b/kythe/go/serving/filetree/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "filetree", diff --git a/kythe/go/serving/graph/BUILD b/kythe/go/serving/graph/BUILD index 3227129af0..78768748fe 100644 --- a/kythe/go/serving/graph/BUILD +++ b/kythe/go/serving/graph/BUILD @@ -1,7 +1,7 @@ # gazelle:go_test file load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "graph", diff --git a/kythe/go/serving/identifiers/BUILD b/kythe/go/serving/identifiers/BUILD index 6286df42a8..17c9d99043 100644 --- a/kythe/go/serving/identifiers/BUILD +++ b/kythe/go/serving/identifiers/BUILD @@ -1,6 +1,6 @@ load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "identifiers", diff --git a/kythe/go/serving/pipeline/BUILD b/kythe/go/serving/pipeline/BUILD index dd9256ac6e..1cbb67730e 100644 --- a/kythe/go/serving/pipeline/BUILD +++ b/kythe/go/serving/pipeline/BUILD @@ -1,7 +1,7 @@ # gazelle:go_test file load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "pipeline", diff --git a/kythe/go/serving/tools/BUILD b/kythe/go/serving/tools/BUILD index 0fdca657e5..8d498f5215 100644 --- a/kythe/go/serving/tools/BUILD +++ b/kythe/go/serving/tools/BUILD @@ -1,4 +1,4 @@ -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) filegroup( name = "http_server", diff --git a/kythe/go/serving/xrefs/BUILD b/kythe/go/serving/xrefs/BUILD index 8dde378622..767a0f526a 100644 --- a/kythe/go/serving/xrefs/BUILD +++ b/kythe/go/serving/xrefs/BUILD @@ -1,7 +1,7 @@ # gazelle:go_test file load("//tools:build_rules/shims.bzl", "go_library", "go_test") -package(default_visibility = ["//kythe:default_visibility"]) +package(default_visibility = ["//visibility:public"]) go_library( name = "xrefs", diff --git a/kythe/proto/BUILD b/kythe/proto/BUILD index b76bccaeac..63a24da32a 100644 --- a/kythe/proto/BUILD +++ b/kythe/proto/BUILD @@ -5,7 +5,7 @@ load("//:visibility.bzl", "PUBLIC_PROTO_VISIBILITY") load(":genproto.bzl", "update_generated_protos") load(":go.bzl", "go_proto_library") -package(default_visibility = ["//kythe:proto_visibility"]) +package(default_visibility = ["//visibility:public"]) filegroup( name = "public", From 2c9d8df9774a8c5a21d677f5a643725a1d25a271 Mon Sep 17 00:00:00 2001 From: Tyler Williams Date: Thu, 20 Jun 2024 14:26:24 -0700 Subject: [PATCH 2/2] Remove more stuff --- WORKSPACE | 11 ----------- kythe/go/util/schema/BUILD | 7 ------- kythe/proto/BUILD | 16 ---------------- kythe/proto/genproto.bzl | 11 ----------- third_party/bazel/BUILD | 12 ------------ tools/cpp/BUILD | 30 ------------------------------ 6 files changed, 87 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 009de188bb..fe3622e26d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -87,17 +87,6 @@ ruby_bundle( gemfile_lock = "//kythe/web/site:Gemfile.lock", ) -http_archive( - name = "aspect_bazel_lib", - sha256 = "d488d8ecca98a4042442a4ae5f1ab0b614f896c0ebf6e3eafff363bcc51c6e62", - strip_prefix = "bazel-lib-1.33.0", - url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.33.0/bazel-lib-v1.33.0.tar.gz", -) - -load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies") - -aspect_bazel_lib_dependencies() - # clang-tidy aspect wrapper load( "@bazel_tools//tools/build_defs/repo:git.bzl", diff --git a/kythe/go/util/schema/BUILD b/kythe/go/util/schema/BUILD index e2c81cb360..9629ae56ff 100644 --- a/kythe/go/util/schema/BUILD +++ b/kythe/go/util/schema/BUILD @@ -1,7 +1,6 @@ # The checked-in generated files confuse gazelle. # gazelle:ignore load("//tools:build_rules/shims.bzl", "go_library", "go_test") -load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") package(default_visibility = ["//kythe:default_visibility"]) @@ -30,12 +29,6 @@ genrule( visibility = ["//visibility:private"], ) -write_source_file( - name = "schema_index_sync", - in_file = ":schema_index", - out_file = "indexdata.go", -) - go_test( name = "schema_test", size = "small", diff --git a/kythe/proto/BUILD b/kythe/proto/BUILD index 63a24da32a..351dc854af 100644 --- a/kythe/proto/BUILD +++ b/kythe/proto/BUILD @@ -2,7 +2,6 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("//:visibility.bzl", "PUBLIC_PROTO_VISIBILITY") -load(":genproto.bzl", "update_generated_protos") load(":go.bzl", "go_proto_library") package(default_visibility = ["//visibility:public"]) @@ -749,11 +748,6 @@ java_proto_library( deps = [":metadata_proto"], ) -bzl_library( - name = "genproto_bzl", - srcs = ["genproto.bzl"], -) - bzl_library( name = "go_bzl", srcs = ["go.bzl"], @@ -850,13 +844,3 @@ go_proto_library( proto = ":vnames_config_proto", deps = [":storage_go_proto"], ) - -# Uses native.existing_rules() to find rules to update; must come last. -update_generated_protos( - name = "update", - additional_update_targets = [ - # Ensure this updates the protos which live elsewhere. - "//kythe/go/util/riegeli:riegeli_test_go_proto_sync", - "//third_party/bazel:update", - ], -) diff --git a/kythe/proto/genproto.bzl b/kythe/proto/genproto.bzl index ec30a5186c..e69de29bb2 100644 --- a/kythe/proto/genproto.bzl +++ b/kythe/proto/genproto.bzl @@ -1,11 +0,0 @@ -load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") - -def update_generated_protos(name, additional_update_targets = []): - write_source_files( - name = name, - additional_update_targets = additional_update_targets + [ - key - for key, value in native.existing_rules().items() - if value["kind"] == "_write_source_file" - ], - ) diff --git a/third_party/bazel/BUILD b/third_party/bazel/BUILD index bbf24aae3f..fb5b7fbd2e 100644 --- a/third_party/bazel/BUILD +++ b/third_party/bazel/BUILD @@ -5,10 +5,8 @@ load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_java//java:defs.bzl", "java_proto_library") load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") -load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory") load("//kythe/proto:go.bzl", "go_proto_library") -load("//kythe/proto:genproto.bzl", "update_generated_protos") package(default_visibility = ["//visibility:public"]) @@ -36,14 +34,6 @@ copy_to_directory( visibility = ["//visibility:private"], ) -write_source_file( - name = "proto_srcs_sync", - in_file = ":proto_srcs", - out_file = "src", - tags = ["local"], # Fails spuriously remotely. - visibility = ["//visibility:private"], -) - alias( name = "extra_actions_base_proto", actual = "//third_party/bazel/src/main/protobuf:extra_actions_base_proto", @@ -170,5 +160,3 @@ sh_binary( name = "get_sdkroot", srcs = ["get_sdkroot.sh"], ) - -update_generated_protos(name = "update") diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD index 4578c25c90..802d9a9142 100644 --- a/tools/cpp/BUILD +++ b/tools/cpp/BUILD @@ -1,5 +1,4 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library") -load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template_rule") package(default_visibility = ["//visibility:public"]) @@ -16,32 +15,3 @@ bzl_library( name = "toolchain_utils", srcs = ["toolchain_utils.bzl"], ) - -filegroup( - name = "clang_tidy_deps", - srcs = [ - "@llvm-project//clang:builtin_headers_gen", - "@llvm-project//clang-tools-extra/clang-tidy", - ], -) - -expand_template_rule( - name = "clang_tidy_gen", - out = "run_clang_tidy.sh", - data = [ - "@llvm-project//clang:builtin_headers_gen", - "@llvm-project//clang-tools-extra/clang-tidy", - ], - is_executable = True, - substitutions = { - "@RESOURCES@": "$(execpaths @llvm-project//clang:builtin_headers_gen)", - "@CLANG_TIDY@": "$(execpath @llvm-project//clang-tools-extra/clang-tidy)", - }, - template = "run_clang_tidy.sh.in", -) - -sh_binary( - name = "clang_tidy", - srcs = ["run_clang_tidy.sh"], - data = [":clang_tidy_deps"], -)