Skip to content
Prev 17957 / 21312 Next

[Bioc-devel] BiocCheck and version requirement

On Thu, Apr 8, 2021 at 11:22 AM Kasper Daniel Hansen
<kasperdanielhansen at gmail.com> wrote:
Yes, serialization format v3 was introduced in R 3.5.0.  If there are
R binary files with that version, then 'R CMD build' will check and
warning about this, and automatically inject an explicit Depends: R
(>= 3.5.0) in the built tarball. Example:

$ R CMD build teeny
...
* checking for empty or unneeded directories
  NB: this package now depends on R (>= 3.5.0)
  WARNING: Added dependency on R >= 3.5.0 because serialized objects
in  serialize/load version 3 cannot be read in older versions of R.
File(s) containing such objects: ?teeny/inst/pi.rds?
* building ?teeny_0.1.0.tar.gz?

But that's not a *check* error.  If you'd submit to CRAN, they would
not notice because it's fixed in the source tarball.  On Bioconductor,
you'd see it in the build logs, because that builds from the package
source folder.  I don't know if there are additional checks for this
in 'R CMD check' - could be - but I guess you would have to do some
tricks to circumvent 'R CMD build' in order to get a source tarball
without the dependency.

Note that if the R binary files are in serialization version 2, then
there is no such warning.  In other words, a package developer can
very well keep their package backward compatible with R (< 3.5.0) by
not updating/resaving/regenerating binary files in version 3.  To stay
with version 2, one can use, e.g. saveRDS(x, file, version=2).

/Henrik