Skip to content

Commit e6aeb27

Browse files
committed
Update tests, add warning for versions
1 parent 7ff206d commit e6aeb27

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

R/install.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ install_cmdstan <- function(dir = NULL,
103103
} else {
104104
.cmdstanr$WSL <- FALSE
105105
}
106+
if (os_is_windows() && !os_is_wsl() && version < "2.35.0") {
107+
if (Sys.getenv("CMDSTANR_USE_MSYS_TOOLCHAIN") == "") {
108+
stop("CmdStan versions prior to 2.35.0 require additional toolchain configuration on Windows.\n",
109+
"Please set the environment variable CMDSTANR_USE_MSYS_TOOLCHAIN to 'true' and \n",
110+
"call `check_cmdstan_toolchain(fix = TRUE)` before installing CmdStan.", call. = FALSE)
111+
}
112+
}
106113
if (check_toolchain) {
107114
check_cmdstan_toolchain(fix = FALSE, quiet = quiet)
108115
}

tests/testthat/test-install.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ test_that("install_cmdstan() works with version and release_url", {
9898
expect_message(
9999
expect_output(
100100
install_cmdstan(dir = dir, overwrite = TRUE, cores = 4,
101-
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.33.0/cmdstan-2.33.0.tar.gz",
101+
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.33.0/cmdstan-2.35.0.tar.gz",
102102
wsl = os_is_wsl()),
103103
"Compiling, linking C++ code",
104104
fixed = TRUE
@@ -110,7 +110,7 @@ test_that("install_cmdstan() works with version and release_url", {
110110
expect_message(
111111
expect_output(
112112
install_cmdstan(dir = dir, overwrite = TRUE, cores = 4,
113-
version = "2.33.0",
113+
version = "2.35.0",
114114
# the URL is intentionally invalid to test that the version has higher priority
115115
release_url = "https://github.com/stan-dev/cmdstan/releases/download/v2.27.3/cmdstan-2.27.3.tar.gz",
116116
wsl = os_is_wsl()),
@@ -254,10 +254,10 @@ test_that("Install from release file works", {
254254
dir <- tempdir(check = TRUE)
255255
}
256256

257-
destfile = file.path(dir, "cmdstan-2.33.1.tar.gz")
257+
destfile = file.path(dir, "cmdstan-2.35.0.tar.gz")
258258

259259
download_with_retries(
260-
"https://github.com/stan-dev/cmdstan/releases/download/v2.33.1/cmdstan-2.33.1.tar.gz",
260+
"https://github.com/stan-dev/cmdstan/releases/download/v2.35.0/cmdstan-2.35.0.tar.gz",
261261
destfile)
262262

263263
expect_message(

0 commit comments

Comments
 (0)