From tom@@@k@||ber@ @end|ng |rom gm@||@com  Fri Mar  8 14:44:41 2019
From: tom@@@k@||ber@ @end|ng |rom gm@||@com (Tomas Kalibera)
Date: Fri, 8 Mar 2019 14:44:41 +0100
Subject: [Rd] package installation needs the file utility on Unix
In-Reply-To: <CABtg=Kneq7Uh6_wyzj9OPTgLPpCYJDqjsawCabzgOkc3x89-OA@mail.gmail.com>
References: <CABtg=Kneq7Uh6_wyzj9OPTgLPpCYJDqjsawCabzgOkc3x89-OA@mail.gmail.com>
Message-ID: <e8cf95d1-1393-7199-7222-533f22eb6baa@gmail.com>

Well, this only applies to source installs of packages that have some 
files with the special extension, so on systems where a compiler 
toolchain needs to be installed, so the image cannot be really tiny, 
anyway. But ok, I've made stage install use "file" only when it is 
available. When it isn't and some file with extension sl, so, dylib or 
dll in the package installation is not in fact a shared object, one will 
get a number of error messages from the respective tools, but the 
installation passes. Currently on Linux this is the case of RcppParallel 
and FastRWeb.

Tomas

On 3/7/19 11:57 PM, G?bor Cs?rdi wrote:
> The new staged package installation shells out to the 'file' utility
> on Unix systems:
> https://github.com/wch/r-source/blob/31ee14c620eb1b939acd322f3b5617f998aab8e8/src/library/tools/R/install.R#L578
>
> Although 'file' is usually present on most Unix systems, it might be
> missing from small Docker containers, where the aim is to make the
> container as small possible. The magic file of 'file' is about 5MB, so
> that is significant in this case.
>
> R uses 'file' to decide if a .so, .dll, etc. file is indeed a shared
> library, and (as I understand) if it is, it then goes on to try to fix
> the hardcoded installation path in it, using an os specific tool.
>
> As the second part needs to handle errors anyway, I wonder if it would
> make sense to skip the 'file' call completely, after all it is quite
> unlikely that a .dll or .so, etc. file is _not_ a shared library, and
> even if it is not, the errors will be caught later.
>
> Thanks, Gabor
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] package installation needs the file utility on Unix
Tomas Kalibera