-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update protoc release to include editions language features proto for…
… Go (#19013) * Update protoc release to include editions language features proto for Go related to #16211 PiperOrigin-RevId: 684366194 * Internal change PiperOrigin-RevId: 684173423 * Pin to python 3.12 in upb/macos tests. Python 3.13 seems to have some issues with our dependencies and both numpy and setuptools fails to install. PiperOrigin-RevId: 689955916 --------- Co-authored-by: Protobuf Team Bot <protobuf-github-bot@google.com>
- Loading branch information
1 parent
bb0d575
commit 63d966b
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
filegroup( | ||
name = "go_features_proto_srcs", | ||
srcs = ["go_features.proto"], | ||
visibility = ["//:__subpackages__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Protocol Buffers - Google's data interchange format | ||
// Copyright 2023 Google Inc. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file or at | ||
// https://developers.google.com/open-source/licenses/bsd | ||
|
||
syntax = "proto2"; | ||
|
||
package pb; | ||
|
||
import "google/protobuf/descriptor.proto"; | ||
|
||
option go_package = "google.golang.org/protobuf/types/gofeaturespb"; | ||
|
||
extend google.protobuf.FeatureSet { | ||
optional GoFeatures go = 1002; | ||
} | ||
|
||
message GoFeatures { | ||
// Whether or not to generate the deprecated UnmarshalJSON method for enums. | ||
optional bool legacy_unmarshal_json_enum = 1 [ | ||
retention = RETENTION_RUNTIME, | ||
targets = TARGET_TYPE_ENUM, | ||
targets = TARGET_TYPE_FILE, | ||
feature_support = { | ||
edition_introduced: EDITION_2023, | ||
edition_deprecated: EDITION_2023, | ||
deprecation_warning: "The legacy UnmarshalJSON API is deprecated and " | ||
"will be removed in a future edition.", | ||
}, | ||
edition_defaults = { edition: EDITION_LEGACY, value: "true" }, | ||
edition_defaults = { edition: EDITION_PROTO3, value: "false" } | ||
]; | ||
|
||
enum APILevel { | ||
// API_LEVEL_UNSPECIFIED results in selecting the OPEN API, | ||
// but needs to be a separate value to distinguish between | ||
// an explicitly set api level or a missing api level. | ||
API_LEVEL_UNSPECIFIED = 0; | ||
API_OPEN = 1; | ||
API_HYBRID = 2; | ||
API_OPAQUE = 3; | ||
} | ||
|
||
// One of OPEN, HYBRID or OPAQUE. | ||
optional APILevel api_level = 2 [ | ||
retention = RETENTION_RUNTIME, | ||
targets = TARGET_TYPE_MESSAGE, | ||
targets = TARGET_TYPE_FILE, | ||
feature_support = { | ||
edition_introduced: EDITION_2023, | ||
}, | ||
edition_defaults = { edition: EDITION_LEGACY, value: "API_LEVEL_UNSPECIFIED" }, | ||
edition_defaults = { edition: EDITION_2024, value: "API_OPAQUE" } | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters