Thanks for the tip.
pkgbuild::has_rtools gives me
> pkgbuild::has_rtools
function (debug = FALSE)
{
if (!debug && rtools_path_is_set())
return(!identical(rtools_path(), ""))
if (!is_windows())
return(FALSE)
from_config <- scan_config_for_rtools(debug)
if (is_compatible(from_config)) {
if (debug)
cat("Found compatible gcc from R CMD config CC\n")
rtools_path_set(from_config)
return(TRUE)
}
from_path <- scan_path_for_rtools(debug)
if (is_compatible(from_path)) {
if (debug)
cat("Found compatible gcc on path\n")
rtools_path_set(from_path)
return(TRUE)
}
if (!is.null(from_path)) {
if (is.null(from_path$version)) {
if (debug)
cat("gcc and ls on path, assuming set up is correct\n")
return(TRUE)
}
else {
message("WARNING: Rtools ", from_path$version, " found on the path",
" at ", from_path$path, " is not compatible with R ",
getRversion(), ".\n\n", "Please download and install ",
rtools_needed(), " from ", rtools_url, ", remove the incompatible version from your PATH.")
return(invisible(FALSE))
}
}
registry_candidates <- scan_registry_for_rtools(debug)
if (length(registry_candidates) == 0) {
message("WARNING: Rtools is required to build R packages, but is not ",
"currently installed.\n\n", "Please download and install ",
rtools_needed(), " from ", rtools_url, ".")
return(invisible(FALSE))
}
from_registry <- Find(is_compatible, registry_candidates,
right = TRUE)
if (is.null(from_registry)) {
versions <- vapply(registry_candidates, function(x) x$version,
character(1))
message("WARNING: Rtools is required to build R packages, but no version ",
"of Rtools compatible with R ", getRversion(), " was found. ",
"(Only the following incompatible version(s) of Rtools were found:",
paste(versions, collapse = ","), ")\n\n", "Please download and install ",
rtools_needed(), " from ", rtools_url, ".")
return(invisible(FALSE))
}
installed_ver <- installed_version(from_registry$path, debug = debug)
if (is.null(installed_ver)) {
message("WARNING: Rtools is required to build R packages, but the ",
"version of Rtools previously installed in ", from_registry$path,
" has been deleted.\n\n", "Please download and install ",
rtools_needed(), " from ", rtools_url, ".")
return(invisible(FALSE))
}
if (installed_ver != from_registry$version) {
message("WARNING: Rtools is required to build R packages, but no version ",
"of Rtools compatible with R ", getRversion(), " was found. ",
"Rtools ", from_registry$version, " was previously installed in ",
from_registry$path, " but now that directory contains Rtools ",
installed_ver, ".\n\n", "Please download and install ",
rtools_needed(), " from ", rtools_url, ".")
return(invisible(FALSE))
}
rtools_path_set(from_registry)
TRUE
}
I can't seem to locate where the dialog is launched. The text in the dialog / modal says "Building R package from source requires installation of additional build tools." and a google search on this string doesn't seem to lead me anywhere helpful.
I've looked inside scan_config_for_rtools and scan_registry_for_rtools too, they don't seem to do what I'm looking for.
Any thoughts?