GNOME Bugzilla – Bug 741810
Compilation fails because of creating .gnucash
Last modified: 2018-06-29 23:36:52 UTC
Hello, compiling GC 2.6.5 for Ubuntu 14.04 fails on my build system because it tries to create a .gnucash directory but the build system does not have a $HOME directory. This is the error: /usr/bin/guild compile -o report-collectors.go report-collectors.scm An error occurred while creating the directory: /sbuild-nonexistent/.gnucash Please correct the problem and restart GnuCash. The reported error was 'No such file or directory' (errno 2). ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /usr/bin/guild ;;; WARNING: compilation of /usr/bin/guild failed: ;;; ERROR: failed to create path for auto-compiled file "/usr/bin/guild" The entire build log can be found here: http://zulu309.server4you.de/build/logs/gnucash_2.6.5-1~getdeb2~utopic-i386-20141220-1732
Thank you for your report. I can indeed reproduce this by setting $HOME to some non-existent directory. This is triggered by the gnc_dotgnucash_dir function which aborts if it fails to set up a suitable .gnucash directory somewhere. The intention of the code is to use the tmp dir if home is not available, but the check was buggy so that never happened in this case. I have improved this buggy test so that now the tmp dir is effectively used if the home dir is non-existent. Note that in my tests the build still fails after applying this patch. This time however the failure message is: ccache: failed to create /nonexistent/.ccache (No such file or directory) I don't know who is responsible for this message, but it's not in gnucash code so I will stop my investigation here. I didn't rerun autogen.sh nor configure. Perhaps if you do this ccache issue would be resolved. Final note: when using guile 2 it will automatically try to compile each scm file for which no precompiled file is found. While the gnucash build system will now compile all scm files that are distributed it will not do so for scm files that are only used during the build. So these files will still trigger guile's autocompilation and result in lots of errors as you can find in your build log because autocompilation will also try to write the home directory. You may want to set environment variable GUILE_AUTO_COMPILE=0 to avoid these or tell guile to store its autocompiled files somewhere else.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=741810. Please update any external references or bookmarks.