-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement Request: Add support for multiple instances of the --swift_opt=ProtoPathModuleMappings=PATH flag #1067
Comments
What's creating your mapping files? i.e. - if something were already auto creating them, then it would seen like merging/concatenating is along the same lines, no? But yea, supporting it for that one seems doable, we already have validation for collisions/etc. Your transitive dependencies comment is a little general, so I'm not sure what you're asking there. I think what you might be asking about isn't at all specific to SwiftProtobuf and is more about usage of protoc since it needs the imported descriptors to build the graph and then generate. You can avoid using |
ps - if we do support multiple |
|
Only thing I'm aware of is in rules_swift. The TextFormat in this case should be pretty simple, you can likely do it in a little bit of bash to also glob out the files.
protoc does have:
Yea, just meant in general, if we do look at providing it, to make it fully useful, we'd have to make sure others take on the work since someone who needs it here might also need in there. |
Background
The
--swift_opt=ProtoPathModuleMappings=PATH
flag allows you to specify a file containing the mapping of proto file to Swift module that includes it, so that the module dependency graph can be represented in the generated proto sources.One pattern we've found ourselves doing is having a multi layer dependency graph of Swift packages where each package contains protos that get generated into a module, but are also available for usage by downstream dependents. The way we do this is by adding
-I=.build/checkouts/DEPENDENCY/Protos
include paths in the proto generation step (sample Makefile).When there's a need for a single mapping file, this works great, but as you add more and more dependencies, we've needed to resort to concatenating all of the mappings files before passing it in the flag.
Enhancement Request
Ideally, the generator should accept multiple instances of the
ProtoPathModuleMappings
option, so that clients can avoid the external concatenation command.Created this issue to discuss this particular idea, but also to discuss the general problem of transitive dependencies and generator and see if there's been any thought in this area (i.e. outside of bazel)
The text was updated successfully, but these errors were encountered: