Skip to content

Commit

Permalink
feat(rust_common): prepare for Kythe release (#5055)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcalandro committed Aug 27, 2021
1 parent 70870fe commit a5f0fdf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
14 changes: 14 additions & 0 deletions kythe/release/BUILD
Expand Up @@ -36,6 +36,7 @@ genrule(
":bazel_java_extractor",
":bazel_jvm_extractor",
":bazel_proto_extractor",
":bazel_rust_extractor",
":javac_extractor",
":javac_wrapper",
":cc_proto_metadata_plugin",
Expand All @@ -45,6 +46,7 @@ genrule(
":jvm_indexer",
":cxx_indexer",
":go_indexer",
":rust_indexer",
":proto_extractor",
"@maven//:org_apache_tomcat_tomcat_annotations_api",
":proto_indexer",
Expand Down Expand Up @@ -75,6 +77,7 @@ genrule(
"--cp $(location cxx_indexer) indexers/cxx_indexer",
"--cp $(location go_indexer) indexers/go_indexer",
"--cp $(location proto_indexer) indexers/proto_indexer",
"--cp $(location rust_indexer) indexers/rust_indexer",
"--cp $(location textproto_indexer) indexers/textproto_indexer",
"--cp $(location javac_extractor) extractors/javac_extractor.jar",
"--cp $(location bazel_cxx_extractor) extractors/bazel_cxx_extractor",
Expand All @@ -83,6 +86,7 @@ genrule(
"--cp $(location bazel_java_extractor) extractors/bazel_java_extractor.jar",
"--cp $(location bazel_jvm_extractor) extractors/bazel_jvm_extractor.jar",
"--cp $(location bazel_proto_extractor) extractors/bazel_proto_extractor",
"--cp $(location bazel_rust_extractor) extractors/bazel_rust_extractor",
"--cp $(location javac_wrapper) extractors/javac-wrapper.sh",
"--cp $(location fuchsia_rust_extractor) extractors/fuchsia_rust_extractor",
"--cp $(location @maven//:org_apache_tomcat_tomcat_annotations_api) jsr250-api-1.0.jar",
Expand Down Expand Up @@ -244,6 +248,16 @@ filegroup(
srcs = ["//kythe/rust/fuchsia_extractor"],
)

filegroup(
name = "bazel_rust_extractor",
srcs = ["//kythe/rust/extractor"],
)

filegroup(
name = "rust_indexer",
srcs = ["//kythe/rust/indexer:bazel_indexer"],
)

filegroup(
name = "tools",
srcs = [
Expand Down
12 changes: 9 additions & 3 deletions kythe/release/README.md
Expand Up @@ -13,6 +13,7 @@ extractors, and tools directly supported by the Kythe team.
- java_indexer.jar :: Java indexer
- jvm_indexer.jar :: JVM jar indexer
- proto_indexer :: Protocol-buffer indexer
- rust_indexer :: Rust indexer
- textproto_indexer :: Text-format protocol-buffer indexer
- extractors
- bazel_cxx_extractor :: C++ extractor for Bazel extra_actions
Expand All @@ -21,6 +22,7 @@ extractors, and tools directly supported by the Kythe team.
- bazel_java_extractor.jar :: Java extractor for Bazel extra_actions
- bazel_jvm_extractor.jar :: JVM extractor for Bazel extra_actions
- bazel_proto_extractor :: Bazel Protocol-buffer extractor
- bazel_rust_extractor :: Bazel Rust extractor
- cxx_extractor :: C++ extractor
- go_extractor :: Go extractor
- javac-wrapper.sh :: javac wrapper script for extractor
Expand Down Expand Up @@ -164,9 +166,9 @@ preserved. See the Examples for usage.

## Indexers

`indexers/cxx_indexer`, `indexers/go_indexer`, and `indexers/java_indexer.jar`
analyze the .kzip files produced by the extractors and emit a stream of
protobuf wire-encoded facts (entries) that conform to
`indexers/cxx_indexer`, `indexers/go_indexer`, `indexers/java_indexer.jar`,
and `indexers/rust_indexer` analyze the .kzip files produced by the extractors
and emit a stream of protobuf wire-encoded facts (entries) that conform to
https://kythe.io/schema. The output stream can be processed by many of the
accompanying binaries in the `tools/` directory.

Expand All @@ -183,3 +185,7 @@ accompanying binaries in the `tools/` directory.
indexers/go_indexer \
/tmp/kythe/579d266e5914257a9bd4458eb9b218690280ae15123d642025f224d10f64e6f3.kzip \
> go.entries

indexers/rust_indexer \
/tmp/kythe/579d266e5914257a9bd4458eb9b218690280ae15123d642025f224d10f64e6f3.kzip \
> rust.entries
20 changes: 20 additions & 0 deletions kythe/release/release.BUILD
Expand Up @@ -149,6 +149,11 @@ filegroup(
srcs = ["extractors/bazel_proto_extractor"],
)

filegroup(
name = "bazel_rust_extractor",
srcs = ["extractors/bazel_rust_extractor"],
)

extractor_action(
name = "extract_kzip_cxx",
args = [
Expand Down Expand Up @@ -235,3 +240,18 @@ extractor_action(
mnemonics = ["GenProtoDescriptorSet"],
output = "$(ACTION_ID).protobuf.kzip",
)

extractor_action(
name = "extract_kzip_rust",
args = [
"--extra_action=$(EXTRA_ACTION_FILE)",
"--output=$(output $(ACTION_ID).rust.kzip)",
"--vnames_config=$(location :vnames_config)",
],
data = [":vnames_config"],
extractor = ":bazel_rust_extractor",
mnemonics = [
"Rustc",
],
output = "$(ACTION_ID).rust.kzip",
)

0 comments on commit a5f0fdf

Please sign in to comment.