-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Hi Gabor,
a number of packages are failing their checks on my system, claiming
that I don't have tools necessary to compile a package. This includes
checkhelper. Compilation of vol2birdR fails because it chooses incorrect
HDF5 flags, for the same underlying reason.
I indeed do have such tools. The problem is that pkgbuild assumes that
one needs to have Rtools installed on Windows from the .exe installer.
But Rtools can also be installed from a tarball, with say a separate
Msys2 installation for build tools: this is documented as a valid,
normal way to install Rtools. It is used e.g. in some github actions. So
the detection is wrong. My work-around is to create an empty
c:\rtools43\usr\bin directory, but it really shouldn't be needed.
In addition to that, one even doesn't need to have Rtools to build
packages. I think that it is not good to constrain R packages to Rtools.
This is normally not needed, makes testing and development of Rtools
harder, and would make it harder to use any custom/experimental
toolchains/tools (such as e.g. Msys2). If packages really need to depend
on some specific details (and only very few should need to) of the build
system, they should rather check for specific things in the build
system, in the same spirit as say autoconfig or cmake does. See that
e.g. the sources of R itself try to be prepared for this, allowing
"custom" tools, etc.
I don't think one should ever ask whether specifically Rtools is
installed, or which version (rather than say whether a C compiler,
Fortran compiler, or whether a simple R package can be built from
source). After all, I assume this is how you do it on Unix?
The current versions of Rtools have file ".version", which you can find
relative to $(R_TOOLS_SOFT), regardless of whether Rtools has been
installed from exe or tarball, and it gives you also the exact version -
e.g. Rtools 4.3 will be updated soon and a number of packages in it as
well. But this really shouldn't be used in packages to conditionalize on.
Best
Tomas