Skip to content

freecad: fix filebrowser crash on Gnome 49#470594

Open
srounce wants to merge 1 commit intoNixOS:masterfrom
srounce:fix-freecad-gnome-filebrowser-crash
Open

freecad: fix filebrowser crash on Gnome 49#470594
srounce wants to merge 1 commit intoNixOS:masterfrom
srounce:fix-freecad-gnome-filebrowser-crash

Conversation

@srounce
Copy link
Contributor

@srounce srounce commented Dec 14, 2025

It seems the gtk3 schema paths aren't present in XDG_DATA_DIRS on Gnome 49 and thus attempts to open a gtk3 filebrowser will fail, causing the application to crash. This commit adds the gtk3 gsettings schemas to the XDG_DATA_DIRS env var for the app via the wrapper script.

Fixes #467783

Not sure if this would be better placed being added to wrapQtAppsHook as this issue seems to affect all Qt applications.

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.

It seems the gtk3 schema paths aren't present in XDG_DATA_DIRS on
Gnome 49 and thus attempts to open a gtk3 filebrowser will fail,
causing the application to crash. This commit adds the gtk3
gsettings schemas to the XDG_DATA_DIRS env var for the app via the
wrapper script.

Fixes NixOS#467783
@nixpkgs-ci nixpkgs-ci bot requested a review from LordGrimmauld December 14, 2025 03:01
@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. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Dec 14, 2025
@qbisi
Copy link
Contributor

qbisi commented Dec 19, 2025

Sorry, by bad, just add back wrapGAppsHook3 to nativeBuildInputs , add "\${gappsWrapperArgs[@]}" to qtWrapperArgs and set dontWrapGApps=true .

I faultly deleted wrapGAppsHook3 cause i think gappsWrapperArgs was an empty string after running wrapGAppsHook.
This is wrong because wrapGAppsHook3 propagate hooks from gtk3 which set GSETTINGS_SCHEMAS_PATH and then XDG_DATA_DIRS in gappsWrapperArgs.

@qbisi qbisi mentioned this pull request Dec 19, 2025
13 tasks
@symphorien
Copy link
Member

I compiled this with nixpkgs-review but the wrapper does not mention GSETTINGS_SCHEMA_PATH:

strings results/freecad-x86_64-linux/bin/freecad
[...]
/nix/store/7jb8d74ldbk5q5p97wsa1l1wj91sj7mq-freecad-1.0.2/bin/.FreeCAD-wrapped
# ------------------------------------------------------------------------------------
# The C-code for this binary wrapper has been generated using the following command:
makeCWrapper '/nix/store/7jb8d74ldbk5q5p97wsa1l1wj91sj7mq-freecad-1.0.2/bin/.FreeCAD-wrapped' \
    --inherit-argv0 \
    --set 'COIN_GL_NO_CURRENT_CONTEXT_CHECK' '1' \
    --prefix 'PATH' ':' '/nix/store/m6mh0rs95jxm1ym2161r3f4m3x7rhmxf-libredwg-0.13.3/bin:/nix/store/qx57h2zca1vilqmacx6a7gj7iwbxwpa3-which-2.23/bin' \
    --prefix 'PYTHONPATH' ':' '/nix/store/qzc04a3npl70cyyy6flnnrb2ig3kayxm-python3-3.13.11/lib/python3.13/site-packages:/nix/store/zkd5fmq52j0aiqwg3sj8aiqbg0ks8l0r-boost-1.87.0/lib/python3.13/site-packages:/nix/store/8qz5vyqm69h2qp7rzn6rfn7zx7jv8fkn-python3.13-gitpython-3.1.45/lib/python3.13/site-packages:/nix/store/y44a37qb91ci43pfz4zkx316sb83z4gj-python3.13-ifcopenshell-0.8.0\
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/ird0gml23rkk7wybqyh4xdi3b8clwv28-qtbase-6.10.1-only-plugins-qml/lib/qt-6/plugins' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/jq8mka96cq81mfzm4svzmbalna8asqfn-qtbase-6.10.1/lib/qt-6/plugins' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/qw81vyvzl61il9y6p57sdw9q60s2ixzh-qtsvg-6.10.1/lib/qt-6/plugins' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/9qpnp7q1jjwmxdj9ncb4kshpcbsi3j54-qtdeclarative-6.10.1/lib/qt-6/plugins' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/9qpnp7q1jjwmxdj9ncb4kshpcbsi3j54-qtdeclarative-6.10.1/lib/qt-6/qml' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/1hfck28lfq5whh918smx90ma6sinl7hn-qttools-6.10.1/lib/qt-6/plugins' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/bpfyz8k1q5kla3vfqzcn7bbrsbn43wxi-qtwayland-6.10.1/lib/qt-6/plugins' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/bpfyz8k1q5kla3vfqzcn7bbrsbn43wxi-qtwayland-6.10.1/lib/qt-6/qml' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/lw6dpb0jxrycsc9lzl1c9spmd7ikw9r7-qtwebsockets-6.10.1/lib/qt-6/qml' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/mlvpa7zwbp0rkkmaax1k67cfyxr1a9a7-qtwebchannel-6.10.1/lib/qt-6/qml' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/g5ki993dx9jrkax2h0mgna8kyj9jjcmf-qtpositioning-6.10.1/lib/qt-6/plugins' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/g5ki993dx9jrkax2h0mgna8kyj9jjcmf-qtpositioning-6.10.1/lib/qt-6/qml' \
    --prefix 'QT_PLUGIN_PATH' ':' '/nix/store/nvax3jdqhgw2isl2h8xldiv9f2l20ynl-qtwebengine-6.10.1/lib/qt-6/plugins' \
    --prefix 'NIXPKGS_QT6_QML_IMPORT_PATH' ':' '/nix/store/nvax3jdqhgw2isl2h8xldiv9f2l20ynl-qtwebengine-6.10.1/lib/qt-6/qml' \
    --prefix 'XDG_DATA_DIRS' ':' '/nix/store/7jb8d74ldbk5q5p97wsa1l1wj91sj7mq-freecad-1.0.2/share'
# (Use `nix-shell -p makeBinaryWrapper` to get access to makeCWrapper in your shell)
# ------------------------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FreeCAD: FreeCAD 1.0.2 crashes when opening any file dialog

3 participants