[GNC-dev] Building on Windows

Geert Janssens geert.gnucash at kobaltwit.be
Mon Aug 26 04:44:56 EDT 2019


Op zaterdag 24 augustus 2019 18:22:42 CEST schreef John Ralls:
> > On Aug 23, 2019, at 11:28 PM, Geert Janssens <geert.gnucash at kobaltwit.be>
> > wrote:
> > 
> > Op vrijdag 23 augustus 2019 22:49:12 CEST schreef Matthew Forbis via
> > gnucash-> 
> > devel:
> >> I have finally had time to sit down and try again.  When libxml
> >> development
> >> was installed via pacman, it installed icu64 in addition to the icu61
> >> that
> >> was already installed by the gnucash script.  I was able to remove icu64
> >> and clear out the entire build and inst directories and try again.  It
> >> built without errors at that point and then the first time I ran, it
> >> crashed.  I had to do a glib-compile-schemas in order for it to run at
> >> that
> >> point.  (I'm just documenting manual interactions in case the scripts
> >> should be updated some for others).
> >> 
> >> Thanks all for your help so far.  Now onto trying to debug the chart hang
> >> problem.
> > 
> > Thanks for the feedback.
> > 
> > How exactly did you run gnucash ?
> > 
> > I think the whole windows build system is set up to create a Windows
> > installer for the gnucash package and run gnucash after this installer
> > has run.
> > 
> > On the other hand, if simply running the glib-compile-schemas on the end
> > result of the build script helps you run it without invoking the Windows
> > installer, that's a worthwile bonus.
> > 
> > I *thought* we did run this while building, but a quick scan of the build
> > scripts suggest it's only run while bundling gnucash. I wonder why that
> > is.
> > Perhaps John remembers.
> 
> Because everything else that uses GSettings is built by MinGW, because
> there's no need for GSettings during the build process and
> glib-compile-schemas is comprehensive so running it once at the end does
> the job.
> 
I may not have been very clear. I do understand all that. However I was 
thinking of the ability to run from the build directory while debugging. From 
what I understand that requires glib-compile-schemas to run once at the end of 
the build process.

> IIRC we disabled compiling the schemas at build time because it set up the
> paths for the build directory and so the compiled schemas failed after the
> install step.
> 
I had to refresh my memory and dug a bit through the various code bits. IUIC 
the issue may be slightly more nuanced.

>From what I understand the gschemas.compile file only holds information on the 
schema files it finds during compilation (obviously). During build the compile 
step will only find the gnucash gschema files. However as gnucash relies on 
gtk as well, it also needs the gtk gschema files at run time.

So if we want to run gnucash directly from the build directory [1], gnucash 
needs to find those files as well. As long as gnucash is run from a mingw32 
shell, they should be found as in that environment the gtk gschemas will be 
installed in mingw's default system location, and ours are installed in the 
build dir.

The same should be valid for running directly from the install location (the 
one where 'make install' puts the files).

However when bundling everything in the installer, suddenly the gtk and 
gnucash gschemas end up in the same directory, and both gtk and gnucash have a 
gschemas.compiled file available for bundling. And those files
a. only cover their respective gschema files
b. want to be installed in the same location with the same name
So for the installer a new one has to be generated that covers all gschema 
files that are part of the bundle.

To be fair I'm not sure the gschema compilation would be the only missing 
piece to allow running directly from build or inst. I do think on the other 
hand this particular issue may be solvable fairly easily. (I have fired up my 
Windows build to experiment with this).

> As for the build system set up, build_package.ps1 does indeed build a
> setup.exe for distribution and even uploads it to the distribution server
> if provided with an upload URI. For other purposes the build system does
> require a bit of manual intervention. That's equally true on Unix including
> MacOS.

As far as I know nothing has to be done in particular on linux. I can run
cmake with a custom install path, build/install and then run gnucash from 
where it got installed. I'm probably so used to it I forgot that's not the 
case on the other platforms.

Regards,

Geert




More information about the gnucash-devel mailing list