[Rd] Upgrading a package to which other packages are LinkingTo

Kirill Müller kirill.mueller at ivt.baug.ethz.ch
Fri Dec 16 11:35:08 CET 2016


Hi


I'd like to suggest to make R more informative when a user updates a 
package A where there's at least one package B that has "LinkingTo: A" 
in its description.

To illustrate the problem, assume package A is updated so that its C/C++ 
header interface (in inst/include) is changed. For package B to pick up 
these changes, we need to reinstall package A. In extreme cases, if B 
also imports A and uses functions from A's shared library, failure to 
reinstall B may lead to all sorts of undefined behavior.

I've stumbled over this recently for A = Rcpp 0.12.8 and B = dplyr 0.5.0 
[1], with a bug fix available in Rcpp 0.12.8.2. Simply upgrading Rcpp to 
0.12.8.2 wasn't enough to propagate the bug fix to dplyr; we need to 
reinstall dplyr 0.5.0 too.

I've prepared an example with R-devel r71799. The initial configuration 
[2] is Rcpp 0.12.8 and dplyr 0.5.0. There is no warning from R after 
upgrading Rcpp to 0.12.8.2 [3], and no warning when loading the (now 
"broken") dplyr 0.5.0 linked against Rcpp 0.12.8 but importing Rcpp 
0.12.8.2 [4].

As a remedy, I'd like to suggest that upgrading Rcpp gives a warning 
about installed packages that are LinkingTo it [3], and that loading 
dplyr gives a warning that it has been built against a different version 
of Rcpp [4], just like the warning when packages are built against a 
different version of R.

Thanks.


Best regards

Kirill


[1] https://github.com/hadley/dplyr/issues/2308#issuecomment-267495075
[2] https://travis-ci.org/krlmlr/pkg.upgrade.test#L589-L593
[3] https://travis-ci.org/krlmlr/pkg.upgrade.test#L619-L645
[4] https://travis-ci.org/krlmlr/pkg.upgrade.test#L671-L703



More information about the R-devel mailing list