Skip to content

Unable to load package that depends on package loaded by load_all #121

@hongooi73

Description

@hongooi73

Say you're working on a package A, that has a reverse dependency B which lists A in Depends: (rather than Imports:).

If you load A with load_all(), and then do library(B), the latter will fail with

Error: package 'A' required by 'B' could not be found

To reproduce this, you can use the foreach package, which is at https://github.com/RevolutionAnalytics/foreach

  • Clone the repo
  • Run
load_all()
library(doParallel)

This will result in the error message above.

Running a traceback shows that the error comes from base::.getRequiredPackages2. This function is called by base::library, and in turn calls system.file to get the path to one of foreach's package files. But when foreach is loaded via load_all, there are no package files and everything falls down.

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