epiforecasts / covidregionaldata

An interface to subnational and national level COVID-19 data. For all countries supported, this includes a daily time-series of cases. Wherever available we also provide data on deaths, hospitalisations, and tests. National level data is also supported using a range of data sources as well as linelist data and links to intervention data sets.
https://epiforecasts.io/covidregionaldata/
Other
37 stars 18 forks source link

R-CMD-CHECK / test-coverage failing #364

Closed joseph-palmer closed 3 years ago

joseph-palmer commented 3 years ago

Fails at the command:

Run covr::codecov()
  covr::codecov()
  shell: /usr/local/bin/Rscript {0}
  env:
    R_LIBS_USER: /Users/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true

Giving the error:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Users/runner/work/_temp/Library/covr/libs/covr.so':
  dlopen(/Users/runner/work/_temp/Library/covr/libs/covr.so, 6): Library not loaded: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libR.dylib
  Referenced from: /Users/runner/work/_temp/Library/covr/libs/covr.so
  Reason: image not found
Calls: loadNamespace -> library.dynam -> dyn.load
Execution halted

Nothing code wise seems to have changed which would affect this, so it is likely an internal issue. The only difference in the code ran up to Test coverage is within the section Install dependencies.

Last working version (#360):

Run install.packages(c("remotes"))
  install.packages(c("remotes"))
  remotes::install_deps(dependencies = TRUE)
  remotes::install_cran("covr")
  shell: /usr/local/bin/Rscript {0}
  env:
    R_LIBS_USER: /Users/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
Installing package into ‘/Users/runner/work/_temp/Library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/bin/macosx/contrib/4.0/remotes_2.3.0.tgz'
Content type 'application/x-gzip' length 390609 bytes (381 KB)
==================================================
downloaded 381 KB

The downloaded binary packages are in
    /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpV6cNnJ/downloaded_packages

Skipping install of 'covr' from a cran remote, the SHA1 (3.5.1) has not changed since last install.
  Use `force = TRUE` to force installation

broken version:

Run install.packages(c("remotes"))
  install.packages(c("remotes"))
  remotes::install_deps(dependencies = TRUE)
  remotes::install_cran("covr")
  shell: /usr/local/bin/Rscript {0}
  env:
    R_LIBS_USER: /Users/runner/work/_temp/Library
    TZ: UTC
    _R_CHECK_SYSTEM_CLOCK_: FALSE
    NOT_CRAN: true
Installing package into ‘/Users/runner/work/_temp/Library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/bin/macosx/contrib/4.1/remotes_2.3.0.tgz'
Content type 'application/x-gzip' length 390384 bytes (381 KB)
==================================================
downloaded 381 KB

The downloaded binary packages are in
    /var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T//RtmpfT96Mf/downloaded_packages
Installing 1 packages: fansi
fansi (0.4.2 -> 0.5.0) [CRAN]
Installing package into ‘/Users/runner/work/_temp/Library’
(as ‘lib’ is unspecified)

installing the source package ‘fansi’
  There is a binary version available but the source version is later:

      binary source needs_compilation
trying URL 'https://cloud.r-project.org/src/contrib/fansi_0.5.0.tar.gz'
fansi  0.4.2  0.5.0              TRUE

Content type 'application/x-gzip' length 301724 bytes (294 KB)
==================================================
downloaded 294 KB

* installing *source* package ‘fansi’ ...
** package ‘fansi’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c assumptions.c -o assumptions.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c has.c -o has.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c init.c -o init.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c nchar.c -o nchar.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c read.c -o read.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c rnchar.c -o rnchar.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c state.c -o state.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c strip.c -o strip.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c strsplit.c -o strsplit.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c tabs.c -o tabs.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c tohtml.c -o tohtml.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c unhandled.c -o unhandled.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c unique.c -o unique.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c utf8.c -o utf8.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c utils.c -o utils.o
clang -mmacosx-version-min=10.13 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -I/usr/local/include   -fPIC  -Wall -g -O2  -c wrap.c -o wrap.o
clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o fansi.so assumptions.o has.o init.o nchar.o read.o rnchar.o state.o strip.o strsplit.o tabs.o tohtml.o unhandled.o unique.o utf8.o utils.o wrap.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Users/runner/work/_temp/Library/00LOCK-fansi/00new/fansi/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (fansi)

The downloaded source packages are in
    ‘/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpfT96Mf/downloaded_packages’
Skipping install of 'covr' from a cran remote, the SHA1 (3.5.1) has not changed since last install.
  Use `force = TRUE` to force installation

The main difference seems to be that the broken one is installing the package ‘fansi’ and placing it in a private/var directory. Maybe this is causing errors? The wird thing is that they both have the same info about covr which is the one which is failing. Perhapse this is interfering with where covr ends up? Maybe be the saving into private/var moves other things that would be in var into private/var (although I have no idea why it would do this) and so the shared object file can't be found.

This is a weird bug...

RichardMN commented 3 years ago

Maybe try running it on ubuntu instead of MacOS? I also wondered if it may be something odd with the cached packages so perhaps it could be stripped down to not used renv (or equivalents) and accept the performance cost of installing/compiling more. I recognize that this suggestion is close to "have you tried turning it off and turning it back on again?" but I fear digging into the underlying glitch is off the main path and beyond our expertise.

seabbs commented 3 years ago

I think turning it off and on again is definitely the way to go!

seabbs commented 3 years ago

Fixed via #366 - thanks to @RichardMN