Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for msys2 and rtools40 #86

Open
wants to merge 2 commits into
base: master
from

Conversation

@jeroen
Copy link
Member

commented Sep 1, 2019

This adds support for rtools40 / msys2 build environments:

  • Use RTOOLS40_HOME variable (set by the rtools40 installer) to detect rtools40.
  • Understand msys2 unix paths such as /mingw64/bin/gcc

Once the toolchain is in production we can further tweak this, but for now this should at least prevent check errors.

Fixes #40, closes #44.

jeroen added 2 commits Sep 1, 2019
Make finding executable more robust.
Including support for msys2 unix paths.

@jeroen jeroen requested review from jimhester and hadley Sep 1, 2019

@jimhester

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

Is there a reason we can't use #44... All it needs is the installer to include VERSION.txt and Rtools.txt like every other version of Rtools.

@jeroen

This comment has been minimized.

Copy link
Member Author

commented Sep 3, 2019

Is there a reason we can't use #44... All it needs is the installer to include VERSION.txt and Rtools.txt like every other version of Rtools.

I'm trying to move towards a more standard toolchain bundle to make future maintenance easier, and allow users to use standard msys2 compilers if they want to.

Unix paths make it possible to include the proper -I include flags relative to the root of the rtools installation, which is needed for certain C/C++ libraries.

I don't understand why pkgbuild need to use undocumented information from VERSION.txt and Rtools.txt and registry keys in the first place. When R compiles a package it simply uses at CC and CXX, etc. If that path exists, it works.

@jimhester

This comment has been minimized.

Copy link
Member

commented Sep 4, 2019

Using registry keys is pretty standard for most windows installers. Relying on undocumented environment variables is decidedly not. Are you planning on having a new environment variable for every release of Rtools? That is going to get cumbersome pretty quickly.

Also VERSION.txt and Rtools.txt are not undocumented, they are both mentioned including the contents they contain and linked in the Rtools news.

pkgbuild does thes same thing, the first thing it checks is R CMD CC

pkgbuild/R/rtools.R

Lines 32 to 35 in 95d47b9

from_config <- scan_config_for_rtools(debug)
if (is_compatible(from_config)) {
if (debug)
cat("Found compatible gcc from R CMD config CC\n")
,

but for many users that is not changed from the default, Rtools won't be on their PATH and we need to fall back to the registry to find where the appropriate version of Rtools is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.