Describe the bug
Atom (the text editor by github) crashes when attempting to open a file with the open-file dialogue. When opening a file with atom from the terminal, atom functions as expected.
To Reproduce
Expected behavior
Opening a file in atom with the open-file dialogue should bring up the open-file dialogue and allow the creation of or opening of a file.
Additional context
[self]$ atom test.txt
[self]$ /nix/store/06v3mmk4c0w5knl1p3mxlywdmb0ry7xb-atom-1.42.0/bin/.atom-wrapped: line 192: 9807 Trace/breakpoint trap (core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
Fontconfig warning: "/etc/fonts/fonts.conf", line 86: unknown element "blank"
(atom:9807): GLib-GIO-ERROR **: 16:54:31.619: No GSettings schemas are installed on the system
Notify maintainers
@chkno @offlinehacker @NeQuissimus @ysndr
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
- system: `"x86_64-linux"`
- host os: `Linux 5.4.48, NixOS, 20.03.2349.6460602eec5 (Markhor)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.6`
- channels(bootstrap): `"home-manager"`
- channels(root): `"nixos-20.03.2349.6460602eec5"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: nixpkgs.atom, nixpkgs.atom-beta
# a list of nixos modules affected by the problem
module: N/A
It looks like a crash with the same error message was fixed in 57d5e2b20d97775be5c3853b0a04096a36ac224c, but I can still reproduce this. I originally thought it could be related to #90645, but strictDeps isn't enabled by default in stdenv.
I grepped all the binaries for org.gnome and found:
share/atom/atom:
but adding gsettings-desktop-schemas to buildInputs doesn't fix the crash. I'm not too familiar with packaging GNOME applications, so I don't know how these schemas can be provided through Nix.
@worldofpeace When checking out an older commit of atom I noticed that this crash didn't occur, so I bisected until I found the bad commit: 29fc27b4ac358b5325ad356f90da54adf941e663.
The problem seems to be that GDK_PIXBUF_MODULE_FILE and XDG_DATA_DIRS is no longer added to the wrapper:
4,8c4,5
< export PATH='/nix/store/ps7l3f8jhckkn4kir7g6ripbzgfxpvln-gvfs-1.42.2/bin'${PATH:+':'}$PATH
< export GDK_PIXBUF_MODULE_FILE='/nix/store/sz8bysbas5h2j935z9hrgc9v34ng7gic-librsvg-2.46.4/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache'
< export XDG_DATA_DIRS='/nix/store/ld8dh469ggjahvrjd3kx3s80l50wcksq-gtk+3-3.24.14/share/gsettings-schemas/gtk+3-3.24.14:/nix/store/yk6s86iikfm8rbr0448s3ff54f8rmwzc-gsettings-desktop-schemas-3.34.0/share/gsettings-schemas/gsettings-desktop-schemas-3.34.0:/nix/store/ld8dh469ggjahvrjd3kx3s80l50wcksq-gtk+3-3.24.14/share/gsettings-schemas/gtk+3-3.24.14:/nix/store/yk6s86iikfm8rbr0448s3ff54f8rmwzc-gsettings-desktop-schemas-3.34.0/share/gsettings-schemas/gsettings-desktop-schemas-3.34.0'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS
< export XDG_DATA_DIRS='/nix/store/0lyvfyh69impi9fzkv8wbxw9kgnks64l-atom-1.42.0/share'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS
< exec -a "$0" "/nix/store/0lyvfyh69impi9fzkv8wbxw9kgnks64l-atom-1.42.0/bin/.apm-wrapped" "$@"
---
> export PATH='/nix/store/yflcywgcnnkzji221d41f4hm06xd72kn-gvfs-1.42.2/bin'${PATH:+':'}$PATH
> exec -a "$0" "/nix/store/7l81la6j259qa60ijavy8gi2m14l4d9f-atom-1.42.0/bin/.atom-wrapped" "$@"
For some reason it looks like gappsWrapperArgs is reset when appended to in the custom preFixup phase.
@MetaDark Hmm, my first guess would have been because it doesn't follow the proper stdenv phases https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/atom/default.nix#L44
This is a duplicate of https://github.com/NixOS/nixpkgs/issues/92487
See https://github.com/NixOS/nixpkgs/issues/92487#issuecomment-654552010, this can be fixed by the expression being rewritten in that fashion
Most helpful comment
See https://github.com/NixOS/nixpkgs/issues/92487#issuecomment-654552010, this can be fixed by the expression being rewritten in that fashion