square / square/wire

Wire Swift compiler doesn't exclude `google.protobuf.*` properly

Open
#1,928 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lang/swift
Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

When trying to generate swift protos, we were getting a bunch of extra google protos such as google.protobuf.EnumOption. We tried to exclude them with the following.

  args = [
    "--proto_path=$protoPath",
    "--swift_out=$swiftOut",
    "--includes=${includedTypes.join(",")}",
    "--excludes=google.protobuf.*"
  ]

which did not take. We also tried to exclude them using a manifest file using the experimental manifest feature which also had no effect.

wellknowntypes:
  roots:
    - google.protobuf.Duration
  prunes:
    - google.protobuf.*

The root happened to be another google protobuf type, but that doesn't matter. This occurs with any root.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown Swift compiler arguments and experimental manifest, using a root such as google.protobuf.Duration. Trace the Wire Swift compiler's handling of --includes, --excludes, and manifest prunes. Done means google.protobuf.* types are excluded without removing the requested root type.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, swift
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.