Sorry for coming back to this previous discussion on Rtools42 support by r-lib/actions:
Gabor argued that differences between rtools40 and rtools42 are minimal. Yet as I understand it, Rtools has expanded the scope of static libraries shipped by default, so that more R packages can be compiled natively, without the hack to download cross-compiled binaries from rwinlibs?
The "Upcoming Changes in R 4.2 on Windows"-blog entry says: "Rtools42 contains libraries for almost all CRAN packages, which allows to get rid of downloading pre-built libraries at package installation time."
My scenario: I maintain the RcppCWB package, which relies on glib-2.0 . glib-2.0 is included in Rtools42. Maybe I miss something, but I cannot find headers nor the library glib-2.0 in Rtools40.
At least I strongly assume that the absence of glib-2.0 in Rtools40 is the reason why building and checking the package via GHA fails. This is where it breaks:
gcc -c -o fileutils.o -O2 -Wall -D__MINGW__ -DEMULATE_SETENV -DCOMPILE_DATE=""Wed Jan 26 09:44:57 GMT 2022"" -DCWB_VERSION="3.4.33" -Ic:/rtools42/x86_64-w64-mingw32.static.posix/include/glib-2.0 -Ic:/rtools42/x86_64-w64-mingw32.static.posix/lib/glib-2.0/include -DPCRE_STATIC fileutils.c
fileutils.c:23:10: fatal error: glib.h: No such file or directory
23 | #include <glib.h>
| ^~~~~~~~
compilation terminated.
Makevars.ucrt which relies on a R_TOOLS_SOFT environment variable might be looking at the wrong location. Maybe setting R_TOOLS_SOFT differently would make things work on GHA? Yet my working hypothesis is that things would work with Rtools42, and this would add an argument for moving to Rtools42.
My apologies if I am getting something wrong ...