Java compilation error occurs for envoy since v1.37.0#1383
Open
jrhee17 wants to merge 1 commit intobufbuild:mainfrom
Open
Java compilation error occurs for envoy since v1.37.0#1383jrhee17 wants to merge 1 commit intobufbuild:mainfrom
v1.37.0#1383jrhee17 wants to merge 1 commit intobufbuild:mainfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Upstream envoy protos recently added new regex rules: e.g.
^$|^[^\\x00-\\x1f\\x7f \",;<>\\\\]+$This is causing a compilation error on our side:
From my reading, it seems like the string escape method is causing this
protoc-gen-validate/templates/java/register.go
Lines 442 to 450 in 92b9a7d
\\xcase:%qproduces\\x00,ReplaceAllmatches\xwithin it and over-escapes to\\\x00"case:%qalready produces\", the extraReplaceAllover-escapes to\\"This currently requires the following workaround line/armeria#6714
Modifications
\u00rewrites since Java natively supports them anywaysReplaceAll(s,",")since this is handled bySprintf\xto\\xonly if exactly\x(without a prepending backslash)Misc
bazel/repositories.bzlto fix local build errors on macOS. Happy to revert if maintainers prefer.