Skip to content

qt6.qtbase: fix build on Darwin by preferring frameworks#455458

Merged
K900 merged 1 commit intoNixOS:masterfrom
Samasaur1:push-kzqmqqyvxlsw
Oct 27, 2025
Merged

qt6.qtbase: fix build on Darwin by preferring frameworks#455458
K900 merged 1 commit intoNixOS:masterfrom
Samasaur1:push-kzqmqqyvxlsw

Conversation

@Samasaur1
Copy link
Member

@Samasaur1 Samasaur1 commented Oct 25, 2025

qtbase was unable to find Network.framework (instead finding libnetwork.tbd), which meant it failed to build on Darwin.

Looks like the upgrade to qt 6.10 was the first time that Network.framework was used, in commit qt/qtbase@1299aaa.

This is a problem that we only encounter because our CMake setup hook sets CMAKE_FIND_FRAMEWORK=LAST. This appears to be a holdover from before our Darwin SDK packaging was updated. It's been removed on staging (#455592), but that will take a while to percolate, so this PR fixes it for qtbase specifically (while avoiding a world-rebuild).

Fixes #455059 (when combined with #455455).

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.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 25, 2025
@Samasaur1
Copy link
Member Author

I suspect this may need to go to staging since it rebuilds qt. Alternatively, I could make this patch conditional to Darwin (since it only matters there anyway), which would "only" entail rebuilding all Darwin qt dependents instead of all qt dependents.

@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: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Oct 25, 2025
@nixpkgs-ci nixpkgs-ci bot added 9.needs: reviewer This PR currently has no reviewers requested and needs attention. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Oct 25, 2025
@K900
Copy link
Contributor

K900 commented Oct 25, 2025

Can we not just put this in cmakeFlags?

@Samasaur1
Copy link
Member Author

Can we not just put this in cmakeFlags?

If I understand correctly (not a guarantee when it comes to CMake), that's slightly different behavior because in this patch (and the upstream patch) setting CMAKE_FIND_FRAMEWORK to FIRST is scoped to the qt_internal_find_apple_system_framework function, and we deliberately set CMAKE_FIND_FRAMEWORK to LAST in general.

That's not a no, and I'm running a build right now to check whether qtbase builds with the additional cmakeFlag, but there may be a reason to prefer the patch even if that is the case.

@Samasaur1
Copy link
Member Author

Yep, adding "-DCMAKE_FIND_FRAMEWORK=FIRST" to cmakeFlags in place of this patch also works (at least, building prismlauncher works). I have no real preference on which to use, so just let me know one way or another.

Samasaur1 added a commit to Samasaur1/nixpkgs that referenced this pull request Oct 25, 2025
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.
@Samasaur1 Samasaur1 closed this Oct 25, 2025
@Samasaur1 Samasaur1 reopened this Oct 26, 2025
Copy link
Member

@Prince213 Prince213 left a comment

Choose a reason for hiding this comment

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

Let's merge this to re-enable builds. Not sure about if master is good though, maybe staging-next?

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. and removed 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. labels Oct 26, 2025
@Samasaur1 Samasaur1 changed the base branch from master to staging-next October 26, 2025 07:17
github-actions[bot]

This comment was marked as resolved.

@nixpkgs-ci nixpkgs-ci bot closed this Oct 26, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Oct 26, 2025
@github-actions github-actions bot dismissed their stale review October 26, 2025 07:18

All good now, thank you!

@bryango
Copy link
Member

bryango commented Oct 27, 2025

Tested on aarch64-darwin which fixes all qt GUI packages on my darwin profile. Please consider fast-tracking this as it may fix up to 371 darwin packages according to CI results (and it is now conditioned such that it will not introduce any linux rebuilds).

Also since the number of rebuilds appears to be moderate(?) would it be possible to target master instead? Friendly ping @K900 and @NickCao for comments and review!

@eclairevoyant eclairevoyant mentioned this pull request Oct 27, 2025
3 tasks
@Prince213
Copy link
Member

Just a precaution to target staging-next. If you consider the rebuilds to be what should have been parts of #449572, then it's actually 0 rebuilds.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Oct 27, 2025
@Samasaur1 Samasaur1 changed the title qt6.qtbase: fix build on Darwin by preferring frameworks when desired qt6.qtbase: fix build on Darwin by preferring frameworks Oct 27, 2025
@Samasaur1
Copy link
Member Author

Samasaur1 commented Oct 27, 2025

Happy to retarget this to master if desired :)

@K900
Copy link
Contributor

K900 commented Oct 27, 2025

The way we should do this is: merge this to master, then immediately revert on staging.

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.
@Samasaur1 Samasaur1 changed the base branch from staging-next to master October 27, 2025 07:25
github-actions[bot]

This comment was marked as resolved.

@nixpkgs-ci nixpkgs-ci bot closed this Oct 27, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Oct 27, 2025
@github-actions github-actions bot dismissed their stale review October 27, 2025 07:26

All good now, thank you!

@K900 K900 added this pull request to the merge queue Oct 27, 2025
Merged via the queue into NixOS:master with commit 6ee182f Oct 27, 2025
39 of 43 checks passed
@Samasaur1 Samasaur1 deleted the push-kzqmqqyvxlsw branch November 23, 2025 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 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: qtbase - materialgram & telegram-desktop & more packages on darwin

4 participants