rstudio / rstudio/packrat

Packages depending on other packages fail with packrat 0.5.0

Open
#526 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

Problem

I am trying to install the R package pillar from CRAN using Packrat 0.5.0 on R 5.2.1, but for some reason the installation process breaks because the prerequisite package crayon is not detected even though it was automatically installed by install.packages.

Steps to reproduce
  1. Create a dummy directory for a minimal project:
$ mkdir ~/zzz
$ echo 'packrat::init("~/zzz")' | R --no-save
  1. Run the R interpreter inside this directory:
$ cd ~/zzz
$ R

On startup, R acknowledges the Packrat installation:

Packrat mode on. Using library in directory:
- "~/zzz/packrat/lib"
  1. Try to install the pillar package:
> install.package("pillar")
Installing package into ‘/home/karltk/zzz/packrat/lib/x86_64-pc-linux-gnu/3.5.2’
(as ‘lib’ is unspecified)
also installing the dependencies ‘assertthat’, ‘cli’, ‘crayon’, ‘fansi’, ‘rlang’, ‘utf8’
... [SNIP]
* installing *source* package ‘crayon’ ...
** package ‘crayon’ successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (crayon)
... [SNIP]
* installing *source* package ‘pillar’ ...
... [SNIP]
** testing if installed package can be loaded
Error: package or namespace load failed for ‘pillar’:
 .onLoad failed in loadNamespace() for 'pillar', details:
  call: loadNamespace(name)
  error: there is no package called ‘crayon’
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/karltk/zzz/packrat/lib/x86_64-pc-linux-gnu/3.5.2/pillar’
  1. Verify that the crayon library actually exists and is accessible:
library(crayon)
?crayon
Environment information

Output from R sessionInfo:

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=nb_NO.utf8        LC_NUMERIC=C              
 [3] LC_TIME=nb_NO.utf8         LC_COLLATE=nb_NO.utf8     
 [5] LC_MONETARY=nb_NO.UTF-8    LC_MESSAGES=en_US.utf8    
 [7] LC_PAPER=nb_NO.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=nb_NO.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.2

Output from cat /etc/lsb-relase:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"

Output from R:

> packrat::status()
Up to date.
Discussion

I've tried with install.packages('pillar', quiet = FALSE, verbose = TRUE) to dig deeper into the issue, but not found any additional information that I was able to use. It seems such a basic problem that I suspect this might be a PEBCAC-situation, but I've been unable to figure out why the reshape2 package installs just fine, whereas the pillar package does not.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in a minimal project using packrat::init, install.packages('pillar'), and packrat::status(), then trace Packrat's package installation and dependency-loading entry points. The issue names no source file or test; consider the investigation complete when the installed crayon package is correctly visible while pillar is tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.