软件包构建在 R 3.6.0(开发)上失败,但在 3.5.5(发布)上没有
Package build fails on R 3.6.0 (devel) but not on 3.5.5 (release)
我正在为 CRAN 编写一个包,我在 Travis 上测试发布和开发版本。该软件包在发布版本上构建良好,并在开发时出现此错误:
** testing if installed package keeps a record of temporary installation path
ERROR: hard-coded installation path: please report to the package maintainer and use ‘--no-staged-install’
* removing ‘/tmp/RtmpZ9RX7i/Rinst63414089e04b/PackageName’
-----------------------------------
ERROR: package installation failed
导致构建失败并与硬编码路径相关的代码更改是包中的这些行:
k_extdata <- "extdata"
k_package <- "PosteriorBootstrap"
k_german_credit <- "statlog-german-credit.dat"
data_file <- function(name) {
return(system.file(k_extdata, name, package = k_package))
}
以及测试中的这些行:
stan_file <- data_file("bayes_logit.stan")
bayes_logit_model <- rstan::stan_model(file = stan_file)
在线搜索显示此问题的结果为零。有没有人以前发现过这个,为什么它只在开发版本中失败?
此错误是由 R 3.6.0 中引入的新 Staged Install 功能触发的。您可以在官方 R 博客上阅读更多相关信息:https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html
我正在为 CRAN 编写一个包,我在 Travis 上测试发布和开发版本。该软件包在发布版本上构建良好,并在开发时出现此错误:
** testing if installed package keeps a record of temporary installation path
ERROR: hard-coded installation path: please report to the package maintainer and use ‘--no-staged-install’
* removing ‘/tmp/RtmpZ9RX7i/Rinst63414089e04b/PackageName’
-----------------------------------
ERROR: package installation failed
导致构建失败并与硬编码路径相关的代码更改是包中的这些行:
k_extdata <- "extdata"
k_package <- "PosteriorBootstrap"
k_german_credit <- "statlog-german-credit.dat"
data_file <- function(name) {
return(system.file(k_extdata, name, package = k_package))
}
以及测试中的这些行:
stan_file <- data_file("bayes_logit.stan")
bayes_logit_model <- rstan::stan_model(file = stan_file)
在线搜索显示此问题的结果为零。有没有人以前发现过这个,为什么它只在开发版本中失败?
此错误是由 R 3.6.0 中引入的新 Staged Install 功能触发的。您可以在官方 R 博客上阅读更多相关信息:https://developer.r-project.org/Blog/public/2019/02/14/staged-install/index.html