Skip to content

Commit

Permalink
Expand support to Protobuf Editions 2024.
Browse files Browse the repository at this point in the history
  • Loading branch information
chungyc authored and blackgnezdo committed Nov 2, 2024
1 parent 3ccaffc commit 32a6429
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ nativeDefaults

{-| Serialized 'FeatureSetDefaults' message containing feature defaults.
This contains the defaults from editions @LEGACY@ to @EDITION_2023@
This contains the defaults from editions @PROTO2@ to @EDITION_2024@
for the native features defined by @google.protobuf.FeatureSet@.
The message was generated with @protoc@ and translated into a Haskell string:
> $ protoc --edition_defaults_out=defaults.binpb --edition_defaults_minimum=PROTO2 --edition_defaults_maximum=2023 google/protobuf/descriptor.proto
> $ protoc --edition_defaults_out=defaults.binpb --edition_defaults_minimum=PROTO2 --edition_defaults_maximum=2024 google/protobuf/descriptor.proto
> $ ghci
> ghci> import Data.ByteString as B
> ghci> B.readFile "defaults.binpb" >>= print . show
-}
serializedNativeDefaults :: ByteString
serializedNativeDefaults = read "\"\\n\\DC3\\CAN\\132\\a\\\"\\NUL*\\f\\b\\SOH\\DLE\\STX\\CAN\\STX \\ETX(\\SOH0\\STX\\n\\DC3\\CAN\\231\\a\\\"\\NUL*\\f\\b\\STX\\DLE\\SOH\\CAN\\SOH \\STX(\\SOH0\\SOH\\n\\DC3\\CAN\\232\\a\\\"\\f\\b\\SOH\\DLE\\SOH\\CAN\\SOH \\STX(\\SOH0\\SOH*\\NUL \\230\\a(\\232\\a\""
serializedNativeDefaults = read "\"\\n\\DC3\\CAN\\132\\a\\\"\\NUL*\\f\\b\\SOH\\DLE\\STX\\CAN\\STX \\ETX(\\SOH0\\STX\\n\\DC3\\CAN\\231\\a\\\"\\NUL*\\f\\b\\STX\\DLE\\SOH\\CAN\\SOH \\STX(\\SOH0\\SOH\\n\\DC3\\CAN\\232\\a\\\"\\f\\b\\SOH\\DLE\\SOH\\CAN\\SOH \\STX(\\SOH0\\SOH*\\NUL \\230\\a(\\233\\a\""
2 changes: 1 addition & 1 deletion proto-lens-protoc/app/protoc-gen-haskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ makeResponse dflags prog request = let
foldl (.|.) zeroBits (fmap (toEnum . fromEnum) features)
-- Do not process actual Protobuf Editions files yet.
& #minimumEdition .~ fromIntegral (fromEnum EDITION_PROTO2)
& #maximumEdition .~ fromIntegral (fromEnum EDITION_2023)
& #maximumEdition .~ fromIntegral (fromEnum EDITION_2024)
in case outputFiles of
Right fs -> preamble & #file .~
[ defMessage
Expand Down

0 comments on commit 32a6429

Please sign in to comment.