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

Rtools 42 adds MinGW to the path #574

Closed
dfalbel opened this issue Jun 8, 2022 · 6 comments
Closed

Rtools 42 adds MinGW to the path #574

dfalbel opened this issue Jun 8, 2022 · 6 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@dfalbel
Copy link
Contributor

dfalbel commented Jun 8, 2022

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 dfalbel added the bug an unexpected problem or unintended behavior label Jun 8, 2022
@gaborcsardi
Copy link
Member

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?

@dfalbel
Copy link
Contributor Author

dfalbel commented Jun 8, 2022

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

@gaborcsardi
Copy link
Member

gaborcsardi commented Oct 20, 2022

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?

@dfalbel
Copy link
Contributor Author

dfalbel commented Oct 20, 2022

Yes, this would work great for me!

@gaborcsardi
Copy link
Member

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

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

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 github-actions bot locked as resolved and limited conversation to collaborators Nov 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants