What can theoretically cause different build results?
- current date
- RAM available
- kernel running the builds
- We have the kernelHeaders. Programs should respect kernelHeaders for the kernel API, and not talk to the running kernel.
- is a virtualization system being used ?
- sensors (such as temperature)
- system-probes or benchmarks (some programs to probe the system and build software according to what cpu they find or how efficient the system is)
- timing behaviour of any component in use (fs, ..) (causing timeouts and such)
- parallel building if you enable it. Eg make -jN sometimes fails randomly for some projects
- gconf runs in daemon mode
"Cannot mix incompatible Qt library (version 0x40800) with this library (version 0x40801)"
Cannot mix incompatible Qt library (version 0x40805) with this library (version 0x40806)  14683 abort (core dumped) anki
the problem was:
- /run/current-system/sw/lib/kde4/plugins -> libQtGui.so.4 => /nix/store/k83zcpdm4lfmj3190bwjgff0xi0jgysk-qt-4.8.5/lib/libQtGui.so.4 (0x00007f8360c6f000)
- /nix/store/10rbmywrqqs1migib3jkxrr8207jpylr-kdelibs-4.12.4/lib/kde4/plugins/ -> libQtXml.so.4 => /nix/store/k83zcpdm4lfmj3190bwjgff0xi0jgysk-qt-4.8.5/lib/libQtXml.so.4
- /nix/store/j49b795nhxvc3hyxjkw1q7r6ga0napg5-system-path/lib/kde4/plugins/ -> libkdecore.so.5 => /nix/store/10rbmywrqqs1migib3jkxrr8207jpylr-kdelibs-4.12.4/lib/libkdecore.so.5
the temporary solution
to get anki running, temporarily, remove all the above 3 paths from the QT_PLUGIN_PATH like:
the final solution
TBD but QT_PLUGIN_PATH is a global variable and as such problematic. one solution would be to wrap Qt binaries like done for python. another solution would be to write a patch for each Qt version so that QT_PLUGIN_PATH would be named like:
* QT_PLUGIN_PATH48 * QT_PLUGIN_PATH412
i'd prefer the latter since it is very clean. still i wonder why anki works, maybe it does not use any of the PLUGINS.
Stateful directories in NixOS: /etc, /var, /home can cause packages to do what they usually do. In case of trouble make a backup, delete and recreate those to trouble shoot a problem.