On Wed, 10 Mar 2021 at 12:02, Jeroen Ooms <jeroeno...@gmail.com> wrote: > > On Wed, Mar 10, 2021 at 12:18 AM Iñaki Ucar <iu...@fedoraproject.org> wrote: > > > > On Tue, 9 Mar 2021 at 23:55, Jeroen Ooms <jeroeno...@gmail.com> wrote: > > > > > > On Tue, Mar 9, 2021 at 2:27 PM Iñaki Ucar <iu...@fedoraproject.org> wrote: > > > > > > > > On Tue, 9 Mar 2021 at 13:26, Jeroen Ooms <jeroeno...@gmail.com> wrote: > > > > > > > > > > When installing an R package from source on Fedora using the standard > > > > > R-core rpm, we always get a warning at the end because of a missing > > > > > css file /usr/share/doc/R/html/R.css: > > > > > > > > > > ** byte-compile and prepare package for lazy loading > > > > > ** help > > > > > *** installing help indices > > > > > Error in file.copy(file.path(R.home("doc"), "html", "R.css"), outman) > > > > > : > > > > > (converted from warning) problem copying /usr/share/doc/R/html/R.css > > > > > to > > > > > /usr/lib64/R/library/00LOCK-systemfonts/00new/systemfonts/html/R.css: > > > > > No such file or directory > > > > > > > > > > But when I try to install the missing file, yum says it is already > > > > > installed: > > > > > > > > > > yum install /usr/share/doc/R/html/R.css > > > > > ## Package R-core-4.0.3-1.fc32.x86_64 is already installed. > > > > > > > > > > However it does not actually exist. Perhaps the rpm could make a copy > > > > > or symlink from /usr/lib64/R/library/base/html/R.css > > > > > > > > I assume you are doing this in a docker image. That file is not > > > > installed because our base images have "tsflags=nodocs" set in > > > > /etc/dnf/dnf.conf. Unset this before installing R-core, or, even > > > > better, install packages with --no-docs. > > > > > > Perhaps --no-docs should then be the default if tsflags=nodocs? The > > > default behavior is unfortunate, because it makes install.packages() > > > fail even if the user is not even interested in documentation, and > > > people come up with all sorts of workarounds eg: > > > https://github.com/r-lib/devtools/issues/2084 > > > > install.packages doesn't fail. devtools does. I see: > > > > Warning in file.create(f.tg) : > > cannot create file '/usr/share/doc/R/html/packages.html', reason 'No > > such file or directory' > > Warning in utils::make.packages.html(.Library, docdir = R.home("doc")) : > > cannot update HTML package index > > > > The package is correctly installed and usable. > > Many systems (including devtools, and many others) are set more strict > such that installation warnings are turned into errors, to ensure > users or applications never ends up installing broken packages.
A warning is not an error. I would expect that R raises an error only when the package is really broken. Otherwise, there's no point in having warnings and errors. Users have been bitten quite a lot by this [1], and as a result, the remotes package (which devtools uses) recently stepped out from this odd default behaviour [2] (not yet released though). > Raising this warning by default for every install.packages() is really > unfortunate default behaviour, especially because it is evidently > unclear to users why this happens. About what is unclear to users, I refer again to [1]. But note that this is *not* default behaviour. It only happens in docker images, which have this special setting for a special use case, defined in order to minimize image sizes and enforced by the package manager. It has nothing to do with the R-core package: it just follows the official guidelines and marks documentation files as documentation. I could add some notes about docker in [3]. Note too that there's an easier way to install CRAN packages in Fedora [4]. [1] https://github.com/r-lib/remotes/issues/403 [2] https://github.com/r-lib/remotes/commit/5a546add30b4538d60d781bc2fa26cd33ccde092 [3] https://cran.r-project.org/bin/linux/fedora/ [4] https://cran.r-project.org/bin/linux/fedora/#additional-packages -- Iñaki Úcar _______________________________________________ R-SIG-Fedora mailing list R-SIG-Fedora@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-fedora