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

Dependencies install to the wrong place #411

Closed
kenahoo opened this issue Jul 29, 2019 · 5 comments
Closed

Dependencies install to the wrong place #411

kenahoo opened this issue Jul 29, 2019 · 5 comments
Labels
bug

Comments

@kenahoo
Copy link
Contributor

kenahoo commented Jul 29, 2019

When doing remotes::install_version(pkg, ver, lib=location), the package pkg will get installed to the correct location location, but any dependencies will not.

This is because remotes::install doesn't pass along ... to the install_deps() call:

> packageVersion('remotes')
[1] '2.1.0'
> remotes:::install
function (pkgdir, dependencies, quiet, build, build_opts, build_manual, 
    build_vignettes, upgrade, repos, type, ...) 
{
    warn_for_potential_errors()
    if (file.exists(file.path(pkgdir, "src"))) {
        if (has_package("pkgbuild")) {
            pkgbuild::local_build_tools(required = TRUE)
        }
        else if (!has_devel()) {
            missing_devel_warning(pkgdir)
        }
    }
    pkg_name <- load_pkg_description(pkgdir)$package
    if (is_root_install()) 
        on.exit(exit_from_root_install(), add = TRUE)
    if (check_for_circular_dependencies(pkgdir, quiet)) {
        return(invisible(pkg_name))
    }
    install_deps(pkgdir, dependencies = dependencies, quiet = quiet, 
        build = build, build_opts = build_opts, build_manual = build_manual, 
        build_vignettes = build_vignettes, upgrade = upgrade, 
        repos = repos, type = type)
    if (isTRUE(build)) {
        dir <- tempfile()
        dir.create(dir)
        on.exit(unlink(dir), add = TRUE)
        pkgdir <- safe_build_package(pkgdir, build_opts, build_manual, 
            build_vignettes, dir, quiet)
    }
    safe_install_packages(pkgdir, repos = NULL, quiet = quiet, 
        type = "source", ...)
    invisible(pkg_name)
}
<bytecode: 0x1fd4020>
<environment: namespace:remotes>
@kenahoo
Copy link
Contributor Author

kenahoo commented Jul 29, 2019

Also - I assume this affects more functions than just install_version, since it looks like a problem with the install() workhorse function, right? Would affect all the install_* functions, if I'm not mistaken.

@tannerntannern
Copy link

tannerntannern commented Jul 31, 2019

I'm also experiencing this issue. It's quite a problem because I need to install some packages to an external directory to zip them up and use them on another platform, but the dependencies all go to the default library directory, which means I have to manually reinstall those dependencies in the external folder, and the dependencies of those dependencies, etc...

@jimhester
Copy link
Member

jimhester commented Aug 2, 2019

This will be fixed once #402 is merged.

@kenahoo
Copy link
Contributor Author

kenahoo commented Aug 12, 2019

I'll follow the progress in #402, any sense of when it might get merged or what work still needs to be done?

@jimhester jimhester added the bug label Apr 3, 2020
@jimhester
Copy link
Member

jimhester commented Jul 10, 2020

Closed by #402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

3 participants