Skip to content

Commit 15863ff

Browse files
mkruskal-googlecopybara-github
authored andcommitted
Editions: Include defaults for any features in the generated pool.
This helps make the API more complete, since the FeatureSet object will always be fully resolved on any accessible features. This specifically targets C++ plugins though, which will now have their features filled in by default. Before, any proto files that didn't include the language-specific features would result in unresolved extensions in the generators. PiperOrigin-RevId: 557232654
1 parent f57b3ee commit 15863ff

File tree

9 files changed

+452
-127
lines changed

9 files changed

+452
-127
lines changed

src/google/protobuf/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ filegroup(
685685
"unittest_features.proto",
686686
"unittest_import.proto",
687687
"unittest_import_public.proto",
688-
"unittest_invalid_features.proto",
689688
"unittest_lite_imports_nonlite.proto",
690689
"unittest_mset.proto",
691690
"unittest_mset_wire_format.proto",

src/google/protobuf/compiler/command_line_interface_unittest.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,10 @@ TEST_F(CommandLineInterfaceTest, Plugin_RuntimeFeatures) {
15641564
message_encoding: LENGTH_PREFIXED
15651565
json_format: ALLOW
15661566
raw_features { field_presence: IMPLICIT }
1567+
[pb.cpp] {
1568+
legacy_closed_enum: false
1569+
utf8_validation: VERIFY_PARSE
1570+
}
15671571
)pb"));
15681572
EXPECT_THAT(request.source_file_descriptors(0)
15691573
.message_type(0)
@@ -1577,6 +1581,10 @@ TEST_F(CommandLineInterfaceTest, Plugin_RuntimeFeatures) {
15771581
message_encoding: LENGTH_PREFIXED
15781582
json_format: ALLOW
15791583
raw_features { field_presence: IMPLICIT }
1584+
[pb.cpp] {
1585+
legacy_closed_enum: false
1586+
utf8_validation: VERIFY_PARSE
1587+
}
15801588
)pb"));
15811589
}
15821590

0 commit comments

Comments
 (0)