Exclude Windows-specific CCTZ source files in podspec - #2138
Conversation
| srcs) | ||
| # Writes dependencies of this rule. | ||
| for dep in sorted(rule.deps): | ||
| if not dep.startswith("//absl/"): |
There was a problem hiding this comment.
This change looks unrelated to the problem being fixed. Can you explain it to me?
There was a problem hiding this comment.
If a dependency with a different prefix was passed to get_spec_name, it would fail the assertion and throw an AssertionError. for the safety added this check.
There was a problem hiding this comment.
Is that actually happening? Is that preferred to a silent error?
There was a problem hiding this comment.
It's not happening right now, I just added it defensively for edge cases. I originally thought skipping it was safer than crashing the script, but if you prefer an explicit assertion failure to catch bad inputs early, I am happy to remove this check.
There was a problem hiding this comment.
In general, "defensive programming" is for defending against things outside of your control. Here the assertion is a good thing. We are checking our own invariants. An error would be our fault, and it is best to stop immediately with a loud error.
It also also a good rule not to make unrelated changes like this one.
Please revert this part of the change.
Summary
absl/time/internal/cctz/src/*_win.cc) in the generatedabseil.podspec.Description
absl/time/internal/cctz/src/time_zone_name_win.ccintended only for Windows builds. When consuming Abseil via CocoaPods on Apple platforms (iOS, macOS, tvOS, watchOS, visionOS), these Windows-specific files are unnecessary and cause build errors.End-to-End Build Test
gRPC Sampleon iOS Simulatorarm64andx86_64).xcodebuild -project Pods.xcodeproj -target abseilpassed with** BUILD SUCCEEDED **.