Skip to content

[minizip-ng] Add zlib-ng feature for zlib compression#52636

Closed
ricardoofnl wants to merge 1 commit into
microsoft:masterfrom
ricardoofnl:minizip-ng-zlib-ng
Closed

[minizip-ng] Add zlib-ng feature for zlib compression#52636
ricardoofnl wants to merge 1 commit into
microsoft:masterfrom
ricardoofnl:minizip-ng-zlib-ng

Conversation

@ricardoofnl

Copy link
Copy Markdown

Fixes #52615.

minizip-ng (a project under the zlib-ng umbrella) can build its zlib compression against either the original zlib or zlib-ng, selected via the upstream MZ_ZLIB_FLAVOR option. Previously the port hard-depended on zlib and explicitly disabled zlib-ng detection.

This PR adds a zlib-ng feature that pulls in the zlib-ng port and selects the zlib-ng flavor, while pinning the existing zlib feature to the zlib flavor. Pinning the flavor explicitly also lets us drop the CMAKE_DISABLE_FIND_PACKAGE_ZLIBNG workaround.

Built and verified on x64-linux: the default (zlib) build links against zlib, and the new zlib-ng feature links against zlib-ng. Both configurations build successfully.

minizip-ng supports building against zlib-ng (via MZ_ZLIB_FLAVOR) instead
of the original zlib. Add a `zlib-ng` feature that pulls in the zlib-ng
port and selects the zlib-ng flavor explicitly, and pin the existing
`zlib` feature to the zlib flavor (replacing the CMAKE_DISABLE_FIND_PACKAGE
hack). Resolves microsoft#52615.
]
},
"zlib-ng": {
"description": "Enables ZLIB compression using zlib-ng instead of zlib",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VCPKG has a no alternatives rule and this can't be used together with zlib.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okay, I apologize or should we switch the default to zlib-ng?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me that'd make sense but it'd be a breaking changes so I guess it needs the maintainers to decide.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, actually. At most, minizip-ng would link to zlib-ng (non-compat mode in the vcpkg port -> zng_* symbols) instead of zlib. Everyone running vcpkg install minizip-ng would suddenly get a different dependency (zlib-ng replacing zlib) out of nowhere

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everyone running vcpkg install minizip-ng would suddenly get a different dependency (zlib-ng replacing zlib) out of nowhere

Yeah but that'd then conflict with other libs depending on normal zlib.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like I'm going to close this PR. vcpkg actually wants an overlay port instead of changing the default upstream port, although zlib-ng is definitely better performance-wise.
but again thanks dude!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[minizip-ng] Allow using zlib-ng for zlib compression

2 participants