I am trying to run an example of the Dixous crate, but get runtime errors.
I use a shell.nix
to create a devshell, and upon adding some buildinputs the building finally works out.
nix-shell --command 'cargo build'
But when I want to run an example
nix-shell --command 'cargo run --example calculator'
I get the error
Finished dev [unoptimized + debuginfo] target(s) in 0.35s
Running `target/debug/examples/calculator`
/nix/store/mvn4dn334081g7vqx7514k86p2ppdb2w-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_assertion_message_cmpint
Failed to load module: /nix/store/mvn4dn334081g7vqx7514k86p2ppdb2w-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so
/nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/cmf7hyf5qbd1rm89c4dwa2z0pvql8j6l-gvfs-1.52.2/lib/gio/modules/libgvfsdbus.so)
Failed to load module: /nix/store/cmf7hyf5qbd1rm89c4dwa2z0pvql8j6l-gvfs-1.52.2/lib/gio/modules/libgvfsdbus.so
(calculator:908057): Gtk-WARNING **: 18:46:37.845: 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:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /run/current-system/sw/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /nix/store/y2cy098f84s4h6xiqclvf2ikqafg247p-librsvg-2.57.1/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libm.so.6: version `GLIBC_2.38' not found (required by /nix/store/y2cy098f84s4h6xiqclvf2ikqafg247p-librsvg-2.57.1/lib/librsvg-2.so.2) (gdk-pixbuf-error-quark, 5)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:495:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /run/current-system/sw/share/icons/Adwaita/scalable/status/image-missing.svg: Unable to load image-loading module: /nix/store/y2cy098f84s4h6xiqclvf2ikqafg247p-librsvg-2.57.1/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so: /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libm.so.6: version `GLIBC_2.38' not found (required by /nix/store/y2cy098f84s4h6xiqclvf2ikqafg247p-librsvg-2.57.1/lib/librsvg-2.so.2) (gdk-pixbuf-error-quark, 5)
shell.nix
let
rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
pkgs = import <nixpkgs> { overlays = [ rust_overlay ]; };
rustVersion = "latest";
rust = pkgs.rust-bin.stable.${rustVersion}.default.override {
extensions = [
"rust-src" # for rust-analyzer
"rust-analyzer"
];
};
libs = with pkgs; [
webkitgtk
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
];
buildInputs = [ rust ] ++ (with pkgs; [
gcc
glibc
gtk3
libsoup_3
openssl
pkg-config
sqlite
webkitgtk_4_1
xdotool
]);
in
pkgs.mkShell {
inherit buildInputs;
nativeBuildInputs = buildInputs;
RUST_BACKTRACE = 1;
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
}