Repository navigation
Conversation
|
|
|
@github-actions crossbow submit r-binary-packages |
|
Revision: 2834b54 Submitted crossbow builds: ursacomputing/crossbow @ actions-e5eea6767f
|
a9ce60c to
75cc517
Compare
|
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. |
|
@github-actions crossbow submit r-binary-packages |
|
Revision: 75cc517 Submitted crossbow builds: ursacomputing/crossbow @ actions-611a18301d
|
|
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 |
There was a problem hiding this comment.
🔵 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
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # Build the static libarrow that r/configure.win downloads on Windows. |
There was a problem hiding this comment.
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.
| matrix: | ||
| config: | ||
| - { rtools: 40, arch: 'ucrt64' } | ||
| - { rtools: 45, arch: 'ucrt64' } |
There was a problem hiding this comment.
Forgive my ignorance, but if we only build rtools45 here, where does the rtools40 get built?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Change of plan - I updated to do both in this PR
There was a problem hiding this comment.
🔵 Needs a closer look
The Rtools45 migration needs Windows maintainer validation of static dependency linking and timezone behavior because the relevant artifacts and Windows build/runtime results are unavailable.
No open issues 🎉
Review effort: Balanced
e856488 to
9a48f20
Compare
|
I decided to implement the version choosing stuff in this PR as it felt weird to defer it to a follow-up |
|
@github-actions crossbow submit r-binary-packages |
|
Revision: 9a48f20 Submitted crossbow builds: ursacomputing/crossbow @ actions-6384c0510c
|
|
OK, this is probably ready for another look @nealrichardson |
nealrichardson
left a comment
There was a problem hiding this comment.
A couple of questions to consider but this generally looks like the right shape, assuming the various CI builds pass. Thanks for taking this on!
| # These string values, along with `NULL`, are the potential return values of | ||
| # this function. | ||
| identify_binary <- function(lib = Sys.getenv("LIBARROW_BINARY"), info = distro()) { | ||
| # this function. On Windows, LIBARROW_BINARY is ignored and the binary is |
There was a problem hiding this comment.
It's been a while I guess since I've looked at this file, but if it is doing Windows stuff, maybe nixlibs.R is not the right name anymore?
| local_binding("VERSION_22_OR_LATER", TRUE) | ||
|
|
||
| expect_identical(identify_binary(r_version = "4.3.3"), "windows-x86_64-rtools40") | ||
| expect_identical(identify_binary(r_version = "4.4.0"), "windows-x86_64-rtools45") |
There was a problem hiding this comment.
I know this is mentioned in a few comments, but to be clear: we use the rtools45 toolchain for R 4.4? That sounds counterintuitive but I believe you if it is true. That said, CI seems to test R 4.3, oldrel (4.5) and release (4.6), so I'm not sure passing builds confirms that to be true.
There was a problem hiding this comment.
Yeah, so I tested various iterations ahead of making this PR and basically R >=4.4 will build with RTools45 but 4.3 needs an earlier one. I figured we do 4.3 as the highest supported R version that builds on RTools40 and then oldrel and rel, but can switch this over if that's weird
There was a problem hiding this comment.
Totally your call, I don't feel strongly here, not too concerned about old R on Windows support, probably not worth adding more CI for it.
| # Prefer the runner's CMake: the one in older Rtools can be too old for Arrow | ||
| CMAKE="cmake" | ||
| if [ -x "${PROGRAMFILES}/CMake/bin/cmake.exe" ]; then | ||
| CMAKE="${PROGRAMFILES}/CMake/bin/cmake.exe" | ||
| fi |
There was a problem hiding this comment.
This logic seems a little odd. So the cmake in Rtools45 is too old. On GitHub Actions we want to prefer the one on the runner. And I take it that CMAKE as an env var is to allow (theoretically) someone to provide a different path/to/cmake?
If that's so, then if CMAKE is set, we should prefer it. Otherwise, see if it exists in "${PROGRAMFILES}/CMake/bin/cmake.exe" and use that? Else, take whatever is on PATH? I guess we don't need to check cmake versions here, it will fail to run later with a clear enough message.
There was a problem hiding this comment.
My bad, this was an artefact from trying things out with RTools42 which we don't build with, will delete
|
@github-actions crossbow submit r-binary-packages |
|
Revision: b322944 Submitted crossbow builds: ursacomputing/crossbow @ actions-f82f57117f
|
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
1 resolved since last review
Review effort: Lite
| RWINLIB_DIR="$(ls windows/ | grep "^r-libarrow-.*-${VERSION}\$" | tail -n 1)" | ||
| if [ -z "${RWINLIB_DIR}" ]; then |
| RWINLIB_DIR="$(ls windows/ | grep ^r-libarrow- | tail -n 1)" | ||
| fi | ||
| RWINLIB="../windows/${RWINLIB_DIR}" |
| if (package_version(r_version) < "4.4") { | ||
| return("windows-x86_64-rtools40") | ||
| } else { | ||
| return("windows-x86_64-rtools45") | ||
| } |

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:
Reviewed before submission by: