Not needed on recent Windows?

Open
#199 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
build-system

Research direction

Start by tracing pkgbuild's Windows tool-detection logic and its existing checks for Rtools and build tools. Compare the behavior for tarball installations, separate MSYS2 toolchains, and custom compilers. Done means package checks no longer require an executable Rtools installation when the necessary build tools are available.

Written by the indexing model from the issue text.

Description

upkeep

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

Dominant language
R
Stars
77
Forks
43
Avg merge
17m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/pkgbuild

All issues in r-lib/pkgbuild

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.