-
Notifications
You must be signed in to change notification settings - Fork 420
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
Move the pcap example into Source/Examples/ #1119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically looks good to me, one question about the target name.
Motivation: The PCAP example depends on swift-nio-extras. Since grpc-swift now depends on swift-nio-extras (and we have target based dependency resolution) the example can live in-source with other examples. Modifications: - Move Examples/PCAPExample to Source/Examples/PacketCapture. - Make it a target in the GRPC package, rather than its own package. Result: Easier to avoid bit-rot.
|
||
// Client for the PacketCapture example | ||
.target( | ||
name: "PacketCapture", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't all targets be GRPC
prefixed? Targets need to be unique across the whole binary (so all dependencies' targets must be globally unique)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that only necessary for targets which are also products?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glbrntt no, there can only be one module of a given name in the whole binary. Some people call it the Utilities
module problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but we have target specific dependencies right? So this module won't be in the product, because it's an executable target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I think in your particular case it will appear to work (because it's just an example). But I think there's some weird issue when you do swift package edit
where then even modules that aren't officially exported at all start to clash (I think we had this with NIOHTTP1Server or something where multiple NIO packages used to define that).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Lukasa I don't think I filed one but this is a long time ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weissi I can't repro that. Plus, I thought the reasoning for the package description API in 5.2 where packages are explicitly named was to avoid this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glbrntt that is possible. Maybe it's just a problem in < 5.2? Tbh I don't fully understand what's going on but it used to break the release tools. But we do test with 5.0 there...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I can totally believe that it didn't work before 5.2. Any objections to leaving the naming as is @weissi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glbrntt go for it. We can fix that at any time if it causes trouble.
Motivation:
The PCAP example depends on swift-nio-extras. Since grpc-swift now
depends on swift-nio-extras (and we have target based dependency
resolution) the example can live in-source with other examples.
Modifications:
Result:
Easier to avoid bit-rot.