Skip to content

R CMD build then check fails on R-devel due to serialization version

1 message · Tomas Kalibera

#
An update on the adoption of serialization format 3:

R 3.5.0 (released yesterday) supports serialization format 3, but the 
default is still format 2 to make the transition easier.

It is expected that the default will soon be changed to 3 in R-devel. 
Packages thus must not depend on what is the default serialization 
format (several packages used to have hard-coded assumptions about that 
the format was 2).

As of R 3.5.0, one can test the effect of the expected change to 
serialization format 3 by setting environment variables 
"R_DEFAULT_SAVE_VERSION=3" and "R_DEFAULT_SERIALIZE_VERSION=3". One can 
also set these to 2 to ensure the default format is 2 even after the 
expected change.

Packages that include serialization files in format 3 in their sources 
cannot be used by older versions of R than 3.5.0, so they must declare a 
dependency on R>=3.5.0. Package authors need to make sure of this, but 
they only need to worry if they added serialization files explicitly - 
package meta-data will still be saved in format 2 automatically. Note 
that the current release, R 3.5.0, has the default at 2, so no extra 
precaution is needed when creating such serialize files using the 
current release 3.5.0, but authors will have to be careful when creating 
such files using even newer versions of R.

As a safeguard, "R CMD build" automatically adds a dependency on 
R>=3.5.0 when it detects a serialization file in format 3, but package 
authors should not depend on this, because the detection is not and can 
not be fully precise. As another safeguard, "R CMD check --as-cran" will 
reject packages with serialization format 3 unless they have a 
dependency on at least R>=3.5.0.

This should give enough options also for testing frameworks based on 
running build&"check --as-cran" using the same version of R (most 
packages don't include serialize files at all, R CMD build would 
otherwise add dependency on R>=3.5.0 to make "R CMD check --as-cran" 
happy, one could also set R_DEFAULT_SAVE_VERSION=2 and 
R_DEFAULT_SERIALIZE_VERSION=2). These frameworks could also be tested 
before the change by running with R_DEFAULT_SAVE_VERSION=3 and 
R_DEFAULT_SERIALIZE_VERSION=3.

Best
Tomas
On 01/13/2018 01:35 AM, Tomas Kalibera wrote: