actions icon indicating copy to clipboard operation
actions copied to clipboard

Rtools 42 adds MinGW to the path

Open dfalbel opened this issue 2 years ago • 2 comments

It seems that when installing rtools 42 the mingw compiler is added to the PATH even if setting the windows-path-include-mingw variable. This contradicts what's documented here:

This argument is now defunct on Rtools40 and later, which never add the mingw directory to the path.

I wonder if we could re-add support for that flag for rtools 42. In my use case, having mingw in the path causes problems when compiling other libraries.

Here's a link showing that mingw is in the PATH: https://github.com/dfalbel/testrtools/runs/6798819503?check_suite_focus=true#step:4:12

FWIW the Rtools42 documentation states that one of the differences compared to rtools40 is that R adds the compiler toolchain to the PATH (??) when installed:

When R is installed from the binary installer, PATH to the compiler toolchain and build tools is set automatically (by R) based on the default location, information in the registry, or the R_CUSTOM_TOOLS_PATH variable.

dfalbel avatar Jun 08 '22 17:06 dfalbel

Here's a link showing that mingw is in the PATH: dfalbel/testrtools/runs/6798819503?check_suite_focus=true#step:4:12

Which path component do you mean specifically?

gaborcsardi avatar Jun 08 '22 19:06 gaborcsardi

I mean this: /x86_64-w64-mingw32.static.posix/bin. Edit: It's actually not truncated, but it seems rtools is installed in /, so the added path is shown in this line

In comparison, you won't have it with rtools40

I'm almost sure this comes from Rtools because this is what I have on my windows machine:

C:\rtools42\x86_64-w64-mingw32.static.posix

dfalbel avatar Jun 08 '22 19:06 dfalbel

I don't want to bring back windows-path-include-mingw for rtools42, because for rtools40 the right thing is not to update the path, even if this now defunct parameter is set to true. So how about having a new option called windows-path-include-rtools which would tell setup-r not to add any rtools* directories to the path? Would that work for you?

Setting this new parameter to false would avoid adding these directories:

rtools42

C:\rtools42\x86_64-w64-mingw32.static.posix\bin
C:\rtools42\usr\bin

rtools40

C:\rtools40\ucrt64\bin
C:\rtools40\usr\bin

rtools3x

C:\Rtools\mingw_64\bin
C:\Rtools\bin

@dfalbel does this sound ok?

gaborcsardi avatar Oct 20 '22 08:10 gaborcsardi

Yes, this would work great for me!

dfalbel avatar Oct 20 '22 10:10 dfalbel

Seems to work well, will be in @v2 soon: https://github.com/gaborcsardi/testrtools/actions/runs/3289868195

gaborcsardi avatar Oct 20 '22 13:10 gaborcsardi

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

github-actions[bot] avatar Nov 04 '22 13:11 github-actions[bot]