On Dec 11, 2022, at 3:45 AM, Ivan Krylov <krylov.r00t at gmail.com> wrote:
On Sat, 10 Dec 2022 14:00:22 -0800
Roy Mendelssohn - NOAA Federal via R-package-devel
<r-package-devel at r-project.org> wrote:
CRAN has sent me a notice about the following:
https://www.stats.ox.ac.uk/pub/bdr/donttest/rerddapXtracto.out
I can not reproduce it. I test on my Mac, the cache space is
properly handled (by a package outside mine). Same with Debian on
r-hub. I installed Fedora on a virtual machine, no problem (it is
assigned a space in /tmp).
I've trace()d rerddap:::gen_key to notify me when a file with the cache
key of 4f8f83808465a7f7619285e9871747af is being downloaded. Since
digest::digest defaults to serialize = TRUE, this should only work with
R-to-be-4.3.0 (I compiled R-devel r83400, same as in the failed check):
library(rerddapXtracto)
trace(
rerddap:::gen_key,
quote({
if(digest::digest(ky) == '4f8f83808465a7f7619285e9871747af') {
cat('\n\nFound a match\n\n')
str(url); str(args); print(ky); str(digest::digest(ky))
message('\n\nFound a match\n\n')
}
}),
at = 3
)
example(rxtracto)
example(rxtracto_3D)
example(rxtractogon)
Surprisingly, there were no hits. I also tried copying and pasting all
code from the vignette and even uncommenting the code marked as
\dontrun{}, also with no results.
The code that actually creates these files lives in the rerddap
package. The page at
<https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-gcc>
says that packages are checked in parallel. What if an unlucky reverse
dependency of rerddap was being checked at the same time as your
package, making rerddapXtracto get its NOTE?
I cleaned ~/.cache/R, put the rerddap source package in a directory and
ran:
(res <- tools::check_packages_in_dir(
'.', check_args = '--run-donttest', reverse = list(recursive = TRUE),
check_env = c(
"_R_CHECK_DONTTEST_EXAMPLES_=true",
"_R_CHECK_THINGS_IN_OTHER_DIRS_=true"
)
))
I got a NOTE for plotdap!
* checking for new files in some other directories ... NOTE
Found the following files/directories:
?~/.cache/R? ?~/.cache/R/rerddap?
?~/.cache/R/rerddap/1b43b4335f06b318b914ba2cc2f88872.nc?
?~/.cache/R/rerddap/4f8f83808465a7f7619285e9871747af.nc?
?~/.cache/R/rerddap/8cb244e059b86865b7933a3d9b72fe16.csv?
Looking at the examples for plotdap::add_griddap and
plotdap::add_tabledap, I think that they may be responsible for the
NOTE, because there's no pre-example cache setup and teardown. I also
finally got a match from my tracing code by running
example(add_griddap).
There's more than one way to do it right; my favourite would be to wrap
the pre-example code and post-example code in \dontshow{}, changing the
cache settings in the first block and restoring them in the second one.
Everywhere else I would use on.exit(), but examples are special in
their relationship with autoprinting and crashing there being
disallowed, making this approach feasible.
--
Best regards,
Ivan