Skip to content

Commit

Permalink
tweak checks with _R_CHECK_DEPENDS_ONLY_
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@73997 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Jan 1, 2018
1 parent a5c7214 commit df67314
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
2 changes: 1 addition & 1 deletion doc/manual/R-admin.texi
Original file line number Diff line number Diff line change
Expand Up @@ -4819,7 +4819,7 @@ implement all of them for Fortran compilation: it also accepts most
PGI-style flags such as @option{-mp} for OpenMP. It currently produces
few diagnostics even with @option{-Wall -pedantic}.

@command{flang}'d Fortran runtime is compiled against OpenMP and it
@command{flang}'s Fortran runtime is compiled against OpenMP and it
seems this conflicts with using OpenMP in @R{}. So it may be necessary
to disable the latter by configuring using @option{--without-openmp}.

Expand Down
14 changes: 8 additions & 6 deletions doc/manual/R-ints.texi
Original file line number Diff line number Diff line change
Expand Up @@ -4000,14 +4000,16 @@ is available to those who first install recording to a log, then call

@item _R_CHECK_DEPENDS_ONLY_
@itemx _R_CHECK_SUGGESTS_ONLY_
If set to a true value, running examples, tests and vignettes is done
with @code{.libPaths()} containing just a temporary library directory
and @code{.Library}. The temporary library is populated by symbolic
If set to a true value, running examples, tests and
vignettes@footnote{but not re-building vignettes.} is done with
@code{.libPaths()} containing just a temporary library directory and
@code{.Library}. The temporary library is populated by symbolic
links@footnote{see the previous footnote.} to the installed copies of
all the Depends/Imports and (for the second only) Suggests packages
which are not in @code{.Library}. (As an exception, packages in a
@samp{VignetteBuilder} field are always made available.)
Default: false (but @env{_R_CHECK_SUGGESTS_ONLY_} is true for CRAN checks).
which are not in @code{.Library}. (As exceptions, packages in a
@samp{VignetteBuilder} field and test-suite managers in @samp{Suggests}
are always made available.) Default: false (but
@env{_R_CHECK_SUGGESTS_ONLY_} is true for CRAN checks).

@item _R_CHECK_NO_RECOMMENDED_
If set to a true value, augment the previous checks to make recommended
Expand Down
25 changes: 18 additions & 7 deletions src/library/tools/R/check.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ R_runR <- function(cmd = NULL, Ropts = "", env = "",

setRlibs <-
function(lib0 = "", pkgdir = ".", suggests = FALSE, libdir = NULL,
self = FALSE, self2 = TRUE, quote = FALSE, LinkingTo = FALSE)
self = FALSE, self2 = TRUE, quote = FALSE, LinkingTo = FALSE,
tests = FALSE)
{
WINDOWS <- .Platform$OS.type == "windows"
useJunctions <- WINDOWS && !nzchar(Sys.getenv("R_WIN_NO_JUNCTIONS"))
Expand Down Expand Up @@ -153,11 +154,14 @@ setRlibs <-
else {
## we always need to be able to recognise 'vignettes'
VB <- unname(pi$DESCRIPTION["VignetteBuilder"])
if(is.na(VB)) character()
sug <- if(is.na(VB)) character()
else {
VB <- unlist(strsplit(VB, ","))
unique(gsub('[[:space:]]', '', VB))
}
if(tests) ## we need the test suite package available
c(sug, intersect(names(pi$Suggests), c("RUnit", "testthat")))
else sug
}
deps <- unique(c(names(pi$Depends), names(pi$Imports),
if(LinkingTo) names(pi$LinkingTo),
Expand Down Expand Up @@ -2758,12 +2762,12 @@ setRlibs <-
msg <- if (nBad) {
if(haveObjs)
c("Compiled code should not call entry points which",
"might terminate R nor write to stdout/stderr instead",
"of to the console, nor the system RNG.\n")
"might terminate R nor write to stdout/stderr instead of",
"to the console, nor use Fortran I/O nor system RNGs.\n")
else
c("Compiled code should not call entry points which",
"might terminate R nor write to stdout/stderr instead",
"of to the console, nor the system RNG.",
"might terminate R nor write to stdout/stderr instead of",
"to the console, nor use Fortran I/O nor system RNGs.",
"The detected symbols are linked",
"into the code but might come from libraries",
"and not actually be called.\n")
Expand Down Expand Up @@ -3278,7 +3282,7 @@ setRlibs <-
if(nzchar(arch)) R_opts4 else R_opts2,
env = c("LANGUAGE=en",
"_R_CHECK_INTERNALS2_=1",
if(nzchar(arch)) env0, jitstr, elibs),
if(nzchar(arch)) env0, jitstr, elibs_tests),
stdout = "", stderr = "", arch = arch,
timeout = tlim)
t2 <- proc.time()
Expand Down Expand Up @@ -5534,6 +5538,13 @@ setRlibs <-
setRlibs(pkgdir = pkgdir, libdir = libdir, suggests = TRUE)
else character()

elibs_tests <- if(is_base_pkg) character()
else if(R_check_depends_only)
setRlibs(pkgdir = pkgdir, libdir = libdir, tests = TRUE)
else if(R_check_suggests_only)
setRlibs(pkgdir = pkgdir, libdir = libdir, suggests = TRUE)
else character()

setwd(startdir)
check_pkg(pkgdir, pkgname, pkgoutdir, startdir, libdir, desc,
is_base_pkg, is_rec_pkg, thispkg_subdirs, extra_arch)
Expand Down

0 comments on commit df67314

Please sign in to comment.