I want to run version 4.8 of gnu cash. I found the corresponding nixpkgs commit by searching on nixhub.io . I created the following devshell to add it to my environment temporarly
{
description = "A very basic flake";
inputs.nixpkgs = {
url = "github:NixOS/nixpkgs?rev=c38ca58c0b4b5d9423609c58636988a9f81325d6";
};
outputs = { self, nixpkgs }:
let
x86_pkgs = nixpkgs.legacyPackages."x86_64-linux";
in
{
devShells."x86_64-linux" = {
# devshell with the correct version of gnucash
default = x86_pkgs.mkShell {
packages = with x86_pkgs; [
gnucash
];
};
};
};
}
The correction version of gnu cash seems to be installed when I run gnucash --version. However, when I try and lauch the program, I get the following error.
[19:10:23] ❯ gnucash --debug
/nix/store/8qjfr5dymivmzw0pf38bn4yx509bkwh0-gvfs-1.50.4/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /nix/store/8qjfr5dymivmzw0pf38bn4yx509bkwh0-gvfs-1.50.4/lib/gio/modules/libgvfsdbus.so
(gnucash:63986): Gtk-WARNING **: 19:12:14.814: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /etc/profiles/per-user/oskar/share/icons/Papirus-Dark/16x16/actions/image-missing.svg: Unable to load image-loading module: /nix/store/lv65dravh1g0mhq2v5b72fhsmw2g4bx4-librsvg-2.55.3/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /nix/store/wl60dr9p15rwf53gxz61ijgisc1zdjc7-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/lv65dravh1g0mhq2v5b72fhsmw2g4bx4-librsvg-2.55.3/lib/librsvg-2.so.2) (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /etc/profiles/per-user/oskar/share/icons/Papirus-Dark/16x16/actions/image-missing.svg: Unable to load image-loading module: /nix/store/lv65dravh1g0mhq2v5b72fhsmw2g4bx4-librsvg-2.55.3/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /nix/store/wl60dr9p15rwf53gxz61ijgisc1zdjc7-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/lv65dravh1g0mhq2v5b72fhsmw2g4bx4-librsvg-2.55.3/lib/librsvg-2.so.2) (gdk-pixbuf-error-quark, 5)
stderr: Aborted (core dumped)stderr:
I thought nix should be able to perfectly run old applications?
This is smuggling in the assumption that what you’re doing now would actually have perfectly run at the time. (It might have, but it’s something we have to interrogate…)
Some of the more common cases where the assumption may not hold:
The program was compiling fine, but had runtime errors that all users would’ve seen at the time. (These could be transient issues both caused and fixed by updates to other packages…)
The package/software had (and may still have) encapsulation issues that cause it (or specific features) to fail unless you have some other package or module installed/configured.
I’m not familiar with gnucash, but searching for issues, threads, and looking through user configs that use it all suggest there have at least historically been some encapsulation issues here:
Your specific errors don’t sound like those exact issues, but I do take them collectively as a smell that gnucash has some under-specified dependencies on the system.
I’d try swapping in revisions for newer gnucash versions into your expression to see if this started working at some point.
If later versions work, it’s possible something was fixed in the expression between those two points, or that an update/fix to some other dependency fixes the problem. You may just be able to add an override/overlay to apply that fix here.
If it doesn’t start working, there’s probably an encapsulation problem.
/nix/store/8qjfr5dymivmzw0pf38bn4yx509bkwh0-gvfs-1.50.4/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /nix/store/8qjfr5dymivmzw0pf38bn4yx509bkwh0-gvfs-1.50.4/lib/gio/modules/libgvfsdbus.so
I do not know if this is important, though, or if everything will just work fine.
So the gvfs module is leaking through from the system in this case and that is causing the error? So the package should specify the gvfs version at build time somehow to properly solve the problem? But that cannot be done for old versions of the program in nixpkgs? Would overriding the package source be a better solution in this case, since the latest nixpkgs might have encapsulated gvfs properly?
I don’t know much about gnome, but I do see that gvfs is a gnome library. Since the bump to gvfs 1.50.4 was made in March and would’ve been the last bump to make the boat for 23.05, I agree that it’s trying to pick up gvfs (and maybe more of gnome) from the environment or system.
Hopefully someone who knows more about gnome will weigh in. but I’ll spitball in case it helps.
I’m not sure. I hesitate to send you on a goose chase. That’s certainly a ~normal fix, but the Packaging GNOME Applications section of the manual makes me think that the problem is more about clean run-time encapsulation:
Wrapping the executables to ensure correct paths are available to the application constitutes a significant part of packaging a modern desktop application.
One of the PRs I linked, https://github.com/NixOS/nixpkgs/pull/152518, updated how gnucash was wrapped at some point after the update to 4.9, so you might want to double-check whether rev you used for 4.9 contained changes from that PR or not (and try a rev including that change if you haven’t yet).
If that works, you might be able to override the source back down to 4.8 from there. Or use the 4.8 rev, but override to apply the same wrapping fixes from the PR.