Skip to content

Commit

Permalink
more changes, better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Dec 9, 2024
1 parent 65896f6 commit 791bd3a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .ci/download-r-revdeps.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ reverse_deps <- depDF[["to"]]

# skip some dependencies with known issues:
#
# * 'misspi' ()
# * 'misspi' (https://github.com/microsoft/LightGBM/issues/6741)
deps_to_skip <- "misspi"
.log(sprintf("excluding %i reverse deps: %s", length(deps_to_skip), toString(deps_to_skip)))
reverse_deps <- reverse_deps[!reverse_deps %in% deps_to_skip]
Expand Down Expand Up @@ -45,7 +45,7 @@ their_deps <- unlist(

all_deps <- sort(unique(c(their_deps, reverse_deps)))

# don't try to install 'lightgbm', or packages expected that ship with the R standard library
# don't try to install 'lightgbm', or packages that ship with the R standard library
all_deps <- all_deps[!all_deps %in% c("grid", "methods", "lightgbm", "parallel", "stats", "utils")]

.log(sprintf("packages required to run these checks: %i", length(all_deps)))
Expand Down
11 changes: 8 additions & 3 deletions .ci/run-revdep-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ set -e -u -o pipefail
CHECKS_OUTPUT_DIR=/tmp/lgb-revdepchecks
mkdir -p "${CHECKS_OUTPUT_DIR}"

# pre-install all of lightgbm's reverse dependencies,
# and all of their dependencies
# Pre-install all of lightgbm's reverse dependencies, and all of their dependencies,
# preferring precompiled binaries where available.
#
# This is done for speed... tools::check_packages_in_dir() only performs source
# installs of all packages, which results in lots of compilation. {lightgbm} checks
# do not need to care about that... as of this writing, nothing has {lightgbm} as a
# 'LinkingTo' dependency or otherwise needs {lightgbm} at build time.
Rscript ./.ci/download-r-revdeps.R "${CHECKS_OUTPUT_DIR}"

# build and install 'lightgbm'
sh build-cran-package.sh --no-build-vignettes
sh ./build-cran-package.sh --no-build-vignettes
R CMD INSTALL --with-keep.source ./lightgbm_*.tar.gz

# run 'R CMD check' on lightgbm's reverse dependencies
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/r_revdepchecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ env:
# ignore R CMD CHECK NOTE checking how long it has
# been since the last submission
_R_CHECK_CRAN_INCOMING_REMOTE_: 0
# Indicate that no more than 2 threads should be used.
# ('misspi' explicitly read this variable, and expects it to be set to 'TRUE')
# ref: https://github.com/wch/r-source/blob/7feb54f6a71f1a6ec9e55ac0fb20115cd1a1d4e0/doc/manual/R-ints.texi#L4163
_R_CHECK_LIMIT_CORES_: 'TRUE'
# 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
Expand All @@ -38,6 +34,8 @@ jobs:
timeout-minutes: 60
strategy:
fail-fast: false
# NOTE: platforms that CRAN provides pre-compiled binaries on (like macOS and Windows)
# are preferable for this, because packages installs are much faster
matrix:
os:
- macos-14
Expand All @@ -47,12 +45,6 @@ jobs:
fetch-depth: 5
submodules: true
- uses: r-lib/actions/setup-pandoc@v2
- name: Install tinytex
if: startsWith(matrix.os, 'windows')
uses: r-lib/actions/setup-tinytex@v2
env:
CTAN_MIRROR: https://ctan.math.illinois.edu/systems/win32/miktex
TINYTEX_INSTALLER: TinyTeX
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
Expand Down
2 changes: 2 additions & 0 deletions R-package/R/lgb.train.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ lgb.train <- function(params = list(),
reset_data = FALSE,
serializable = TRUE) {

stop("--- Intentional error for testing ---")

# validate inputs early to avoid unnecessary computation
if (nrounds <= 0L) {
stop("nrounds should be greater than zero")
Expand Down

0 comments on commit 791bd3a

Please sign in to comment.