Skip to content

freecad: fix crash on GNOME/Wayland when opening/saving files by addi… - #520037

Merged
bjornfor merged 1 commit into
NixOS:masterfrom
TorosFanny:master
Jul 20, 2026
Merged

bjornfor merged 1 commit into
NixOS:masterfrom
TorosFanny:master

Conversation

@TorosFanny

Copy link
Copy Markdown

Summary

This PR fixes a critical issue where FreeCAD crashes or hangs on GNOME (specifically in Wayland sessions) whenever a file dialog is triggered (e.g., "Open", "Save", or "Save As").

Root Cause

The crash is caused by the absence of GSettings schemas in the application's environment. When FreeCAD (a Qt application) attempts to invoke the system's file portal or GTK-based dialogs, the underlying GLib/GTK libraries fail to find necessary configuration metadata (schemas), leading to a deadlock or segmentation fault.

Changes

  • Modified qtWrapperArgs in pkgs/applications/science/geometry/freecad/package.nix.

  • Prefixed XDG_DATA_DIRS with the paths to gsettings-desktop-schemas and gtk3.

  • Added gsettings-desktop-schemas and gtk3 to the package dependencies to ensure schema availability.

Technical Details

The following environment variable is now injected into the FreeCAD wrapper:

--prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}"

Verification

  • Environment: NixOS 26.05/Unstable, GNOME 49.4 (Wayland).
  • Result: Successfully opened and saved files without any UI hangs or terminal errors. Font sizes and icon scales remain consistent with the default Qt behavior.

@nixpkgs-ci
nixpkgs-ci Bot requested a review from GrimmTheShrimp May 14, 2026 07:55
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! labels May 14, 2026
@bjornfor
bjornfor added this pull request to the merge queue Jul 20, 2026
@bjornfor

Copy link
Copy Markdown
Contributor

Thanks, and sorry it took so long to get it merged!

@bjornfor bjornfor added the backport release-26.05 Backport PR automatically label Jul 20, 2026
Merged via the queue into NixOS:master with commit 0029782 Jul 20, 2026
28 of 30 checks passed
@nixpkgs-ci

nixpkgs-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@GrimmTheShrimp

Copy link
Copy Markdown
Contributor

Can we maybe not merge PRs that make a conscious decision to entirely remove our template? The checkboxes for automation policy are non-optional (and neither are the others, but the AI one is the one i care about to not waste my time).

@bjornfor

Copy link
Copy Markdown
Contributor

@LordGrimmauld: I see that point. Looking back, yes the PR text smells like AI usage, but the git commit looked fine to me and is what I personally add most weight to. And the change is trivial. So I chose to merge, because I hate having broken software on my system. FreeCAD has apparently been broken since May, which is quite a long time.

What should I have done instead? Closed the PR and said sorry, you don't follow the PR policy? And then make the same PR myself? (This is an honest question; I want to have a working FreeCAD, and once I've come across a PR like this, what should I do if not merge it?)

The PR has been open since May, so there should have been plenty of time for other interested parties to review it.

@GrimmTheShrimp

Copy link
Copy Markdown
Contributor

This seems to have only been an issue on gnome (i have been using freecad just fine until it broke to unrelated things more recently which are now fixed). Frankly, after the disaster that was the vibecoded gnome 50 PR, i mostly stopped caring about gnome in nixpkgs. Nothing of value is lost to me when ignoring LLM generated PRs. Maybe i should have put a "request changes" about adhering to our automation policy (at least putting our PR template back) and blocking on that. Opening your own PR would be fair, I'd be happy to credit a human independently arriving at the same result. Honestly, i am not entirely sure how to best respond to PRs like this while maintaining my sanity.

If there is no interested parties, that is more an argument to not merge than to merge i think?

@bjornfor

bjornfor commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Opening your own PR would be fair, I'd be happy to credit a human independently arriving at the same result.

To be honest, after having seen this PR, I would most likely make copy pasta instead of writing the patch from scratch.

If there is no interested parties, that is more an argument to not merge than to merge i think?

But I'm an interested party, and I felt it was fine to merge :-) But I do agree use of AI should be disclosed.

jyap808 added a commit to jyap808/nix-custom-pkgs that referenced this pull request Oct 19, 2026
Both fixes are now upstream:
- vcv-rack patch vendored in NixOS/nixpkgs#536656
- FreeCAD gsettings schema wrapper in NixOS/nixpkgs#520037

Also refresh flake.lock and drop the unused unstable-modifications overlay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.first-time contribution This PR is the author's first one; please be gentle! backport release-26.05 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants