Skip to content

Commit

Permalink
Merge pull request #5 from buildbuddy-io/kythepatch
Browse files Browse the repository at this point in the history
kythepatch
  • Loading branch information
tylerwilliams authored Jun 20, 2024
2 parents c969fe0 + 2c9d8df commit 9b4a77e
Show file tree
Hide file tree
Showing 22 changed files with 17 additions and 104 deletions.
11 changes: 0 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/cli/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/explore/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("//tools:build_rules/shims.bzl", "go_library")

package(
default_visibility = ["//kythe:default_visibility"],
default_visibility = ["//visibility:public"],
licenses = ["notice"],
)

Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/filetree/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/graph/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/graphstore/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/link/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/web/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/services/xrefs/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/api/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/explore/BUILD
Original file line number Diff line number Diff line change
@@ -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"],
)

Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/filetree/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/graph/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/identifiers/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/pipeline/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/tools/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package(default_visibility = ["//kythe:default_visibility"])
package(default_visibility = ["//visibility:public"])

filegroup(
name = "http_server",
Expand Down
2 changes: 1 addition & 1 deletion kythe/go/serving/xrefs/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 0 additions & 7 deletions kythe/go/util/schema/BUILD
Original file line number Diff line number Diff line change
@@ -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"])

Expand Down Expand Up @@ -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",
Expand Down
18 changes: 1 addition & 17 deletions kythe/proto/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ 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 = ["//kythe:proto_visibility"])
package(default_visibility = ["//visibility:public"])

filegroup(
name = "public",
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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",
],
)
11 changes: 0 additions & 11 deletions kythe/proto/genproto.bzl
Original file line number Diff line number Diff line change
@@ -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"
],
)
12 changes: 0 additions & 12 deletions third_party/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -170,5 +160,3 @@ sh_binary(
name = "get_sdkroot",
srcs = ["get_sdkroot.sh"],
)

update_generated_protos(name = "update")
30 changes: 0 additions & 30 deletions tools/cpp/BUILD
Original file line number Diff line number Diff line change
@@ -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"])

Expand All @@ -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"],
)

0 comments on commit 9b4a77e

Please sign in to comment.