pkgload
pkgload copied to clipboard
load_all() fails cryptically for Matrix
I see the following (truncated) output for pkgload::load_all("Matrix")
for the package cloned from the cran/Matrix
GitHub repo:
─ DONE (Matrix)
Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
cannot open compressed file '', probable reason 'No such file or directory'
This must be some sort of compilation issue;
- Is
load_all()
expected to work for all (non-default) packages, includingrecommended
priority? - Can this error be improved?
With options(error=recover)
, I could track down that it's coming while trying to load data/
objects, specifically:
https://github.com/cran/Matrix/blob/d91a3f2149572d5e4801cb9d4c28d55ffd3642e8/data/CAex.R#L5
It looks like system.file()
wound up with the wrong paths, specifically:
list.files(system.file(package='Matrix'))
# [1] "build" "cleanup" "data" "DESCRIPTION" "inst"
# [6] "LICENCE" "man" "MD5" "NAMESPACE" "po"
# [11] "R" "src" "tests" "vignettes"
Looks like we need to further prefix system.file()
paths with inst/
.