Guard gzip pool behind canImport(zlib) for non-Darwin host builds - #2
Closed
poly-jeff wants to merge 1 commit into
Closed
Guard gzip pool behind canImport(zlib) for non-Darwin host builds#2poly-jeff wants to merge 1 commit into
poly-jeff wants to merge 1 commit into
Conversation
The non-Darwin Swift toolchain used for Android/Skip host builds (skip export's x86_64-unknown-linux-gnu pass) has no `zlib` module, so the unconditional `import zlib` broke compilation. Gate the import and the gzip compress/decompress bodies behind `canImport(zlib)`, throwing `GzipError.unsupportedPlatform` on platforms where zlib is unavailable. Apple platforms are unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Closing in favor of a self-contained CI fix in mobile-app: the Linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
connect-swift's
GzipCompressionPooldoes an unconditionalimport zlib. The non-Darwin Swift toolchain used for Android/Skip host builds (skip export'sx86_64-unknown-linux-gnupass) has nozlibmodule, so the import fails withno such module 'zlib'and the whole shared package fails to compile on Linux CI runners.What
import zliband the gzip compress/decompress bodies behind#if canImport(zlib), matching the fork's existing conditional-import conventions (canImport(Darwin),canImport(OSLog),canImport(FoundationNetworking)).compress/decompressthrow a newGzipError.unsupportedPlatformso callers fail loudly instead of the module failing to compile.Consumed downstream via
swift-proto-gateway-us→mobile-app. Tag1.2.3-polymarket.2will be cut from this once merged.Made with Cursor