Support Rtools 42 on GHA

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 ...

Yes, Rtools40 does not include many external libraries, while Rtools42 does.

So on GHA with Rtools40 you need to install these manually, like this: actions/setup-r-dependencies at v2-branch · r-lib/actions · GitHub

Alternatively you can download and install Rtools42 from Index of /nosvn/winutf8/ucrt3 , it goes like this:

    run: |
      Invoke-WebRequest -Uri  https://www.r-project.org/nosvn/winutf8/ucrt3/rtools42-4998-4926.exe -OutFile rtools42.exe
       .\rtools42.exe /verysilent /suppressmsgboxes

But to be honest, I am not entirely sure that your question is.

Thanks so much: This snippet ist roughly what I have been looking for. As I prepare the UCRT-compatible release of my package (RcppCWB) for CRAN, I want to run the checks using GitHub CI / GHA, and the absence of Rtools is a limitation.

But ... I can download Rtools42 and trigger the installation, but for some reason, installation is not complete when the precess reaches the package checking step. The directory c:/rtools42/x86_64-w64-mingw32.static.posix/includeis not there.

This has been hard to understand, because Rtools42 installation runs in the background. I have checked against what I see when installing Rtools42 on a local machine, with an identical version. So I am very confident that my include path is correct. The Rtools installation is just not complete when the checking step is reached.

As Rtools requires a lot of disk space. Is there a limitation on GHA? Is there a safeguard to ensure that the action only moves to the next step, when Rtools42 installation is finished and complete?

Let me add some information. Before starting to check the package, I generate output on the content of directories. This is what I see.


1s
Run rm .\rtools42.exe

    Directory: C:\

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           1/27/2022  7:46 AM                actions
d----           1/17/2022 12:21 AM                aliyun-cli
d----           1/16/2022 11:12 PM                Android
d----           1/17/2022 12:10 AM                cabal
d----           2/26/2015 11:23 PM                cobertura-2.1.1
d----           1/27/2022  7:46 AM                data
d----           1/17/2022 12:10 AM                ghcup
d----           1/16/2022 10:53 PM                hostedtoolcache
d----           1/16/2022  9:10 PM                image
d----           1/16/2022  9:22 PM                inetpub
d----           1/16/2022 10:52 PM                Julia
d----           1/16/2022 10:25 PM                Microsoft
d----           1/17/2022 12:11 AM                Miniconda
d----           1/16/2022 11:30 PM                Modules
d----           1/16/2022 11:49 PM                msys64
d----            7/1/2021  9:02 AM                mysql
d----           1/16/2022 10:44 PM                npm
d----           1/16/2022  9:18 PM                Packages
d----            5/8/2021  8:20 AM                PerfLogs
d----           1/16/2022  9:09 PM                post-generation
d-r--           1/17/2022 12:22 AM                Program Files
d----           1/17/2022 12:15 AM                Program Files (x86)
d----           1/27/2022  7:48 AM                R
d----           1/16/2022 11:52 PM                rtools40
d----           1/27/2022  7:48 AM                rtools42
d----           1/19/2022  7:39 AM                runners
d----           1/16/2022 11:46 PM                selenium
d----           1/16/2022 11:46 PM                SeleniumWebDrivers
d----           1/17/2022 12:31 AM                shells
d----           1/16/2022 10:51 PM                Strawberry
d----           1/16/2022 11:57 PM                Temp
d----           1/17/2022 12:10 AM                tools
d-r--           1/19/2022  7:38 AM                Users
d----           1/17/2022 12:16 AM                vcpkg
d-r--           1/19/2022  7:28 AM                Windows
d----           1/19/2022  7:28 AM                WindowsAzure
-a---           1/19/2022  7:44 AM            483 imagedata.json
-a---           1/17/2022 12:40 AM          32991 InstalledSoftware.md

    Directory: C:\rtools42

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           1/27/2022  7:48 AM                clang32
d----           1/27/2022  7:48 AM                clang64
d----           1/27/2022  7:48 AM                clangarm64
d----           1/27/2022  7:48 AM                dev
d----           1/27/2022  7:48 AM                etc
d----           1/27/2022  7:48 AM                home
d----           1/27/2022  7:48 AM                mingw32
d----           1/27/2022  7:48 AM                mingw64
d----           1/27/2022  7:48 AM                opt
d----           1/27/2022  7:48 AM                tmp
d----           1/27/2022  7:48 AM                ucrt64
d----           1/27/2022  7:48 AM                usr
d----           1/27/2022  7:48 AM                var
d----           1/27/2022  7:48 AM                x86_64-w64-mingw32.static.posix
-a---           5/19/2021  7:51 AM             82 autorebase.bat
-a---          11/28/2021  3:20 PM          79607 clang32.exe
-a---          11/24/2021  1:26 AM          30395 clang32.ico
-a---          11/28/2021  3:20 PM            154 clang32.ini
-a---          11/28/2021  3:20 PM          79607 clang64.exe
-a---          11/24/2021  1:26 AM          30450 clang64.ico
-a---          11/28/2021  3:20 PM            154 clang64.ini
-a---          11/24/2021  1:26 AM          30394 clangarm64.ico
-a---           1/17/2022  7:04 PM            541 dir
-a---          11/28/2021  3:20 PM          79607 mingw32.exe
-a---          11/24/2021  1:26 AM          30309 mingw32.ico
-a---          11/28/2021  3:20 PM            154 mingw32.ini
-a---          11/28/2021  3:20 PM          79607 mingw64.exe
-a---          11/24/2021  1:26 AM          30532 mingw64.ico
-a---          11/28/2021  3:20 PM            154 mingw64.ini
-a---          11/24/2021  1:26 AM           8810 msys2_shell.cmd
-a---          11/28/2021  3:20 PM          87799 msys2.exe
-a---          11/24/2021  1:26 AM          38434 msys2.ico
-a---          11/28/2021  3:20 PM            151 msys2.ini
-a---          11/28/2021  3:20 PM          79607 ucrt64.exe
-a---          11/24/2021  1:26 AM          30459 ucrt64.ico
-a---          11/28/2021  3:20 PM            153 ucrt64.ini
-a---           1/27/2022  7:48 AM              0 unins000.dat
-a---           1/27/2022  7:48 AM        3137057 unins000.exe

    Directory: C:\rtools42\x86_64-w64-mingw32.static.posix

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           1/27/2022  7:48 AM                lib
d----           1/27/2022  7:48 AM                sbin
d----           1/27/2022  7:48 AM                share
d----           1/27/2022  7:48 AM                var

On my local machine, the x86_64-w64-mingw32.static.posix directory includes an include directory, with a glib-2.0` directory. This is missing on GHA - and I do not understand why. Help is very welcome!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.