From c@@rd|@g@bor @end|ng |rom gm@||@com  Thu Mar  7 23:57:14 2019
From: c@@rd|@g@bor @end|ng |rom gm@||@com (=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=)
Date: Thu, 7 Mar 2019 22:57:14 +0000
Subject: [Rd] package installation needs the file utility on Unix
Message-ID: <CABtg=Kneq7Uh6_wyzj9OPTgLPpCYJDqjsawCabzgOkc3x89-OA@mail.gmail.com>

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



[Rd] package installation needs the file utility on Unix
=?UTF-8?B?R8OhYm9yIENzw6FyZGk=?=