Installation false warning
m-clark opened this issue · 2 comments
In a recent fresh install I can get the following on a machine that does not have all the packages that might be used.
Error : (converted from warning) namespace ‘rstanarm’ is not available and has been replaced
by .GlobalEnv when processing object ‘brms_model’
ERROR: unable to build sysdata DB for package ‘mixedup’
There is no issue with the build or hundreds of tests, and I have not otherwise found any error. brms_model
(along with rstanarm_model
) is an internal data object used for the vignettes so that it doesn't have to compile/run during their build. I found that deleting rstanarm or lme4 packages causes this error, but not having other packages installed (like glmmTMB) is not a problem.
There is a closed issue on devtools/remotes that speaks to the problem, but actually wasn't resolved: r-lib/remotes#374
I will update the ReadMe with the workaround noted in the remotes issue and post it here, but otherwise have no idea why it's a problem with 4.0, as nothing changed on my end regarding these objects.
Workaround:
withr::with_envvar(c(R_REMOTES_NO_ERRORS_FROM_WARNINGS="true"),
devtools::install_github('m-clark/mixedup')
)
At present this no longer fails with 4.1.1 (at least on Mac), but will still warn during build as it did before (example where brms is installed but rstanarm is not). Perhaps during next update it'd be good to retest. I don't really care about the warning but will leave this open for a while longer.
Warning: namespace ‘rstanarm’ is not available and has been replaced
by .GlobalEnv when processing object ‘brms_model’