Skip to content

Commit

Permalink
More R-CMD-check-occasional fixes (#6390)
Browse files Browse the repository at this point in the history
* res is missing somehow?

* trace .libPaths() too

* Don't use {remotes} for installation

* Run tomorrow
  • Loading branch information
MichaelChirico authored Aug 22, 2024
1 parent 611befb commit f339aa6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/R-CMD-check-occasional.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
schedule:
- cron: '17 13 22 * *' # 22nd of month at 13:17 UTC
- cron: '17 13 23 * *' # 23rd of month at 13:17 UTC

# A more complete suite of checks to run monthly; each PR/merge need not pass all these, but they should pass before CRAN release
name: R-CMD-check-occasional
Expand Down Expand Up @@ -42,7 +42,6 @@ jobs:
r: '4.1'

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
Expand Down Expand Up @@ -90,16 +89,18 @@ jobs:
_R_CHECK_TESTS_NLINES_: 0
run: |
options(crayon.enabled = TRUE)
install.packages("remotes")
message("*** DONE remotes, now installing requirements ***")
remotes::install_deps(dependencies=TRUE, force=TRUE)
message("*** Using the following repos for installation ***")
print(getOption("repos"))
message("*** Installing Suggested packages ***")
sugg <- names(tools:::.split_dependencies(read.dcf("DESCRIPTION", "Suggests")))
install.packages(sugg)
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
eval(other_deps_expr)
other_pkgs = get(as.character(other_deps_expr[[1L]][[2L]]))
# Many will not install on oldest R versions
message("*** DONE requirements, now installing optional ***")
try(remotes::install_cran(c(other_pkgs, "rcmdcheck"), force=TRUE))
message("*** Installing fully optional packages ***")
try(install.packages(c(other_pkgs, "rcmdcheck")))
has_other_pkg = sapply(other_pkgs, requireNamespace, quietly=TRUE)
run_other = all(has_other_pkg)
Expand Down Expand Up @@ -128,9 +129,9 @@ jobs:
system2(Rbin, c("CMD", "build", ".", build_args))
dt_tar = list.files(pattern = "^data[.]table_.*[.]tar[.]gz$")
if (!length(dt_tar)) stop("Built tar.gz not found among: ", toString(list.files()))
res = system2(Rbin, c("CMD", "check", dt_tar[1L], check_args), stdout=TRUE, env=sprintf("%s=%s", names(env), env))
if (!is.null(attr(res, "status")) || grep("^Status:.*(ERROR|WARNING)", res)) {
writeLines(res)
res = system2(Rbin, c("CMD", "check", dt_tar[1L], check_args), stdout=TRUE, stderr=TRUE, env=sprintf("%s=%s", names(env), env))
if (!is.null(attr(res, "status")) || is.na(res) || grep("^Status:.*(ERROR|WARNING)", res)) {
writeLines(as.character(res))
stop("R CMD check failed")
}
}
Expand Down
1 change: 1 addition & 0 deletions inst/tests/other.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if (!all(loaded)) {
options(warning.length=8000)
stop(
"test.data.table('other.Rraw') failed to attach required package(s): ", toString(sort(names(loaded)[!loaded])), ".",
"\nHere's .libPaths():\n ", paste(.libPaths(), collapse="|"),
"\nHere's all installed packages:\n ", paste(sort(rownames(installed.packages())), collapse=","),
"\nHere's the search() path:\n ", paste(search(), collapse="->"),
"\nIf you can't install them and this is R CMD check, please set environment variable TEST_DATA_TABLE_WITH_OTHER_PACKAGES back to the default, false; it's currently ", Sys.getenv("TEST_DATA_TABLE_WITH_OTHER_PACKAGES", "<unset>"), ".")
Expand Down

0 comments on commit f339aa6

Please sign in to comment.