Skip to content

Dependencies install to the wrong place #411

Closed

Description

@kenahoo

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>

Activity

  1. kenahoo commented on Jul 29, 2019

    @kenahoo
    ContributorAuthor

    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.

  2. tannerntannern commented on Jul 31, 2019

    @tannerntannern

    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...

  3. jimhester commented on Aug 2, 2019

    @jimhester
    Member

    This will be fixed once #402 is merged.

  4. kenahoo commented on Aug 12, 2019

    @kenahoo
    ContributorAuthor

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

  5. added
    bugan unexpected problem or unintended behavior
    on Apr 3, 2020
  6. jimhester commented on Jul 10, 2020

    @jimhester
    Member

    Closed by #402

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions