【问题标题】:Travis CI error while devtools::chech() doesn't特拉维斯 CI 错误,而 devtools::chech() 没有
【发布时间】:2021-12-08 03:12:57
【问题描述】:

Here is the package in github.

正如您在 travis.yml 中看到的,警告不会被视为错误。当我在控制台中执行check() 时,没有错误。结果如下:

0 errors ✓ | 4 warnings x | 1 note x

这是 Travis CI 的最后几行。

ERROR: dependency ‘raster’ is not available for package ‘leaflet’
* removing ‘/home/travis/R/Library/leaflet’
* installing *source* package ‘modelr’ ...
** package ‘modelr’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (modelr)
* installing *source* package ‘tidyverse’ ...
** package ‘tidyverse’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (tidyverse)
The downloaded source packages are in
    ‘/tmp/RtmpX59PJA/downloaded_packages’
Warning messages:
1: In i.p(...) : installation of package ‘terra’ had non-zero exit status
2: In i.p(...) : installation of package ‘units’ had non-zero exit status
3: In i.p(...) : installation of package ‘raster’ had non-zero exit status
4: In i.p(...) : installation of package ‘sf’ had non-zero exit status
5: In i.p(...) :
  installation of package ‘leaflet’ had non-zero exit status
missing: terra, raster, units, leaflet, sf
The command "Rscript -e 'deps <- remotes::dev_package_deps(dependencies = NA);remotes::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message("missing: ", paste(setdiff(deps$package, installed.packages()), collapse=", ")); q(status = 1, save = "no")}'" failed and exited with 1 during .
Your build has been stopped.

我应该修改什么以使其通过 Travis CI?

【问题讨论】:

    标签: r yaml travis-ci devtools


    【解决方案1】:

    我觉得你的包至少依赖于rastersf;并且您的脚本不会安装它们:

    1: In i.p(...) : installation of package ‘terra’ had non-zero exit status
    2: In i.p(...) : installation of package ‘units’ had non-zero exit status
    3: In i.p(...) : installation of package ‘raster’ had non-zero exit status
    4: In i.p(...) : installation of package ‘sf’ had non-zero exit status
    

    原因很可能是您没有安装所需的系统依赖项(GDAL、GEOS、...)。在安装这些软件包之前,您需要在系统中添加类似的内容

    sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-bin

    我认为在这样的 travis 文件中

    addons:
      apt:
        packages:
          - libgdal-dev
          - libproj-dev
          - libudunits2-dev
          - netcdf-bin
    

    您可能更喜欢使用 github 操作。参见例如这个workflowterra

    【讨论】:

    • 您的意思是将这些行添加到 .travis.yml 吗? --> 安装:sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-bi
    • 是的,但随后相当于 travis。我已经在问题中添加了我认为的内容。
    • 我根据您的解决方案将此行添加到 travis.yml 并且它有效 --> before_install: sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev netcdf-bin
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-05-27
    • 2018-01-22
    • 1970-01-01
    • 2022-08-18
    • 1970-01-01
    • 1970-01-01
    • 2020-09-01
    相关资源
    最近更新 更多