You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We rely on brms / rstan in the report package, and we have a workflow checking for warnings in tests. The workflow is failing due to a warning caused by brms / rstan (see easystats/report#448),
Global state has changed
Essentially, the warning seems to arise from a test simply calling the brms::brms() function as below:
The brms maintainer suggested that this might have to do with rstan and not brms. Would you have any idea as to how we can fix this on our end, or is this something that needs fixing in rstan or in some of its dependencies?
The text was updated successfully, but these errors were encountered:
For reference, in the corresponding Discourse topic, Bob Carpenter commented:
I looked up this error and it seems to arise when a test from testthat finds that global state has changed. I agree that it’s bad form to change global state in a test. Tracking this down is going to require finding where RStan or brms or something they call changes the global state.
In particular, this appears to arise from setting a few new flags (PKG_CPPFLAGS, PKG_LIBS and USE_CXX17). One way to deal with this would probably be to set them ahead of time. The other way to deal with it would be to write something that wraps the tests in something that removes warning messages.
Overall, testing for generic state changes like this is probably going to be brittle going forward if it’s not something that RStan or brms care about.
Another alternative might be to switch to the cmdstanr back end. Otherwise, someone needs to track through the code, figure out where those three flags get set, then wrap them safely so that they are guaranteed to be unset (I don’t know if R has exceptions and can support a try/catch/finally pattern).
Transferred from paul-buerkner/brms#1670
We rely on
brms
/rstan
in thereport
package, and we have a workflow checking for warnings in tests. The workflow is failing due to a warning caused bybrms
/rstan
(see easystats/report#448),Essentially, the warning seems to arise from a test simply calling the
brms::brms()
function as below:Generates that "Global state has changed" warning. The detailed error from the workflow is available e.g., here: https://github.com/easystats/report/actions/runs/9797434007/job/27054023826?pr=447#step:5:196
The
brms
maintainer suggested that this might have to do withrstan
and notbrms
. Would you have any idea as to how we can fix this on our end, or is this something that needs fixing inrstan
or in some of its dependencies?The text was updated successfully, but these errors were encountered: