Skip to content
Prev 6953 / 12125 Next

[R-pkg-devel] Passing CRAN checks for a package linking to a system library on CRAN machines

On 5/13/21 7:06 AM, SN248 wrote:
I think the best way for maintenance and end users is when the libraries 
are part of common software distributions R is used with on each 
platforms, which are also installed on CRAN machines. For Linux these 
are popular distributions including Debian, Ubuntu, Fedora. For Windows 
this is customized msys2 (rtools) and customized mxe. For macOS this is 
a custom distribution ("recipes").

So, if your library is already present in those distributions, but not 
installed on some of the CRAN machines, I'd simply ask for it to be 
installed - the installation is trivial in that case, this is what the 
distributions are for.

If the library is not present in those distributions, the next best I 
think is to contribute it to them. In case of Windows, ideally 
contribute also to the upstream vanilla distributions, not just to the 
customized versions for R. This would allow most people to benefit from 
your contribution, and the additional burden on CRAN maintainers (who 
have to deal with many thousands of packages) would be minimized.

If all that failed, and the license allows, one can include the source 
code of the library into the package, but that creates burden on users 
as well as maintainers (of the package, but also the repository). It may 
create confusion about the configuration due to duplication between 
packages. It creates burden for repository maintainers. It takes 
additional time on installation (particularly some libraries heavily 
using C++ take forever to build, and repository maintainers do that very 
often).

Downloading pre-compiled binaries (static libraries) at installation 
time is the worst option in my view. It is non-transparent, 
non-repeatable, and the binaries may be incompatible (e.g. on Windows 
all object files have to be built for the same C runtime). It makes 
maintenance of R much harder, currently the transition from MSVCRT to 
UCRT on Windows.

Best
Tomas