Skip to content

cmake: drop outdated flags from setupHook#455592

Merged
K900 merged 2 commits intoNixOS:stagingfrom
Samasaur1:push-zwoptowpwyqv
Oct 25, 2025
Merged

cmake: drop outdated flags from setupHook#455592
K900 merged 2 commits intoNixOS:stagingfrom
Samasaur1:push-zwoptowpwyqv

Conversation

@Samasaur1
Copy link
Member

Drop outdated CMake flags from the setup hook.

The first (CMAKE_FIND_FRAMEWORK=LAST) is actively wrong now that we include the SDK and all its component frameworks in the Darwin stdenv by default (see #455458, which this PR supersedes).

The second (CMAKE_POLICY_DEFAULT_CMP0025=NEW) is just irrelevant with a cmake_minimum_required of 3.0 or higher (the minimum version supported by the version of CMake in nixpkgs is above this), and the policy was entirely dropped in CMake 4.0, so it can no longer even be set to the OLD behavior. We probably wouldn't bother removing this on its own, but since I'm causing a world-rebuild anyway, here we are.

Closes #455059.
Supersedes #455458.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

This was introduced in NixOS#37015,
before the migration of Apple SDK frameworks to be included by default.

More specifically, it breaks anything looking for `Network.framework`
(such as qtbase 6.10) because it will prefer `libnetwork.tbd` over the
framework.

Fixes NixOS#455059.
Supersedes NixOS#455458.
This policy was introduced in CMake 3.0 (June 2014), and removed
entirely in CMake 4.0. As this causes a world-rebuild we'd probably
leave it alone except that I'm already changing the setup hook.
@Samasaur1 Samasaur1 requested a review from K900 October 25, 2025 17:52
@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-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. labels Oct 25, 2025
@nix-owners nix-owners bot requested review from LnL7 and ttuegel October 25, 2025 17:58
@K900 K900 added this pull request to the merge queue Oct 25, 2025
Merged via the queue into NixOS:staging with commit baf4361 Oct 25, 2025
31 of 35 checks passed
@Samasaur1 Samasaur1 deleted the push-zwoptowpwyqv branch October 25, 2025 18:28
@Prince213
Copy link
Member

This would mean that Qt would stay broken until next staging merge right?

@Samasaur1
Copy link
Member Author

This would mean that Qt would stay broken until next staging merge right?

Yeah. If it's critical that Qt be fixed before that we could add -DCMAKE_FIND_FRAMEWORK=FIRST to qtbase's cmakeFlags on Darwin, which works around the issue. That's still a fair amount of rebuilds, though (qt and all dependents), so even a PR of that size might want to go to staging (I am unsure of the exact threshold), and if that's the case then we'd be waiting for staging anyway.

(I'm reading that paragraph and it sounds dismissive, which is not how I meant it! My point is just that I don't have the knowledge or authority to decide whether a PR doing the smaller-scale fix would be accepted, but such a PR is definitely possible).

@Prince213
Copy link
Member

I'd really just consider that as re-enabling builds rather than rebuilds as they did't even eval before #455455.
Personally I'd like #455458 to be merged first, but I'm probably not in a position to decide whether it could target master directly.

Samasaur1 added a commit to Samasaur1/nixpkgs that referenced this pull request Oct 27, 2025
This essentially applies NixOS#455592 to
qtbase (and thus all packages depending on Qt on Darwin) without
rebuilding the world.

We're doing this so that Qt-based applications will be fixed faster than
the time it takes to wait for a staging cycle.
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants