Consider moving Windows from mingw64 to ucrt64

@codefarmer I’m seeing an error whilst running ./build.sh with your branch. Does it work OK for you? It’s generated when running pip install --upgrade pygraphviz

$ pip install pygraphviz
Collecting pygraphviz
  Using cached pygraphviz-1.14.tar.gz (106 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pygraphviz
  Building wheel for pygraphviz (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pygraphviz (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [104 lines of output]

[snip]

  gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -O3 -march=nocona -msahf -mtune=generic -O2 -pipe -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wp,-D__USE_MINGW_ANSI_STDIO=1 -O3 -DSWIG_PYTHON_STRICT_BYTE_CHAR -DGVDLL -IC:/msys64/tmp/grampspythonenv/include -IC:/msys64/ucrt64/include/python3.14 -c pygraphviz/graphviz_wrap.c -o build/temp.mingw_x86_64_ucrt_gnu-cpython-314/pygraphviz/graphviz_wrap.o
  pygraphviz/graphviz_wrap.c:9:9: warning: 'SWIG_PYTHON_STRICT_BYTE_CHAR' redefined
      9 | #define SWIG_PYTHON_STRICT_BYTE_CHAR
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  <command-line>: note: this is the location of the previous definition
  pygraphviz/graphviz_wrap.c: In function '_wrap_gvRenderData':
  pygraphviz/graphviz_wrap.c:5480:50: error: passing argument 5 of 'gvRenderData' from incompatible pointer type [-Wincompatible-pointer-types]
   5480 |   result = (int)gvRenderData(arg1,arg2,arg3,arg4,arg5);
        |                                                  ^~~~
        |                                                  |
        |                                                  unsigned int *
  In file included from pygraphviz/graphviz_wrap.c:3024:
  C:/msys64/ucrt64/include/graphviz/gvc.h:99:49: note: expected 'size_t *' {aka 'long long unsigned int *'} but argument is of type 'unsigned int *'
     99 |                          char **result, size_t *length);
        |                                         ~~~~~~~~^~~~~~
  error: command 'C:\\msys64\\ucrt64\\bin/gcc.EXE' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pygraphviz
Failed to build pygraphviz
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> pygraphviz

It looks to be an error in the underlying C code.
I can manually repeat from the cmd line

I just saw your comment in aio/setup.py
This is a know problem in graphviz, tracked by them here:

and further information in this PR: Fix types by schaeferpp · Pull Request #566 · pygraphviz/pygraphviz

@SteveY I was seeing this when I started working with the UCRT64 build. I think my tree or MSYS2 environment wasn’t clean. Once I removed the Gramps venv, removed all the build output directories, and updated all the UCRT packages, then the pygraphviz errors went away. I am able to build it cleanly on two different PCs.

@codefarmer I’ve also seen weird errors caused by “left over” artifacts from MINGW64 builds.
I just installed a fresh copy of MSYS2 (I renamed my existing C:\msys64 folder first). I’m still seeing an error when build.sh is run using this branch
hgohel/gramps at msys2-ucrt-build-gramps60

I wonder what is different about the configuration on my PC compared to your two PCs where it is working correctly?
I’m going to park this problem for now and keep working on the spell checker problem

Not sure what the difference could be, so for reference here are the UCRT packages I have installed:

Name : mingw-w64-ucrt-x86_64-graphviz
Version : 14.1.3-1

Name : mingw-w64-x86_64-python-graphviz
Version : 0.21-3

pip packages in grampspythonenv
graphviz==0.21
pygraphviz==1.14

Running the workflow on GitHub from this branch would tell us whether it can build in a clean environment.

In grampspythonenv, I uninstalled and reinstalled pygraphviz:

$ python -m pip uninstall pygraphviz
Found existing installation: pygraphviz 1.14
Uninstalling pygraphviz-1.14:
  Would remove:
    c:/msys64/tmp/grampspythonenv/lib/python3.14/site-packages/pygraphviz-1.14.dist-info/*
    c:/msys64/tmp/grampspythonenv/lib/python3.14/site-packages/pygraphviz/*
Proceed (Y/n)? Y
  Successfully uninstalled pygraphviz-1.14

(grampspythonenv)
$ python -m pip install pygraphviz
Collecting pygraphviz
  Using cached pygraphviz-1.14-cp314-cp314-mingw_x86_64_ucrt_gnu.whl
Installing collected packages: pygraphviz
Successfully installed pygraphviz-1.14

Looks like it’s not compiling code like you showed…installing from a wheel? This is not my area of expertise so maybe someone can explain what the difference is.

I have the same package versions installed
$ pacman -Q mingw-w64-ucrt-x86_64-graphviz mingw-w64-ucrt-x86_64-python-graphviz
mingw-w64-ucrt-x86_64-graphviz 14.1.3-1
mingw-w64-ucrt-x86_64-python-graphviz 0.21-3

but if I manually try to run pip

source /tmp/grampspythonenv/bin/activate
pip install pygraphviz

I get a compilation error

I agree that a pipeline build will help isolate the problem

Ohh it’s using a different package name on my PC. Look at the last line:

$ python -m pip install pygraphviz
Collecting pygraphviz
Using cached pygraphviz-1.14.tar.gz (106 kB)

whereas your PC reports
Using cached pygraphviz-1.14-cp314-cp314-mingw_x86_64_ucrt_gnu.whl

I’ve no idea why. Like you this is way outside my area of knowledge.