klmr / box

Write reusable, composable and modular R code
https://klmr.me/box/
MIT License
829 stars 47 forks source link

recent versions do not install with R 3.6.3 (object '.S3method' not found) #335

Closed aronatkins closed 11 months ago

aronatkins commented 11 months ago

Error description

docker run -it --rm rocker/r-ver:3.6.3 R -s -e 'install.packages("box", repos = c(CRAN = "https://cran.rstudio.com"))'
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/box_1.1.3.tar.gz'
Content type 'application/x-gzip' length 553423 bytes (540 KB)
==================================================
downloaded 540 KB

* installing *source* package ‘box’ ...
** package ‘box’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c exports.c -o exports.o
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c lookup.c -o lookup.o
gcc -I"/usr/local/lib/R/include" -DNDEBUG   -I/usr/local/include  -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c unlock_env.c -o unlock_env.o
gcc -shared -L/usr/local/lib/R/lib -L/usr/local/lib -o box.so exports.o lookup.o unlock_env.o -L/usr/local/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-box/00new/box/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Error in get(name, envir = ns, inherits = FALSE) :
  object '.S3method' not found
Error: unable to load R code in package ‘box’
Execution halted
ERROR: lazy loading failed for package ‘box’
* removing ‘/usr/local/lib/R/site-library/box’

The downloaded source packages are in
    ‘/tmp/RtmpAhxzSL/downloaded_packages’
Warning message:
In install.packages("box", repos = c(CRAN = "https://cran.rstudio.com")) :
  installation of package ‘box’ had non-zero exit status

R version

_
platform       x86_64-pc-linux-gnu
arch           x86_64
os             linux-gnu
system         x86_64, linux-gnu
status
major          3
minor          6.3
year           2020
month          02
day            29
svn rev        77875
language       R
version.string R version 3.6.3 (2020-02-29)
nickname       Holding the Windsock

‘box’ version

1.1.3

aronatkins commented 11 months ago

Same error happens with GitHub version:

docker run -it --rm rocker/r-ver:3.6.3 R -s -e 'install.packages("remotes", repos = c(CRAN = "https://cran.rstudio.com")); remotes::install_github("klmr/box")'
klmr commented 11 months ago

Ah this is annoying/stupid: the package doesn’t even need .S3method, it’s just in there to work around a combination of bugs in R CMD check. Now I need to make this already unnecessary code even more complex to account for old versions of R. 😭

klmr commented 11 months ago

Actually is there a good reason to use R 3.6? I am thinking about dropping support for this version because it’s incredibly hard to get necessary build infrastructure packages to install for that version of R, so I basically cannot debug issues any more.

aronatkins commented 10 months ago

I hit this while testing some changes to renv across a variety of R versions. I do not otherwise use box and don't have opinions about what R versions should be supported. The DESCRIPTION declared R >= 3.5.0, which made the problem feel worth reporting.

klmr commented 10 months ago

I’m definitely grateful for the bug report.

I’ll probably have to drop support for older R versions at some point, since maintaining them is disproportionately time-consuming. I did drop support for v3.5 now since I couldn’t even get the regular CI/CD workflow to run on it (‘devtools’ no longer supports it). Working around this isn’t worth the effort.