[Rd] R CMD INSTALL warnings with conflicting imports

From: Milan Bouchet-Valat <nalimilan_at_club.fr>
Date: Sat, 15 Dec 2012 17:59:56 +0100


This is an issue we encountered when trying to move the Rcmdr package from the Depends to the Imports field for RcmrPlugin.* plug-in packages.

Rcmdr overrides a few functions from the tcltk package for convenience. With the current approach, both Rcmdr and tcltk are in the Depends field, and no warning is printed. When moving them to Imports, and adding an import(tcltk, Rcmdr) directive to NAMESPACE, we get this printed *twice* when running R CMD INSTALL:
> Warning messages:
> 1: replacing previous import ‘tclvalue’ when loading ‘Rcmdr’
> 2: replacing previous import ‘tkfocus’ when loading ‘Rcmdr’
> 3: replacing previous import ‘ttkentry’ when loading ‘Rcmdr’
> 4: replacing previous import ‘ttkframe’ when loading ‘Rcmdr’
> 5: replacing previous import ‘ttkradiobutton’ when loading ‘Rcmdr’
> 6: replacing previous import ‘ttkscrollbar’ when loading ‘Rcmdr’

The solution we found is to use importFrom(tcltk, ...) to only import tcltk fonctions that do not conflict with those exported by Rcmdr. This works, but is slightly more painful than the old way, since a typical plugin uses quite a few tcltk functions.

So I wonder what's the rationale behind the warning. Package maintainers can perfectly control which package's conflicting functions will override the other's, by specifying the right order in the import() directive. If they get the order wrong, the failure will be obvious to them. It does not seem useful to print warnings when installing packages, because it's not intended at users. If anything, these warnings would better be reported by R CMD check only.

If the current situation is judged correct, the solution I describe works for us. I'd just want to be sure I'm not missing something.

Thanks for your work

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat 15 Dec 2012 - 17:09:43 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 15 Dec 2012 - 19:32:58 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive