On 9/25/24 12:21, Ivan Krylov wrote:
Hmm, so it's *not* a machine-specific problem after all [1,2] and can
now be reproduced on a regular R-devel build on Debian Sid. I'm sorry
for jumping to conclusions.

No need to apologize, you've gotten 1000x farther than I would have on my own.

What is your current estimate of the probability that this is something that I've done wrong vs. exposing something wonky elsewhere (i.e. at the level of testthat, brms, rstan, Rcpp, R-devel, ...) ?

  I will try to find time and energy to

* see if there are any other packages downstream of brms that are encountering testing problems on Fedora; * set up my own more-minimal example/figure out how to reproduce in a Docker container

I have a few weeks to sort this out. If absolutely necessary I can use the ugly solution of skipping those tests on CRAN ...

  cheers
    Ben


Why would Rcpp::loadModule() (called from rstan's .onLoad) end up trying
to apply a non-function, but only when being called from
broom.mixed/tests/testthat/test-alltibbles.R, and only on the first
attempt? (A repeated source() will run to completion without signalling
any errors.)

Error: package or namespace load failed for 'rstan' in
.doLoadActions(where, attach):
error in load action .__A__.1 for package rstan:
Rcpp::loadModule(module = "class_model_base", what = TRUE, env = ns,:
Unable to load module "class_model_base": attempt to apply
non-function
Error in .requirePackage(package) : unable to load required package
'rstan'

The underlying error is in Rcpp::Module('class_model_base', mustStart =
TRUE, where = <namespace:rstan>):

simpleError in METHOD$info(""): attempt to apply non-function

This call originates in Rcpp:::method_wrapper:

Browse[3]> METHOD$info
NULL
Browse[3]> str(METHOD)
Prototypical reference class 'C++OverloadedMethods' [package "Rcpp"]
Browse[3]> unclass(METHOD) # print(METHOD) fails due do $info
<S4 Type Object>
attr(,".xData")
<environment: 0x5596b8ef1530>
Browse[3]> ls(METHOD@.xData, all = TRUE)
  [1] ".->class_pointer" ".->const"         ".->docstrings"    ".->nargs"
  [5] ".->pointer"       ".->signatures"    ".->size"          ".->void"
  [9] ".refClassDef"     ".self"            "class_pointer"    "const"
[13] "docstrings"       "nargs"            "pointer"        "signatures"
[17] "size"             "void"

Why would an object of reference class 'C++OverloadedMethods' suddenly
lose its $info method? This doesn't look like anything printed when I
trace(Rcpp:::method_wrapper, quote(print(METHOD))) and then load
'rstan' in a fresh R session.


--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
* E-mail is sent at my convenience; I don't expect replies outside of working hours.

______________________________________________
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to