GnuCash Windows Build Help

John Ralls jralls at ceridwen.us
Thu Mar 20 17:23:58 EDT 2025


It’s not containerized. Right now it’s built on a Windows 10 VM using buildserver/buildpackage.ps1 in gnucash-on-windows. Although the script should update MinGW64 at every run, in practice it doesn’t when there’s a major change because MinGW requires a restart in that case so it has to be done manually. I have a local VM with a matching setup and every once in a while I do a Mingw64 update, get everything working again, commit the changes, then do a manual update on the build VM.

Regards,
John Ralls


> On Mar 20, 2025, at 12:38 PM, <russ.gorby at gmail.com> <russ.gorby at gmail.com> wrote:
> 
> Yeah, I think that may be the way to go. It’s been useful learning some of the issues with the MINGW environment but it sure seems like it might be painful developing in this environment. I want to start looking at actual gnucash code so I may do as you suggest.
>  So how are the release builds for windows created? Is there a containerized windows build environment that has all the MINGW environment already setup, and it’s just painful to get there from bare metal, or is it cross compiled to Windows from Linux somehow?
>   From: John Ralls <jralls at ceridwen.us> 
> Sent: Tuesday, March 18, 2025 9:00 PM
> To: russ.gorby at gmail.com
> Cc: Robert Fewell <14ubobit at gmail.com>; GnuCash Development <gnucash-devel at gnucash.org>
> Subject: Re: GnuCash Windows Build Help
>  Russ,
>  Have you considered setting up a Linux build environment instead? You can install your distro of choice in the Windows Subsystem for Linux (aka WSL). Many of them have a package manager target similar to Debian/Ubuntu’s `apt build-dep gnucash` that sets up everything you need except a code editor. It’s much less frustrating than the MinGW64 environment.
>  Regards,
> John Ralls
>  
> 
>> On Mar 18, 2025, at 15:27, <russ.gorby at gmail.com> <russ.gorby at gmail.com> wrote:
>>  That would be great.
>> I‘ve been converting the build script to python for my own uses so I’d be very interested in anything you discover.
>> I am new to the MSYS2/MING environment and am still coming up to speed.
>> I want to start working on the C++ code but need to understand the build and env details first I think.
>> Thanks, we’ll keep in touch
>>  From: Robert Fewell <14ubobit at gmail.com> 
>> Sent: Monday, March 17, 2025 3:18 AM
>> To: russ.gorby at gmail.com
>> Cc: Kevin Sanders <kbsanders at hotmail.com>; GnuCash Development <gnucash-devel at gnucash.org>
>> Subject: Re: GnuCash Windows Build Help
>>  Russ,
>> After a PC swap to Windows 11, I need to redo my windows build machine so will be starting from scratch. I should be able to do this this week so will report back here and hopefully be able to update the build script.
>>  Regards,
>> Robert
>>  On Sun, 16 Mar 2025 at 23:10, <russ.gorby at gmail.com> wrote:
>>> 
>>> 
>>> Hello all, I am also trying to build GnuCash on native Windows (64-bit Windows 10)
>>> I've reviewed the other threads on here from Kevin Sanders and Robert Fewell about native windows builds and have run into the same problems during bootstrap and worked around them in similar ways.
>>> I'm stuck on step 1/14 running jhbuild and was hoping one of them might have some insight.
>>>  Prior to building the first module, I ran into similar problems as others:
>>>     • I ran into the same 'distutils' problem
>>>         • This was which was addressed via
>>>             • Running: "pacman -S python-setuptools" 
>>>     • I ran into the same missing 'gcrypt' problem
>>>         • This was addressed via 
>>>             • Installing win-sudo
>>>             • Running:  "sudo jhbuild sysdeps --install"
>>>  Step 1/14 is building OpenSP-1.5.2
>>> It checks out and configures fine, but once the build starts I see what looks like maybe some header file problems but it errors out building  CmdLineApp.lo, DtdDeclEventHandler.lo Entity.lo and ArcEngine.lo
>>>  I saw Robert Fewell notes on failures in OpenSP build and took those changes to utils/packagedb.py but that doesn't address compilation errors I'm seeing.
>>>  If anyone has any insights on these specific issues that would be great.
>>> Short of that, I want to start at the first failure but the parallel builds are gumming the output
>>>  Q1: Can someone point me to where/how to eliminate the parallel jhbuilds (make -j5) so I can at least see some serial output?
>>>  Thanks for any pointers you might have.
>>>     • Russ
>>>   From: gnucash-devel <gnucash-devel-bounces+russ.gorby=gmail.com at gnucash.org> On Behalf Of Kevin Sanders
>>> Sent: Thursday, November 7, 2024 12:00 PM
>>> To: GnuCash Development <gnucash-devel at gnucash.org>
>>> Subject: Re: GnuCash Windows Build Help
>>>  Thanks John, I have joined the mailing list as suggested.
>>>  I installed the recommended distutils extra package and it completed successfully but the error remains.
>>>  Do you know what controls the version of python MinGW32 is using? Latest stable or something like that?
>>> The word "python" appears only once in the PowerShell setup script and is sans version.
>>>  Perhaps this could be a PATH or environment issue where installed modules cannot be resolved?
>>>  Console Output:
>>>  Kevin at Kevin-PC MINGW32 /c/gcdev64/src/gnucash-on-windows.git
>>> $ pacman -S mingw-w64-i686-python-distutils-extra
>>> resolving dependencies...
>>> looking for conflicting packages...
>>>  Packages (1) mingw-w64-i686-python-distutils-extra-2.39-4
>>>  Total Download Size:   0.04 MiB
>>> Total Installed Size:  0.11 MiB
>>>  :: Proceed with installation? [Y/n] y
>>> :: Retrieving packages...
>>>  mingw-w64-i686-python-dist...    36.5 KiB  39.1 KiB/s 00:01 [###############################] 100%
>>> (1/1) checking keys in keyring                               [###############################] 100%
>>> (1/1) checking package integrity                             [###############################] 100%
>>> (1/1) loading package files                                  [###############################] 100%
>>> (1/1) checking for file conflicts                            [###############################] 100%
>>> (1/1) checking available disk space                          [###############################] 100%
>>> :: Processing package changes...
>>> (1/1) installing mingw-w64-i686-python-distutils-extra       [###############################] 100%
>>>  Kevin at Kevin-PC MINGW32 /c/gcdev64/src/gnucash-on-windows.git
>>> $ TARGET=gnucash-stable jhbuild -f jhbuildrc build
>>> Traceback (most recent call last):
>>>   File "/usr/bin/jhbuild", line 22, in <module>
>>>     import jhbuild.main
>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/main.py", line 26, in <module>
>>>     import jhbuild.config
>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/config.py", line 31, in <module>
>>>     from jhbuild.environment import setup_env, setup_env_defaults, addpath
>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/environment.py", line 24, in <module>
>>>     from distutils.sysconfig import get_python_lib
>>> ModuleNotFoundError: No module named 'distutils'
>>>  From: John Ralls <jralls at ceridwen.us>
>>> Sent: Thursday, November 7, 2024 12:24 PM
>>> To: Kevin Sanders <kbsanders at hotmail.com>
>>> Cc: GnuCash Development <gnucash-devel at gnucash.org>
>>> Subject: Re: GnuCash Windows Build Help
>>>  Kevin,
>>>  Welcome to GnuCash. Please don’t contact the developers directly; always use one of the mailing lists (https://wiki.gnucash.org/wiki/Mailing_Lists). You can pick whether user or devel is appropriate for a particular conversation, the developers monitor both. For this conversation I’ve picked devel and cc’d it for your convenience. You’ll need to subscribe to it to reply.
>>>  That sounds like a Mingw64 problem, as Python officially didn’t remove distutils until 3.12.  OTOH distutils has been deprecated for years and the jhbuild maintainers have been ignoring the problem. They still are: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/291. Anyway, it looks like Mingw64 has provided a workaround called ming-w64-python-distutils-extra (https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-python-distutils-extra). You can install it from a Mingw32 terminal window by saying
>>>    pacman -S mingw-w64-i686-python-distutils-extra
>>>  Regards,
>>> John Ralls
>>>   
>>>> 
>>>> On Nov 7, 2024, at 08:47, Kevin Sanders <kbsanders at hotmail.com> wrote:
>>>>  Hi John, my name is Kevin Sanders.
>>>>  I'm a new user of GnuCash and I'm trying to get setup to do some development work with GnuCash on Windows.
>>>>  I'm sorry to bother you but I've run into an issue that I'm not sure how to resolve.
>>>>  I have ran the setup-mingw.ps1 PowerShell script.
>>>> I have launched a MSYS2 MingGW 32-bit terminal window and cd into the repository directory.
>>>> I run jhbuild and it fails with ModuleNotFoundError: No module named 'distutils'.
>>>>  I believe this to be a python issue, but I'm not really sure.
>>>> Python version is showing as 3.11.10.
>>>>  Any help would be greatly appreciated.
>>>>  -Kevin
>>>>  Console Output:
>>>>  Kevin at Kevin-PC MINGW32 /c/gcdev64/src/gnucash-on-windows.git
>>>> $ TARGET=gnucash-stable jhbuild -f jhbuildrc build
>>>> Traceback (most recent call last):
>>>>   File "/usr/bin/jhbuild", line 22, in <module>
>>>>     import jhbuild.main
>>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/main.py", line 26, in <module>
>>>>     import jhbuild.config
>>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/config.py", line 31, in <module>
>>>>     from jhbuild.environment import setup_env, setup_env_defaults, addpath
>>>>   File "/c/gcdev64/src/jhbuild.git/jhbuild/environment.py", line 24, in <module>
>>>>     from distutils.sysconfig import get_python_lib
>>>> ModuleNotFoundError: No module named 'distutils'
>>>>  Kevin at Kevin-PC MINGW32 /c/gcdev64/src/gnucash-on-windows.git
>>>> $ python --version
>>>> Python 3.11.10
>>> 
>>>  _______________________________________________
>>> gnucash-devel mailing list
>>> gnucash-devel at gnucash.org
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> 
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel




More information about the gnucash-devel mailing list