Skip to content

Commit

Permalink
Make proto_library based on protoc_minimal
Browse files Browse the repository at this point in the history
BEGIN_PUBLIC
Internal change
END_PUBLIC

PiperOrigin-RevId: 655586183
Change-Id: Ib9f41309d50227efb18f0c050f8397d6a7ef94a1
  • Loading branch information
Googler authored and copybara-github committed Jul 24, 2024
1 parent 5e6ab7b commit 94c4b96
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ lang_proto_library that is not in one of the listed packages.""",
cfg = "exec",
executable = True,
allow_files = True,
default = configuration_field("proto", "proto_compiler"),
default = semantics.PROTOC_MINIMAL if hasattr(semantics, "PROTOC_MINIMAL") else configuration_field("proto", "proto_compiler"),
),
}),
fragments = ["proto"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ private static void registerProtoToolchain(MockToolsConfig config) throws IOExce
+ "')");
}

/** Create a dummy "net/proto2 compiler and proto APIs for all languages and versions. */
/**
* Create a dummy net/proto2 compiler, a dummy protoc_minimal and proto APIs for all languages and
* versions.
*/
private static void createNetProto2(MockToolsConfig config) throws IOException {
config.create(
"net/proto2/compiler/public/BUILD",
Expand All @@ -65,6 +68,18 @@ private static void createNetProto2(MockToolsConfig config) throws IOException {
)
""");

// TODO: b/305068148 - Remove this after blaze is released with protoc_minimal.
config.create(
"third_party/protobuf/compiler/BUILD",
"""
package(default_visibility = ["//visibility:public"])
sh_binary(
name = "protoc_minimal",
srcs = ["protoc_minimal.sh"],
)
""");

if (config.isRealFileSystem()) {
// when using a "real" file system, import the jars and link to ensure compilation
config.create(
Expand Down

0 comments on commit 94c4b96

Please sign in to comment.