rdatsci / rtcl

R tools for the command line
65 stars 3 forks source link

rinstall local package under windows #60

Open jakob-r opened 5 years ago

jakob-r commented 5 years ago

Here is the traceback() after rinstall():

> rinstall()
> traceback()
23: doWithOneRestart(return(expr), restart)
22: withOneRestart(expr, restarts[[1L]])
21: withRestarts({
        .Internal(.signalCondition(simpleWarning(msg, call), msg, 
            call))
        .Internal(.dfltWarn(msg, call))
    }, muffleWarning = function() NULL)
20: .signalSimpleWarning("cannot remove prior installation of package 'testthat'", 
        quote(NULL))
19: warning(gettextf("cannot remove prior installation of package %s", 
        sQuote(pkgname)), domain = NA, call. = FALSE, immediate. = TRUE)
18: unpackPkgZip(foundpkgs[okp, 2L], foundpkgs[okp, 1L], lib, libs_only, 
        lock)
17: .install.winbinary(pkgs = bins, lib = lib, contriburl = contrib.url(repos, 
        type2), method = method, available = av2, destdir = destdir, 
        dependencies = NULL, libs_only = libs_only, quiet = quiet, 
        ...)
16: i.p(...)
15: force(code)
14: force(code)
13: with_envvar(c(R_PROFILE_USER = temp_rprofile), {
        force(code)
    })
12: with_rprofile_user("options(warn = 2)", i.p(...))
11: force(code)
10: with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
        i.p(...)))
9: force(code)
8: with_envvar(c(R_LIBS = lib, R_LIBS_USER = lib, R_LIBS_SITE = lib, 
       RGL_USE_NULL = "TRUE"), if (should_error_for_warnings()) {
       with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
           i.p(...)))
   } else {
       i.p(...)
   })
7: (function (...) 
   {
       lib <- paste(.libPaths(), collapse = .Platform$path.sep)
       if (!is_standalone() && has_package("crancache") && has_package("callr")) {
           i.p <- "crancache" %::% "install_packages"
       }
       else {
           i.p <- utils::install.packages
       }
       with_envvar(c(R_LIBS = lib, R_LIBS_USER = lib, R_LIBS_SITE = lib, 
           RGL_USE_NULL = "TRUE"), if (should_error_for_warnings()) {
           with_options(list(warn = 2), with_rprofile_user("options(warn = 2)", 
               i.p(...)))
       }
       else {
           i.p(...)
       })
   })("testthat", repos = c(CRAN = "https://cran.wu.ac.at/"), type = "both", 
       dependencies = NA, quiet = FALSE, lib = "C:/Users/surmannd/Documents/RPackages")
6: do.call(safe_install_packages, c(list(packages, repos = repos, 
       type = type, dependencies = dependencies, quiet = quiet), 
       args))
5: install_packages(object$package[object$is_cran & behind], repos = r$repos, 
       type = r$pkg_type, dependencies = dependencies, quiet = quiet, 
       ...)
4: update.package_deps(packages, dependencies = dep_deps, quiet = quiet, 
       upgrade = upgrade, build = build, build_opts = build_opts, 
       ...)
3: update(packages, dependencies = dep_deps, quiet = quiet, upgrade = upgrade, 
       build = build, build_opts = build_opts, ...)
2: remotes::install_deps(pkgdir = pkgdir, dependencies = TRUE, lib = getLibraryPath())
1: rmake()

Probably it is a path issue, but I don't think so. The current working path doesn't contain any spaces or special characters.

Originally posted by @surmann in https://github.com/rdatsci/rt/issues/57#issuecomment-486141558