Repository navigation
Description
@nealrichardson - I wrote the below with Claude based on our chat and my chat with Jeroen - does this look like a reasonable experiment to try to make sure we don't need anything more complex?
Describe the enhancement requested
The Windows libarrow static library that r/configure.win downloads for every R user is built in CI with Rtools40 (ci/scripts/r_windows_build.sh, ci/scripts/PKGBUILD, the windows-cpp job in .github/workflows/r.yml, and the r-binary-packages crossbow task). Rtools40 is now archived: CRAN moved its installer to cran-archive.r-project.org on 2026-10-30, which broke both jobs (#55377), and its pacman package repository is no longer maintained. R 4.5 and later use Rtools45, which is MXE-based and has no package manager, so the current build script cannot run there as-is.
Most of what libarrow needs is already bundled by the Arrow CMake build (Thrift, AWS SDK, Brotli, google-cloud-cpp, abseil, protobuf, mimalloc; the last three only because rtools40 doesn't have them and AUTO falls back to bundling). Of the eight libraries PKGBUILD takes from the toolchain, Rtools45 ships six (zlib, zstd, lz4, bzip2, curl, re2), plus the OpenSSL and nghttp2 that the build script copies into the zip. The two it lacks, snappy and utf8proc, can be built with Snappy_SOURCE=BUNDLED and utf8proc_SOURCE=BUNDLED. I checked this against the rtools45-toolchain-libs-full-6768 tarballs for both x86_64 and aarch64; the library sets match for everything Arrow uses.
Proposed change:
- Install Rtools45 in the
windows-cppjob and call cmake directly instead ofmakepkg-mingw, withCMAKE_PREFIX_PATHpointing at the Rtools45 toolchain directory. - Bundle snappy, utf8proc and re2. Rtools45's re2 (2025-08-12) depends on abseil, so linking it from
configure.winwould need theabsl_*libraries on the link line; bundling is simpler. - Update the hard-coded link flags in
r/configure.win: drop-lsnappy -lutf8proc -lre2, and extendGCS_LIBSwith the transitive dependencies of Rtools45's curl 8.18 (libidn2,libpsl,libunistring,libiconv,libssh2,libgcrypt,libgpg-error, brotli). - Force-include a small compatibility header defining the
BCRYPT_*_ALG_HANDLEconstants. Rtools45 ships mingw-w64 11.0.1 headers, and itsbcrypt.hdoes not define the algorithm pseudo-handles that the bundled google-cloud-cpp uses ingoogle/cloud/internal/win32/, so the GCS build fails without them.r-windows/ucrt-libscarries the same four-define workaround in its Arrow recipe. - Pass
absl_SOURCE=BUNDLEDandProtobuf_SOURCE=BUNDLEDexplicitly. Rtools45 ships abseil 20250127 and protobuf 29.5; withCMAKE_PREFIX_PATHpointing at the toolchain,AUTOwould pick those up instead of the versions Arrow bundles (abseil 20260817), and whether the bundled google-cloud-cpp 3.2.0 and re2 build against the older ones is untested. Forcing bundled keeps the dependency set the same as today. - Update the crossbow task once the main workflow is green.
Windows aarch64 is a follow-up, not part of this issue: the Rtools45 aarch64 toolchain has the same libraries, but #52022 (xsimd) and #50612 need resolving first.
This issue was drafted with the help of an AI assistant.
Component(s)
Continuous Integration, R
Activity
nealrichardson commentedon Nov 4, 2026
Yeah that's what I was thinking. I don't see any fundamental reason why it can't work, but the only way we'll find out is by trying.
thisisnic commentedon Nov 5, 2026
CC @jeroen - after our chat yesterday, I discussed this with Neal, who has a better understanding of these internals than me, and he suggested that there might be a simpler path to updating building Arrow on Windows, which I'm going to have a look into after LatinR
jeroen commentedon Nov 5, 2026
OK sounds good. Let me know if you need any help. FWIW I am currently using this recipe and an msys2 based toolchain that is compatible with rtools45: https://github.com/r-windows/ucrt-libs/blob/master/mingw-w64-arrow/PKGBUILD
thisisnic commentedon Nov 13, 2026
Thanks @jeroen. After our chat yesterday, I think the "minimal disruption, maximal support" version of this plus #50612 will need us to make these changes:
windows-11-armrunner)This allows us to keep supporting R versions back to 4.2 on Windows. We don't want to upgrade RTools from 40 to 42, because there was a move from msys2 to MXE there which ended up with older versions of OpenSSL and curl. We could consider upgrading from 40 to 43 in April when we bump the minimum R version supported to 4.3.
@nealrichardson or @jonkeane - before I make a start on this, how does this sound?
nealrichardson commentedon Nov 13, 2026
Makes sense, sounds like how we used to do it, building for multiple Rtools toolchains--I'm old enough to remember when Rtools40 was the new thing 👴
jeroen commentedon Nov 13, 2026
This sounds good to me, let me know if you need help. Just to summarize the core issue: rtools42 - rtools45 are built on MXE instead of MSYS2 and therefore cannot use the existing PKGBUILD file that is used in our CI. Also some dependencies might be missing from the toolchain bundle so these might need to use the bundled version now.
As I mentioned to Nic yesterday, would recommend to build with rtools45 which is available on both intel and arm, and includes recent g++ and openssl so that should get us settled for upcoming years. You could keep the rtools40 legacy thing alive on a best-effort basis but the g++/openssl in there are quite old so I imagine at some point you need to retire it anyway.