-
Notifications
You must be signed in to change notification settings - Fork 33
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
With Rtools 3.x pkgbuild::rtools_path() returns "c:/Rtools/usr/bin" instead of "c:/Rtools/bin" #96
Comments
Here is a reprex that reproduce this issue when Rtools is found from R CMD config CC pkgbuild::has_rtools(TRUE)
#> Scanning R CMD config CC...
#> cc_path: C:/Rtools/mingw_64/bin/gcc
#> install_path: C:/Rtools
#> Found compatible gcc from R CMD config CC
#> [1] TRUE
pkgbuild::rtools_path()
#> [1] "C:/Rtools/usr/bin"
sessioninfo::platform_info()
#> setting value
#> version R version 3.6.3 (2020-02-29)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate French_France.1252
#> ctype French_France.1252
#> tz Europe/Paris
#> date 2020-06-07
packageVersion("pkgbuild")
#> [1] '1.0.8' It was correct in previous 1.0.7 version pkgbuild::has_rtools(TRUE)
#> Scanning R CMD config CC...
#> cc_path: C:/Rtools/mingw_64/bin/gcc
#> install_path: C:/Rtools
#> Found compatible gcc from R CMD config CC
#> [1] TRUE
pkgbuild::rtools_path()
#> [1] "C:/Rtools/bin"
sessioninfo::platform_info()
#> setting value
#> version R version 3.6.3 (2020-02-29)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate French_France.1252
#> ctype French_France.1252
#> tz Europe/Paris
#> date 2020-06-07
packageVersion("pkgbuild")
#> [1] '1.0.7' I think the issue is if rtools is found by using cc_path then version is set to Line 23 in 609321c
but rtools metadata for custom is now usr/bin Lines 71 to 75 in 609321c
Changes happened in 198621e Hope it helps. |
If you need a workaround the best way I think is to make sure that Rtools adds its information to the windows registry during the installation. |
@jimhester I found a workaround that doesn't require this. I just wanted to make you guys were aware of the issue in case other package developers run into the same problem. |
Even if Rtools has its information in registry or is set in the PATH, the version from scanning the config is used. The looking order in
As a reprex, the three searches will return # searched first and selected - the resulting version is set to custom
pkgbuild:::scan_config_for_rtools(TRUE)
#> Scanning R CMD config CC...
#> cc_path: C:/Rtools/mingw_64/bin/gcc
#> install_path: C:/Rtools
#> $version
#> [1] "custom"
#>
#> $path
#> [1] "C:/Rtools"
#>
#> $valid_binpref
#> [1] TRUE
#>
#> attr(,"class")
#> [1] "rtools"
# searched second and third but not used
pkgbuild:::scan_path_for_rtools(TRUE)
#> Scanning path...
#> ls: C:\Rtools\bin\ls.exe
#> gcc_path:
#> VERSION.txt
#> Rtools version 3.5.0.4
#> Version: 3.5
#> $version
#> [1] "3.5"
#>
#> $path
#> [1] "C:/Rtools"
#>
#> attr(,"class")
#> [1] "rtools"
pkgbuild:::scan_registry_for_rtools(TRUE)
#> Scanning registry...
#> Found C:/Rtools for 3.5
#> [[1]]
#> $version
#> [1] "3.5"
#>
#> $path
#> [1] "C:/Rtools"
#>
#> attr(,"class")
#> [1] "rtools" The one found first is by This means that version Why not try to do like when scanning in PATH, and try to determine the rtools version from the Lines 20 to 24 in 198621e
using version <- installed_version(install_path, debug = debug) Is there a specific reason to always set the version to custom when rtools is found by I may have missed something though... |
Yes, because the CRAN build machines use |
I understand. But, as |
It's all in the title. I'm guessing the extra "usr" was added for compatibility with Rtools 4.x, but that doesn't correspond to the organization of the Rtools 3.x folder.
The text was updated successfully, but these errors were encountered: