statnet / ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks
Other
98 stars 37 forks source link

Bump minimum R version to R-4.4.1 #584

Closed vandenman closed 2 days ago

vandenman commented 1 week ago

The current minimum R version is 4.1, as specified in https://github.com/statnet/ergm/blob/dfbce58cffb38ccafc735798589a0fbdd1fcf2c2/DESCRIPTION#L23

However, when installing the current CRAN version on say, R-4.4.0 I see this error:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/don/.cache/R/renv/cache/v5/linux-manjaro-rolling/R-4.4/x86_64-pc-linux-gnu/ergm/4.7.5/d5f7384696942dcb25a0cefe94127194/ergm/libs/ergm.so':
  /home/don/.cache/R/renv/cache/v5/linux-manjaro-rolling/R-4.4/x86_64-pc-linux-gnu/ergm/4.7.5/d5f7384696942dcb25a0cefe94127194/ergm/libs/ergm.so: undefined symbol: Rf_allocLang

The C function Rf_allocLang was introduced in R-4.4.1, see https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2024/06/05#n2024-06-05

Perhaps this should also be caught by R CMD CHECK somehow, but that is a different bug report I guess :sweat_smile:

krivit commented 1 week ago

That's strange. We implement the CRAN-recommended workaround here:

https://github.com/statnet/ergm/blob/dfbce58cffb38ccafc735798589a0fbdd1fcf2c2/src/etamap.c#L38-L46

vandenman commented 1 week ago

That makes sense, but I'm not sure if this workaround is sufficient to avoid the issue. As far as I know, R/ CRAN assumes that packages within patch versions of R are binary compatible. So if you use R-4.4.0 on Windows or macOS and install ergm, then R downloads a binary made with R-4.4.2, effectively bypassing the ifdef. In my case on Linux, renv linked a version of ergm build with R-4.4.2 and then I also got the error.

krivit commented 2 days ago

CRAN probably should not have added that function to the API during a minor release. Ultimately, I don't think this is something that can be fixed on my end.