Skip to content

zlib: use default configure script on windows - #366922

Open
getchoo wants to merge 1 commit into
NixOS:stagingfrom
getchoo-contrib:pkgs/zlib/ucrtAarch64
Open

zlib: use default configure script on windows#366922
getchoo wants to merge 1 commit into
NixOS:stagingfrom
getchoo-contrib:pkgs/zlib/ucrtAarch64

Conversation

@getchoo

@getchoo getchoo commented Dec 20, 2024

Copy link
Copy Markdown
Member

Closes #366427

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@getchoo getchoo added backport release-24.11 6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: windows Running, or buiding, packages on Windows 0.kind: build failure A package fails to build labels Dec 20, 2024
@github-actions github-actions Bot added 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. labels Dec 20, 2024
@ofborg ofborg Bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Dec 21, 2024
Comment thread pkgs/development/libraries/zlib/default.nix Outdated
@getchoo
getchoo force-pushed the pkgs/zlib/ucrtAarch64 branch from 1b211bd to 5edefc4 Compare January 3, 2025 07:05
@getchoo
getchoo requested a review from greg-hellings January 3, 2025 07:05
@github-actions github-actions Bot removed 6.topic: windows Running, or buiding, packages on Windows 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 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-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Jan 3, 2025
@getchoo
getchoo force-pushed the pkgs/zlib/ucrtAarch64 branch from 5edefc4 to c227db8 Compare January 3, 2025 20:50
@greg-hellings

Copy link
Copy Markdown
Contributor

It now builds for me. Does the pkg-config file belong under bin?

greg@jude ~ @ ll result/bin/pkgconfig/
total 4
-r--r--r-- 2 root root 322 Dec 31  1969 zlib.pc

I believe that those still belong under lib/

@ find /nix/store -type d -name pkgconfig | grep mingw
/nix/store/0iyhgjknxxwr6nqw7xwqlzi79gngp2ic-zlib-x86_64-w64-mingw32-1.3.1-dev/lib/pkgconfig
/nix/store/5gc8pw7w7mkq5lqlfac0rqx6dymbvwm2-brotli-x86_64-w64-mingw32-1.1.0-dev/lib/pkgconfig
/nix/store/vnjkhgadl688a9liz286qs7z1rzyb68i-bzip2-x86_64-w64-mingw32-1.0.8-dev/lib/pkgconfig
/nix/store/xfygbm4qjc88dpx298c0ckxggzq1s04g-xz-x86_64-w64-mingw32-5.6.3-dev/lib/pkgconfig
/nix/store/gahg8vdv0m8kb7xqpiy3afwzrikwidfz-nghttp2-x86_64-w64-mingw32-1.64.0-dev/lib/pkgconfig
/nix/store/q88z2fqdryqpgcqyjj1damx26bqqi62s-pcre2-x86_64-w64-mingw32-10.44-dev/lib/pkgconfig
/nix/store/2f5s4pih0s0915cm5sv5ns4jmdvvqmzd-icu4c-x86_64-w64-mingw32-74.2-dev/lib/pkgconfig
/nix/store/qfnzx696najyi518119wxkgriv81qpfs-zstd-x86_64-w64-mingw32-1.5.6-dev/lib/pkgconfig
/nix/store/c94fja7dmkbvl1wisf8v08mfgjc4vmxl-libidn2-x86_64-w64-mingw32-2.3.7-dev/lib/pkgconfig
/nix/store/yc8mfw8kmqisclb5almdyg6ayh7dg15w-openssl-x86_64-w64-mingw32-3.3.2-dev/lib/pkgconfig
/nix/store/qds49amz4x9h92zcqgp68xnsiy8gzfiv-libssh2-x86_64-w64-mingw32-1.11.1-dev/lib/pkgconfig
/nix/store/lbljf9jbfbzdhmah067va6lk3a8ag0ma-curl-x86_64-w64-mingw32-8.11.0-dev/lib/pkgconfig
/nix/store/cmgc9kwhfdwbxbx97r5cggqnwdzn0vyn-sword-x86_64-w64-mingw32-1.9.0-dev/lib/pkgconfig
/nix/store/i08cmbkxf7z5zckyd9zzszfp77ycvndx-zlib-x86_64-w64-mingw32-1.3.1-dev/lib/pkgconfig
/nix/store/3p0l8cg0b749yjwwzrhg1wf1kv9l25pw-zlib-aarch64-w64-mingw32-1.3.1/bin/pkgconfig

Comment thread pkgs/development/libraries/zlib/default.nix Outdated
@getchoo
getchoo marked this pull request as draft January 3, 2025 23:14
@getchoo
getchoo changed the base branch from master to staging January 3, 2025 23:14
@getchoo
getchoo force-pushed the pkgs/zlib/ucrtAarch64 branch from c227db8 to 9cdecc1 Compare January 3, 2025 23:14
@getchoo
getchoo marked this pull request as ready for review January 3, 2025 23:14
@getchoo
getchoo requested a review from greg-hellings January 3, 2025 23:14
@getchoo

getchoo commented Jan 3, 2025

Copy link
Copy Markdown
Member Author

Doesn't seem like I can avoid a rebuild on other platforms, as patches will now be an empty list, dontConfigure is unset, etc.

@greg-hellings

Copy link
Copy Markdown
Contributor

Doesn't seem like I can avoid a rebuild on other platforms, as patches will now be an empty list, dontConfigure is unset, etc.

Your changes only affect mingw targets, and the pkgsCross are not build as part of the testing. That means changes like this kinda rely on code reviewers instead of hydra to test the changes on the target environment. (This means that they don't block merges, but also that they are brittle and easily broken). I'm running a build locally of the cross target package. I'll update in a bit when that's done.

@greg-hellings

Copy link
Copy Markdown
Contributor

FWIW, MSYS2 apply this rather large patch (among others): msys2/MINGW-packages@28541f5/mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch.

That does seem a more robust way of handling it. Any reason to not try that one out, @getchoo ?

@greg-hellings

Copy link
Copy Markdown
Contributor

Can we please get this merged?

@greg-hellings

Copy link
Copy Markdown
Contributor

FWIW, MSYS2 apply this rather large patch (among others): msys2/MINGW-packages@28541f5/mingw-w64-zlib/01-zlib-1.2.11-1-buildsys.mingw.patch.

Looking further into this, I don't think their patch is applicable directly to our usage here. In their patch they force all MinGW targets to build both shared and static libraries every time. That's pretty common in MinGW distributions I've used, but it's not how nixpkgs is setup to roll. So I don't think that we should go with their patch set. The one in this PR already works great.

Comment thread pkgs/development/libraries/zlib/default.nix Outdated
@getchoo

getchoo commented Feb 11, 2025

Copy link
Copy Markdown
Member Author

That does seem a more robust way of handling it. Any reason to not try that one out, @getchoo ?

Nope, this just slipped my inbox!

I am a little hesitant to add this though, as I'm not completely sure why they're making some of these changes (as I'd hope upstream would do most of the heavy lifting here) and like you said, I'm not sure they're super applicable here

If any issues come up from the one I have, I will gladly move to this instead

@getchoo
getchoo force-pushed the pkgs/zlib/ucrtAarch64 branch 2 times, most recently from f256c20 to 2c4d941 Compare February 11, 2025 06:36
@getchoo
getchoo requested a review from GaetanLepage February 11, 2025 06:37
@github-actions github-actions Bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Feb 11, 2025
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 11, 2025
Comment thread pkgs/development/libraries/zlib/default.nix Outdated
This avoids the pitfalls of win32/Makefile.gcc (which prevents building
on compilers other than gcc without patching and has non-standard
installation behavior) and fixes cross compilation for ucrtAarch64
@getchoo
getchoo force-pushed the pkgs/zlib/ucrtAarch64 branch from 2c4d941 to f3d9b73 Compare March 6, 2025 14:47
@getchoo
getchoo requested a review from SuperSandro2000 March 6, 2025 14:48

@SuperSandro2000 SuperSandro2000 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM but I am a Windows cross noob

@wegank wegank added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Mar 8, 2025
@greg-hellings

Copy link
Copy Markdown
Contributor

Now that the issue with the aarch64 cross compiler is addressed, this build failure is now directly halting other progress on ucrtAarch64 cross package builds. Any chance we can get it merged?

Comment on lines +46 to +48
patches = [
./mingw-shared.patch
];

This comment was marked as duplicate.

@greg-hellings

Copy link
Copy Markdown
Contributor

It's been 5 more weeks. Please merge this? It's completely rendering the whole Windows on Arm cross compile target useless.

@RossSmyth RossSmyth left a comment

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.

Builds for me, looks good.

@nixpkgs-ci nixpkgs-ci Bot added 2.status: merge conflict This PR has merge conflicts with the target branch 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jul 26, 2025
@greg-hellings

Copy link
Copy Markdown
Contributor

Merge conflict resolution in #428871. @getchoo If you want to grab that version and push over top of this, you're welcome to do so. It's just a formatting change in the resolution.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 24, 2026
@doronbehar doronbehar mentioned this pull request Feb 16, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: build failure A package fails to build 2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: cross-compilation Building packages on a different platform than they will be used on 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-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. 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: pkgsCross.ucrtAarch64.zlib

9 participants