GnuCash and Guile 2

Geert Janssens janssens-geert at
Tue Dec 18 13:01:45 EST 2012

I have fixed the remaining warnings I got when not auto compiling and 
the errors that guile's autocompile (1) generated. While files are 
autocompiled, it still generates lots of warnings about 'potentially 
undefined symbols'. This only happens while autocompiling. Since the 
compile results are cached, this happens only once for normal users.
The warnings are apparently harmless, because gnucash runs fine in my tests.

Also make check passes for both guile 1.8 and guile 2.0. Word of caution 
here though: if you install both guile and guile 2, for one of both the 
guile executable is not "guile". In my case, I have guile (1.8) and 
guile2 (2.0). Some tests are hardcoded to execute 'guile' and these 
tests will segfault when run against guile2. If you manually fix the 
tests to execute guile2, they pass fine. This is a transient issue that 
will resolve itself once only guile2 is an option.

With current code, only three real deprecated symbol compile warnings 
(generated by guile) remain in src/app-utils/gfec.c

This has to do with catching errors when trying to eval some string/load 
a file from c to scm. This is slightly too technical for me to really 
grasp. Moreover, the deprecation warning states:
'scm_internal_stack_catch' is deprecated. Talk to guile-devel if you see 
this message

So that's what needs to happen. For now, I'll just keep the warnings in 
place, but will prevent the build from failing on this and consider 
GnuCash ready for guile 2.

Note this hasn't been tested on platforms other than (Fedora) linux. The 
windows build should first try to get guile 2 itself running before it 
can be tested and probably something similar is needed for the OS 
X/Quarz build.

But I consider neither a requirement for GnuCash 2.6. What guile 2 is 
concerned, I consider it ready to go.


(1) Note that compiling scheme files is a new feature of guile 2. Guile 
2 by default compiles those files into some byte code format to be run 
on in internal virtual machine. If no specific parameters are set, this 
happens the first time a scheme file is needed by guile. The compiled 
file is cached for later use. Compilation can be skipped by setting the 
environment variable GUILE_AUTO_COMPILE to 0 before running the 
program.  If skipped guile will fall back to the old method of simply 
interpreting the files (unless a previously compiled file is still found 
in cache).

On 15-12-12 19:21, Geert Janssens wrote:
> As of r22655 the development branch of gnucash can be built and run
> with guile 2. It still spews warnings and the environment variable
> GUILE_AUTO_COMPILE should be set to 0, so this is still a work in 
> progress.
> It is important to realize though that this is only possible is swig is
> properly patched as well. I have submitted a patch here for swig:
> So build instructions in short:
> - download the swig patch from the above link (against swig 2.0.8) and 
> build a
> patched swig
> - install guile 2
> - checkout gnucash' trunk branch as of r22655
> - you may need to update to have it prefer guile 2 if 
> both guile
> 1.8 and guile 2 are installed on the system
> - build gnucash as usual
> - run gnucash as
> GUILE_AUTO_COMPILE=0 /path/to/gnucash
> It goes without saying that gnucash continues to work with guile 1.8.
> Feedback is welcome.

More information about the gnucash-devel mailing list