You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running protoc-gen-validate on Windows, which uses a \ instead of / as the file path separator, the following warnings are generated with buf.build:
Warning: Generated file name "some\\package\\common.pb.validate.go" does not conform to the Protobuf generation specification. Note that the file name must be relative, use "/" instead of "\", and not use "." or ".." as part of the file name. Buf will continue without error here, but please raise an issue with the maintainer of the plugin and reference https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L122
While the warning itself is annoying, the real issue is that this breaks the use of the module parameter. Normally specifying module=some/package would strip the some/package prefix from the path, but due to the paths having a backslash instead this does not work. Specifying module=some\package\ achieves the desired outcome, but this breaks portability. Also note that an additional trailing backslash is needed as the strings.TrimLeft(..., "/") in the generator code also doesn't work.
I believe this is fixed in the protoc-gen-star package already due to lyft/protoc-gen-star#97, but it doesn't look like a new release has been cut since that PR was merged. Would updating to a git hash version be acceptable? I'm happy to submit a PR if needed.
The text was updated successfully, but these errors were encountered:
nvx
added a commit
to nvx/protoc-gen-validate
that referenced
this issue
Jul 12, 2022
When running protoc-gen-validate on Windows, which uses a
\
instead of/
as the file path separator, the following warnings are generated with buf.build:While the warning itself is annoying, the real issue is that this breaks the use of the module parameter. Normally specifying
module=some/package
would strip thesome/package
prefix from the path, but due to the paths having a backslash instead this does not work. Specifyingmodule=some\package\
achieves the desired outcome, but this breaks portability. Also note that an additional trailing backslash is needed as thestrings.TrimLeft(..., "/")
in the generator code also doesn't work.https://github.com/envoyproxy/protoc-gen-validate/blob/978fc60fbe180f2b8d4b8577a7399714dfec2558/module/validate.go#L48-L54
I believe this is fixed in the
protoc-gen-star
package already due to lyft/protoc-gen-star#97, but it doesn't look like a new release has been cut since that PR was merged. Would updating to a git hash version be acceptable? I'm happy to submit a PR if needed.The text was updated successfully, but these errors were encountered: