Skip to content

Commit 7ff206d

Browse files
committed
Use stock Rtools toolchain by default for RTools44+
1 parent 3b6cf27 commit 7ff206d

4 files changed

Lines changed: 8 additions & 14 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ jobs:
4242
echo "CMDSTAN_PATH=${HOME}/.cmdstan" >> $GITHUB_ENV
4343
shell: bash
4444

45-
- name: Use stock RTools for Windows R-Devel
46-
if: ${{ matrix.config.os == 'windows-latest' && matrix.config.r == 'devel' }}
47-
run: |
48-
echo "CMDSTANR_USE_RTOOLS=TRUE" >> $GITHUB_ENV
49-
shell: bash
50-
5145
- uses: n1hility/cancel-previous-runs@v3
5246
with:
5347
token: ${{ secrets.GITHUB_TOKEN }}

R/install.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,8 @@ check_rtools4x_windows_toolchain <- function(fix = FALSE, quiet = FALSE) {
643643
call. = FALSE
644644
)
645645
}
646-
if (Sys.getenv("CMDSTANR_USE_RTOOLS") != "") {
646+
# No additional utilities/toolchains are needed with RTools44
647+
if (rtools4x_version() >= "44" && Sys.getenv("CMDSTANR_USE_MSYS_TOOLCHAIN") == "") {
647648
return(invisible(NULL))
648649
}
649650
if (!is_toolchain_installed(app = "g++", path = toolchain_path) ||
@@ -855,10 +856,11 @@ toolchain_PATH_env_var <- function() {
855856
}
856857

857858
rtools4x_toolchain_path <- function() {
858-
toolchain <- ifelse(is_ucrt_toolchain(), "ucrt64", "mingw64")
859-
if (Sys.getenv("CMDSTANR_USE_RTOOLS") != "") {
860-
if (arch_is_aarch64()) {
861-
toolchain <- "aarch64-w64-mingw32.static.posix"
859+
if (arch_is_aarch64()) {
860+
toolchain <- "aarch64-w64-mingw32.static.posix"
861+
} else {
862+
if (rtools4x_version() < "44" || Sys.getenv("CMDSTANR_USE_MSYS_TOOLCHAIN") != "") {
863+
toolchain <- ifelse(is_ucrt_toolchain(), "ucrt64", "mingw64")
862864
} else {
863865
toolchain <- "x86_64-w64-mingw32.static.posix"
864866
}

R/utils.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ arch_is_aarch64 <- function() {
9696
make_cmd <- function() {
9797
if (Sys.getenv("MAKE") != "") {
9898
Sys.getenv("MAKE")
99-
} else if (os_is_windows() && !os_is_wsl() && (Sys.getenv("CMDSTANR_USE_RTOOLS") == "")) {
99+
} else if (os_is_windows() && !os_is_wsl() && (rtools4x_version() < "44" || Sys.getenv("CMDSTANR_USE_MSYS_TOOLCHAIN") != "")) {
100100
"mingw32-make.exe"
101101
} else {
102102
"make"

tests/testthat/test-install.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
context("install")
2-
# Current tests need CmdStan 2.35 for stock rtools, but is not yet released
3-
skip_if(Sys.getenv("CMDSTANR_USE_RTOOLS") != "")
42

53
cmdstan_test_tarball_url <- Sys.getenv("CMDSTAN_TEST_TARBALL_URL")
64
if (!nzchar(cmdstan_test_tarball_url)) {

0 commit comments

Comments
 (0)