Skip to content

R CMD build: Ignore R_FUTURE_PLAN during package build to avoid cyclic loading #541

@HenrikBengtsson

Description

@HenrikBengtsson

Issue

$ R_FUTURE_PLAN=future.callr::callr R CMD build future.apply
* checking for file ‘future.apply/DESCRIPTION’ ... OK
* preparing ‘future.apply’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
      -----------------------------------
* installing *source* package ‘future.apply’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for ‘future’:
 .onLoad failed in loadNamespace() for 'future', details:
  call: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
  error: cyclic namespace dependency detected when loading ‘future’, already loading ‘future.callr’, ‘future’
Execution halted
ERROR: lazy loading failed for package ‘future.apply’
* removing ‘/tmp/hb/RtmpuGbp1R/Rinst4a9660c92d74/future.apply’
      -----------------------------------
ERROR: package installation failed

Action

Have .onLoad() detect when R CMD build is running and unset R_FUTURE_PLAN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions