Skip to content

windows.mingw_w64_headers: fix building against msvcrt#365060

Merged
misuzu merged 1 commit intoNixOS:masterfrom
getchoo-contrib:pkgs/mingw_w64_headers/fix-msvcrt
Dec 14, 2024
Merged

windows.mingw_w64_headers: fix building against msvcrt#365060
misuzu merged 1 commit intoNixOS:masterfrom
getchoo-contrib:pkgs/mingw_w64_headers/fix-msvcrt

Conversation

@getchoo
Copy link
Member

@getchoo getchoo commented Dec 14, 2024

Fixes #362550

Looks like I missed this in #335067, as I only tested the update on the UCRT-based aarch64-windows target. Oops!

See commit message for more context

$ nix-build -A pkgsCross.mingwW64.windows.mingw_w64_pthreads
/nix/store/m1543p5wrfwbrkgbm3cpvjssv5w9w7fr-mingw_w64-pthreads-x86_64-w64-mingw32-12.0.0

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.

Previously we relied on the default CRT selected by upstream. This
broke builds against MSVCRT starting with 12.0, as the default was
changed to UCRT

We can instead manually configure the CRT based on our `stdenv` to
ensure there is no discrepancy between the CRT we want to use and that
being targeted by the build
@getchoo getchoo added 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 backport release-24.11 labels Dec 14, 2024
@getchoo getchoo requested a review from Ericson2314 December 14, 2024 00:05
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Dec 14, 2024
@getchoo getchoo added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 14, 2024
Copy link
Contributor

@greg-hellings greg-hellings left a comment

Choose a reason for hiding this comment

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

I can confirm that this solves the problem in #362550

@greg-hellings greg-hellings added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Dec 14, 2024
@misuzu misuzu merged commit 15247f2 into NixOS:master Dec 14, 2024
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Dec 14, 2024

Successfully created backport PR for release-24.11:

@getchoo getchoo deleted the pkgs/mingw_w64_headers/fix-msvcrt branch December 14, 2024 20:56
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 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 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: pkgsCross.mingwW64.windows.mingw_w64_pthreads

4 participants