diff --git a/.ci/test_r_package.sh b/.ci/test_r_package.sh index cfc2731aade5..93bddf3c05a0 100755 --- a/.ci/test_r_package.sh +++ b/.ci/test_r_package.sh @@ -7,19 +7,6 @@ mkdir -p $R_LIB_PATH export R_LIBS=$R_LIB_PATH export PATH="$R_LIB_PATH/R/bin:$PATH" -# hack to get around this: -# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html -export _R_CHECK_SYSTEM_CLOCK_=0 - -# ignore R CMD CHECK NOTE checking how long it has -# been since the last submission -export _R_CHECK_CRAN_INCOMING_REMOTE_=0 - -# CRAN ignores the "installed size is too large" NOTE, -# so our CI can too. Setting to a large value here just -# to catch extreme problems -export _R_CHECK_PKG_SIZES_THRESHOLD_=100 - # don't fail builds for long-running examples unless they're very long. # See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. if [[ $R_BUILD_TYPE != "cran" ]]; then diff --git a/.ci/test_r_package_windows.ps1 b/.ci/test_r_package_windows.ps1 index d260f52af9e1..b07f15299af3 100644 --- a/.ci/test_r_package_windows.ps1 +++ b/.ci/test_r_package_windows.ps1 @@ -79,19 +79,6 @@ $env:CRAN_MIRROR = "https://cloud.r-project.org/" $env:CTAN_MIRROR = "https://ctan.math.illinois.edu/systems/win32/miktex" $env:CTAN_PACKAGE_ARCHIVE = "$env:CTAN_MIRROR/tm/packages/" -# hack to get around this: -# https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html -$env:_R_CHECK_SYSTEM_CLOCK_ = 0 - -# ignore R CMD CHECK NOTE checking how long it has -# been since the last submission -$env:_R_CHECK_CRAN_INCOMING_REMOTE_ = 0 - -# CRAN ignores the "installed size is too large" NOTE, -# so our CI can too. Setting to a large value here just -# to catch extreme problems -$env:_R_CHECK_PKG_SIZES_THRESHOLD_ = 100 - # don't fail builds for long-running examples unless they're very long. # See https://github.com/microsoft/LightGBM/issues/4049#issuecomment-793412254. if ($env:R_BUILD_TYPE -ne "cran") { diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index d8015f72b09d..146f03fb90f9 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -8,6 +8,18 @@ on: branches: - master +env: + # hack to get around this: + # https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005930.html + _R_CHECK_SYSTEM_CLOCK_: 0 + # ignore R CMD CHECK NOTE checking how long it has + # been since the last submission + _R_CHECK_CRAN_INCOMING_REMOTE_: 0 + # CRAN ignores the "installed size is too large" NOTE, + # so our CI can too. Setting to a large value here just + # to catch extreme problems + _R_CHECK_PKG_SIZES_THRESHOLD_: 100 + jobs: test: name: ${{ matrix.task }} (${{ matrix.os }}, ${{ matrix.compiler }}, R ${{ matrix.r_version }}, ${{ matrix.build_type }}) @@ -181,10 +193,37 @@ jobs: Rscriptdevel testthat.R 2>&1 > ubsan-tests.log cat ubsan-tests.log exit $(cat ubsan-tests.log | grep --count "runtime error") + test-r-debian-clang: + name: r-package (debian, R-devel, clang) + timeout-minutes: 60 + runs-on: ubuntu-latest + container: rhub/debian-clang-devel + steps: + - name: Install Git before checkout + shell: bash + run: | + apt-get update + apt-get install --no-install-recommends -y git + - name: Checkout repository + uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: true + - name: Install packages and run tests + shell: bash + run: | + export PATH=/opt/R-devel/bin/:${PATH} + Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'testthat'), repos = 'https://cran.r-project.org')" + sh build-cran-package.sh + R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit -1 + if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then + echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check" + exit -1 + fi all-successful: # https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert runs-on: ubuntu-latest - needs: [test, test-r-sanitizers] + needs: [test, test-r-sanitizers, test-r-debian-clang] steps: - name: Note that all tests succeeded run: echo "🎉" diff --git a/R-package/cran-comments.md b/R-package/cran-comments.md index bd713391b054..edfe7ed33004 100644 --- a/R-package/cran-comments.md +++ b/R-package/cran-comments.md @@ -1,11 +1,27 @@ # CRAN Submission History -## v3.2.0 - Submission 1 - (TBD) +## v3.2.1 - Submission 1 - (TBD) ### CRAN response ### Maintainer Notes +## v3.2.0 - Submission 1 - (March 22, 2021) + +### CRAN response + +Package is failing checks in the `r-devel-linux-x86_64-debian-clang` environment (described [here](https://cran.r-project.org/web/checks/check_flavors.html#r-devel-linux-x86_64-debian-clang)). Specifically, one unit test on the use of non-ASCII feature names in `Booster$dump_model()` fails. + +> Apparently your package fails its checks in a strict Latin-1* locale, +e.g. under Linux using LANG=en_US.iso88591 (see the debian-clang +results). + +> Please correct before 2021-04-21 to safely retain your package on CRAN. + +### Maintainer Notes + +Submitted a version 3.2.1 to correct the errors noted. + ## v3.1.1 - Submission 1 - (December 7, 2020) ### CRAN response diff --git a/R-package/tests/testthat/test_basic.R b/R-package/tests/testthat/test_basic.R index a48bd2860498..c762e778602b 100644 --- a/R-package/tests/testthat/test_basic.R +++ b/R-package/tests/testthat/test_basic.R @@ -2,6 +2,11 @@ context("lightgbm()") ON_WINDOWS <- .Platform$OS.type == "windows" +UTF8_LOCALE <- all(grepl( + pattern = "UTF-8$" + , x = Sys.getlocale(category = "LC_CTYPE") +)) + data(agaricus.train, package = "lightgbm") data(agaricus.test, package = "lightgbm") train <- agaricus.train @@ -1229,7 +1234,7 @@ test_that("lgb.train() supports non-ASCII feature names", { # UTF-8 strings are not well-supported on Windows # * https://developer.r-project.org/Blog/public/2020/05/02/utf-8-support-on-windows/ # * https://developer.r-project.org/Blog/public/2020/07/30/windows/utf-8-build-of-r-and-cran-packages/index.html - if (!ON_WINDOWS) { + if (UTF8_LOCALE && !ON_WINDOWS) { expect_identical( dumped_model[["feature_names"]] , feature_names