Skip to content

Commit

Permalink
[ci] [R-package] test against R 4.3 on Windows (#6061)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Oct 6, 2023
1 parent d45dca7 commit 3c7e38b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .ci/test_r_package_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ Remove-From-Path ".*\\R\\.*"
Remove-From-Path ".*R Client.*"
Remove-From-Path ".*rtools40.*"
Remove-From-Path ".*rtools42.*"
Remove-From-Path ".*rtools43.*"
Remove-From-Path ".*shells.*"
Remove-From-Path ".*Strawberry.*"
Remove-From-Path ".*tools.*"

Remove-Item C:\rtools40 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools42 -Force -Recurse -ErrorAction Ignore
Remove-Item C:\rtools43 -Force -Recurse -ErrorAction Ignore

# Get details needed for installing R components
#
Expand All @@ -76,11 +78,11 @@ if ($env:R_MAJOR_VERSION -eq "3") {
$env:RTOOLS_EXE_FILE = "rtools35-x86_64.exe"
$env:R_WINDOWS_VERSION = "3.6.3"
} elseif ($env:R_MAJOR_VERSION -eq "4") {
$RTOOLS_INSTALL_PATH = "C:\rtools42"
$RTOOLS_INSTALL_PATH = "C:\rtools43"
$env:RTOOLS_BIN = "$RTOOLS_INSTALL_PATH\usr\bin"
$env:RTOOLS_MINGW_BIN = "$RTOOLS_INSTALL_PATH\x86_64-w64-mingw32.static.posix\bin"
$env:RTOOLS_EXE_FILE = "rtools42-5253-5107.exe"
$env:R_WINDOWS_VERSION = "4.2.2"
$env:RTOOLS_EXE_FILE = "rtools43-5550-5548.exe"
$env:R_WINDOWS_VERSION = "4.3.1"
} else {
Write-Output "[ERROR] Unrecognized R version: $env:R_VERSION"
Check-Output $false
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/r_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
task: r-package
compiler: MINGW
toolchain: MSYS
r_version: 4.2
r_version: 4.3
build_type: cmake
container: null
# Visual Studio 2019
Expand All @@ -102,7 +102,7 @@ jobs:
task: r-package
compiler: MSVC
toolchain: MSVC
r_version: 4.2
r_version: 4.3
build_type: cmake
container: null
###############
Expand All @@ -119,7 +119,7 @@ jobs:
task: r-package
compiler: MINGW
toolchain: MSYS
r_version: 4.2
r_version: 4.3
build_type: cran
container: null
- os: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,13 @@ if(MSVC)
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP")
if(__BUILD_FOR_R)
# MSVC does not like this commit:
# https://github.com/wch/r-source/commit/fb52ac1a610571fcb8ac92d886b9fefcffaa7d48
#
# and raises "error C3646: 'private_data_c': unknown override specifier"
add_definitions(-DR_LEGACY_RCOMPLEX)
endif()
if(USE_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od")
else()
Expand Down
5 changes: 3 additions & 2 deletions R-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,18 @@ After installing `Rtools` and `CMake`, be sure the following paths are added to
- If you have `Rtools` 4.0, example:
- `C:\rtools40\mingw64\bin`
- `C:\rtools40\usr\bin`
- If you have `Rtools` 4.2, example:
- If you have `Rtools` 4.2+, example:
- `C:\rtools42\x86_64-w64-mingw32.static.posix\bin`
- `C:\rtools42\usr\bin`
- **NOTE**: this is e.g. `rtools43\` for R 4.3
* `CMake`
- example: `C:\Program Files\CMake\bin`
* `R`
- example: `C:\Program Files\R\R-3.6.1\bin`

NOTE: Two `Rtools` paths are required from `Rtools` 4.0 onwards because paths and the list of included software was changed in `Rtools` 4.0.

NOTE: `Rtools42` takes a very different approach to the compiler toolchain than previous releases, and how you install it changes what is required to build packages. See ["Howto: Building R 4.2 and packages on Windows"](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html).
NOTE: `Rtools42` and later take a very different approach to the compiler toolchain than previous releases, and how you install it changes what is required to build packages. See ["Howto: Building R 4.2 and packages on Windows"](https://cran.r-project.org/bin/windows/base/howto-R-4.2.html).

#### Windows Toolchain Options

Expand Down

0 comments on commit 3c7e38b

Please sign in to comment.