Skip to content

zlib: simplify arguments & explain --shared & --static#490608

Merged
doronbehar merged 2 commits intoNixOS:stagingfrom
doronbehar:pkg/zlib@simplify
Feb 21, 2026
Merged

zlib: simplify arguments & explain --shared & --static#490608
doronbehar merged 2 commits intoNixOS:stagingfrom
doronbehar:pkg/zlib@simplify

Conversation

@doronbehar
Copy link
Copy Markdown
Contributor

@doronbehar doronbehar commented Feb 15, 2026

A draft until:

Is merged. Slightly related PRs:

Things done

Builds to verify (please add more that you think are worth testing):

nom build -Lf. pkgsCross.{x86_64-cygwin,ucrt64,aarch64-multiplatform}{,.pkgsStatic}.zlib --keep-going

@doronbehar doronbehar changed the title zlib: stdenv.hostPlatform.isStatic to simplify static/shared logic zlib: simplify static/shared logic Feb 15, 2026
@marcin-serwin

This comment was marked as resolved.

@doronbehar

This comment was marked as resolved.

doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Feb 15, 2026
Help prepare to remove `zlib`'s `"static"` output, see related issues:

- NixOS#490608
- NixOS#66461
- NixOS#476830
doronbehar added a commit to doronbehar/nixpkgs that referenced this pull request Feb 15, 2026
Help prepare to remove `zlib`'s `"static"` output, see related issues:

- NixOS#490608
- NixOS#66461
- NixOS#476830
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: java Including JDK, tooling, other languages, other VMs labels Feb 15, 2026
@doronbehar doronbehar marked this pull request as draft February 15, 2026 11:22
@doronbehar doronbehar changed the title zlib: simplify static/shared logic zlib: always apply all substitutions Feb 15, 2026
@doronbehar doronbehar changed the title zlib: always apply all substitutions zlib: simplify arguments & explain --shared & --static Feb 15, 2026
@nixpkgs-ci nixpkgs-ci bot removed the 6.topic: java Including JDK, tooling, other languages, other VMs label Feb 15, 2026
@marcin-serwin
Copy link
Copy Markdown
Contributor

marcin-serwin commented Feb 15, 2026

Diff looks ok, no relevant changes to the zlib outputs as far as I can tell. Making it explicit that shared = true, static = false is impossible makes sense.

With the reduced scope we don't need to wait for #490616 and #490615 to merge this. Though, it would be nice to wait for #490607 to avoid merge conflicts between staging and staging-next.

I've also noticed that zlib recently added --disable-shared as an alias to --static in madler/zlib@09f8d2b which makes the flag behavior much less confusing.

@doronbehar
Copy link
Copy Markdown
Contributor Author

With the reduced scope we don't need to wait for #490616 and #490615 to merge this.

Right, I agree. I removed the commits of the other PRs (mentioned in the top comment) to reflect that.

Though, it would be nice to wait for #490607 to avoid merge conflicts between staging and staging-next.

Indeed - definitly there will be merge conflicts, so I'm keeping this a draft.

I've also noticed that zlib recently added --disable-shared as an alias to --static in madler/zlib@09f8d2b which makes the flag behavior much less confusing.

Thanks for the link!

Diff looks ok, no relevant changes to the zlib outputs as far as I can tell.

What have you tested?

@doronbehar
Copy link
Copy Markdown
Contributor Author

Last force push refined the main comment added to the expression to include a link to:

@doronbehar doronbehar mentioned this pull request Feb 16, 2026
9 tasks
@marcin-serwin
Copy link
Copy Markdown
Contributor

What have you tested?

Just pngcheck and zlib on aarch64-linux.

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 19, 2026
And use `--replace-fail` for Darwin substitutions.

Make it easier to find wrong substitutions relevant for platforms other
then your own.
@doronbehar doronbehar marked this pull request as ready for review February 19, 2026 11:40
@doronbehar
Copy link
Copy Markdown
Contributor Author

Fixed merge conflicts, but haven't yet tested the cross compilation builds.

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 19, 2026
Copy link
Copy Markdown
Contributor

@marcin-serwin marcin-serwin left a comment

Choose a reason for hiding this comment

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

I've built minizip and pngcheck, and visually inspected zlib output.

Given that the changes mostly amount to inlining the fact that static = true I wouldn't expect this to break anything.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 21, 2026
@doronbehar
Copy link
Copy Markdown
Contributor Author

I've built minizip and pngcheck, and visually inspected zlib output.

Thanks for the approval and for testing.

Given that the changes mostly amount to inlining the fact that static = true I wouldn't expect this to break anything.

I am too optimistic, since this PR has been here for a while, so I'm merging.

@doronbehar doronbehar added this pull request to the merge queue Feb 21, 2026
Merged via the queue into NixOS:staging with commit 03329ae Feb 21, 2026
31 of 33 checks passed
@doronbehar doronbehar deleted the pkg/zlib@simplify branch February 21, 2026 17:29
marcin-serwin added a commit to marcin-serwin/nixpkgs that referenced this pull request Feb 27, 2026
This override breaks eval on staging due to using `static` argument
removed in <NixOS#490608>.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
marcin-serwin added a commit to marcin-serwin/nixpkgs that referenced this pull request Feb 27, 2026
This reverts commit 5bf2c0f.

This override breaks eval on staging due to using `static` argument
removed in <NixOS#490608>.

Signed-off-by: Marcin Serwin <marcin@serwin.dev>
@ghpzin ghpzin mentioned this pull request Mar 1, 2026
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants