title: Error: failed post-processing: 820:39: missing ',' in argument list
body: <p><code>protoc-gen-validate</code> is a protoc plugin to generate polyglot message validators.</p>
  <p>The project uses Bazel for builds and has an <a href="https://github.com/envoyproxy/protoc-gen-validate/pull/546" rel="nofollow noreferrer">open pull request</a> to add support for customization of validation error messages.</p>
  <p>The original code was made in 2020. Recently it was updated with the latest code, and after fixing all merge conflicts now it fails to build, but I can't find the issue:</p>
  <pre><code>~/GitHub/protoc-gen-validate (i18n) $ make bazel-tests
  bazel test //tests/... --test_output=errors
  INFO: Analyzed 68 targets (0 packages loaded, 0 targets configured).
  INFO: Found 62 targets and 6 test targets...
  ERROR: /Users/mparnisari/GitHub/protoc-gen-validate/tests/harness/cases/BUILD:46:21: Generating into bazel-out/darwin-fastbuild/bin/tests/harness/cases/go_/github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go failed: (Exit 1): go-protoc-bin failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_go/go/tools/builders/go-protoc-bin_/go-protoc-bin -protoc bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc ... (remaining 117 argument(s) skipped)
  
  Use --sandbox_debug to see verbose messages from the sandbox
  [error] failed post-processing: 820:39: missing ',' in argument list (and 10 more errors)
  --validate_out: protoc-gen-validate: Plugin failed with status code 1.
  2021/12/14 23:46:43 error running protoc: exit status 1
  ERROR: /Users/mparnisari/GitHub/protoc-gen-validate/tests/harness/cases/BUILD:46:21 GoCompilePkg tests/harness/cases/go.a failed: (Exit 1): go-protoc-bin failed: error executing command bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/io_bazel_rules_go/go/tools/builders/go-protoc-bin_/go-protoc-bin -protoc bazel-out/darwin-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc ... (remaining 117 argument(s) skipped)
  
  Use --sandbox_debug to see verbose messages from the sandbox
  INFO: Elapsed time: 0.962s, Critical Path: 0.48s
  INFO: 8 processes: 8 internal.
  FAILED: Build did NOT complete successfully
  </code></pre>
  <p>Judging by the fact that the error  (<code>[error] failed post-processing: 820:39: missing ',' in argument list (and 10 more errors)</code>) appears immediately after I fire the tests command, I figure this is an issue with Bazel, but I'm not sure.</p>
  <hr />
  <p>UPDATE 1: I narrowed it down to this:</p>
  <pre><code>~/GitHub/fork/protoc-gen-validate (i18n) $ make testcases
  cd tests/harness/cases &amp;&amp; \
          protoc \
                  -I . \
                  -I ../../.. \
                  --go_out=&quot;module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go;other_package,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go,Mvalidate/validate.proto=github.com/envoyproxy/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb,Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb,Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb,Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb,Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb,Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb:./go&quot; \
                  --plugin=protoc-gen-go=/Users/mparnisari/go/bin/protoc-gen-go \
                  --validate_out=&quot;module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,lang=go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go:./go&quot; \
                  ./*.proto
  filename-with-dash.proto:5:1: warning: Import validate/validate.proto is unused.
  [error] failed post-processing: 820:39: missing ',' in argument list (and 10 more errors)
  --validate_out: protoc-gen-validate: Plugin failed with status code 1.
  make: 
  *** [testcases] Error 1
  </code></pre>
  <hr />
  <p>UPDATE 2: narrowed it down. if I delete this file: <code>tests/harness/cases/maps.proto</code></p>
  <p><code>make testcases</code> works</p>
  <hr />
  <p>UPDATE 3: narrowed it down. if I remove these lines: <a href="https://github.com/envoyproxy/protoc-gen-validate/blob/main/tests/harness/cases/maps.proto#L14-L17" rel="nofollow noreferrer">https://github.com/envoyproxy/protoc-gen-validate/blob/main/tests/harness/cases/maps.proto#L14-L17</a></p>
  <p><code>make testcase</code> works</p>