Skip to content

GH-55398: [R][CI] Build the Windows libarrow binary with Rtools45 instead of Rtools40 - #55594

Open
thisisnic wants to merge 6 commits into
apache:mainfrom
thisisnic:GH-55398-rtools45-ci
Open

thisisnic wants to merge 6 commits into
apache:mainfrom
thisisnic:GH-55398-rtools45-ci

Conversation

@thisisnic

@thisisnic thisisnic commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Upgrading from old toolchain for R Windows builds

What changes are included in this PR?

Bump default RTools version to 4.5 but keep 4.0 on in CI so we can support past few R versions still.

I'm filing a follow-up issue for actually distributing the binaries, to keep this PR smaller and more focused.

Are these changes tested?

On CI, aye

Are there any user-facing changes?

Nope

Was AI used for this PR?

Yeah, for most of it, but I prodded it and got it to reconsider a few decisions. That said, it'll need a deeper look to make sure we're not doing anything daft here.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #55398 has been automatically assigned in GitHub to PR creator.

@thisisnic

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit r-binary-packages

@github-actions

Copy link
Copy Markdown

Revision: 2834b54

Submitted crossbow builds: ursacomputing/crossbow @ actions-e5eea6767f

Task Status
r-binary-packages GitHub Actions

@thisisnic
thisisnic force-pushed the GH-55398-rtools45-ci branch from a9ce60c to 75cc517 Compare November 15, 2026 18:45
@thisisnic

Copy link
Copy Markdown
Member Author

Test failures not related to this PR. Will re-run CI to check no subsequent changes have broken anything. I've iterated on this with AI, but I don't quite trust my understanding enough to stand by every change here myself.

@thisisnic

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit r-binary-packages

@github-actions

Copy link
Copy Markdown

Revision: 75cc517

Submitted crossbow builds: ursacomputing/crossbow @ actions-611a18301d

Task Status
r-binary-packages GitHub Actions

@thisisnic

Copy link
Copy Markdown
Member Author

This PR only changes what per-PR CI builds and tests. The Windows libarrow binary that users download is still built with Rtools40 by the crossbow r-binary-packages task. Shipping an Rtools45 binary alongside it is tracked in #55624.

@thisisnic
thisisnic marked this pull request as ready for review November 15, 2026 22:43
Copilot AI balanced review requested due to automatic review settings November 15, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The Rtools45 migration changes the Windows ABI and static dependencies, requiring human review of CI linking/loading and timezone/cloud-storage behavior because the actual toolchain artifacts cannot be verified here.

No open issues 🎉

What changed in this PR

Migrates the R package’s Windows libarrow build to Rtools45, addressing the archived Rtools40 toolchain while retaining the legacy build path.

Changes:

  • Adds a direct CMake build and packaging path for Rtools42+, with curl dependency flags included in the archive.
  • Updates R’s linker configuration to support both legacy and new archives.
  • Switches Windows CI to Rtools45 and adds compatibility handling for MinGW headers and R-provided timezone data.
File Description
r/​configure.win Detects new archives and adjusts dependency link flags.
cpp/​src/​arrow/​util/​chrono_internal.h Allows overriding standard chrono usage for R’s timezone support.
cpp/​cmake_modules/​ThirdpartyToolchain.cmake Detects missing BCrypt macros before applying the MinGW workaround.
ci/​scripts/​r_windows_build.sh Defaults to Rtools45 with direct CMake builds, retaining the Rtools40 path.
.github/​workflows/​r.yml Uses Rtools45 build artifacts and explicitly installs ccache.

Review effort: Balanced

# Build the static libarrow that r/configure.win downloads on Windows.
#
# * Rtools40 (MSYS2): makepkg-mingw with ci/scripts/PKGBUILD.
# * Rtools42+ (MXE, no pacman/makepkg): call CMake directly against the

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# * Rtools42+ (MXE, no pacman/makepkg): call CMake directly against the
# * Rtools42+ (libraries are a fixed set built with MXE): call CMake directly against the

I'll apply this change before merging, not worth ending up rerunning CI right this sec for a comment

# specific language governing permissions and limitations
# under the License.

# Build the static libarrow that r/configure.win downloads on Windows.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT reading the diff, there is basically nothing shared between the old version and the new one, so maybe it would be cleaner and more readable to just have two different scripts.


# cURL's link dependencies vary by Rtools version, so read them from
# libcurl.pc, ship the toolchain ones, and record the flags in libcurl.libs
# for r/configure.win. Static link order matters, so:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK the answer to this but I wonder whether this logic belongs better in configure.win

# Workaround missing BCRYPT_RSA_ALG_HANDLE macro in older MinGW-w64 headers.
# google-cloud-cpp v3+ uses it without guards in sign_using_sha256.cc.
# Workaround missing BCRYPT_RSA_ALG_HANDLE and BCRYPT_MD5_ALG_HANDLE macros
# in older MinGW-w64 headers. google-cloud-cpp v3+ uses them without guards.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would turning off google-cloud-cpp in the older Windows builds simplify this?

Comment thread .github/workflows/r.yml
matrix:
config:
- { rtools: 40, arch: 'ucrt64' }
- { rtools: 45, arch: 'ucrt64' }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgive my ignorance, but if we only build rtools45 here, where does the rtools40 get built?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plan is to build RTools45 on every PR and do both RTools40 and RTools45 for binaries to distribute (in a follow-up PR). So at the moment, after this PR, we'd build with RTools40 in the r-binary-packages job like it is at the moment (which is why that file doesn't show up in this PR).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants