Fix Windows build: exclude CZlib where system zlib is absent#9
Merged
Conversation
powerje
force-pushed
the
fix-windows-zlib
branch
from
June 29, 2026 10:05
7273372 to
51827fb
Compare
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.
The
build (windows-latest)CI job has been failing (pre-existing — also red on trunk) with:zlib ships with the macOS SDK and the Linux Swift toolchain but not on Windows, so the
CZlibwrapper can't compile there.The
MTHCore → CZlibdependency is now gated with.when(platforms: [.macOS, .linux]). A platform condition is evaluated against the build destination, so this is also correct under cross-compilation — unlike a manifest#if os(Windows), which keys off the host that evaluates the manifest (it would pull CZlib into a cross-compile to Windows, and drop it from a cross-compile from Windows to Linux). On any non-listed destination, CZlib drops out of the build graph and the#if canImport(CZlib)-guarded MCCP compression compiles out; macOS/Linux are unchanged.Manifest only — no source changes.
Note: the sibling
Cmth/CmthColorC-oracle targets still use a host-based#if !os(Windows)block. That has the same host-vs-destination limitation, but those are entangled with their product declarations and are C targets that can't build on Windows at all, so converting them is a separate change; the native Windows CI runner is unaffected.