Closed jgaeb closed 5 months ago
Nevermind—this seems to be the same as this issue on the testthat
repo: https://github.com/r-lib/testthat/issues/1230.
In case anyone finds this in the future because they're dealing with the same problem, the issue actually seems to be with tools::package_native_routine_registration_skeleton()
, which generates the wrong signature for some reason in R 4.3.2. See this bug report, as well as this patch in Rcpp
. This thread on the r-package-devel
list which includes some workarounds.
The autogenerated
cpp11.cpp
file is leading torun_testthat_tests()
being defined twice. In particular, in myrar
package it's defined here incpp11.cpp
:and in the
testthat.h
header:This is leading to a violation of the C++ One Definition Rule when I compile this code on Fedora. (And presumably other platforms as well.) I've received the advice to simply include the
testthat.h
header in thecpp11.cpp
file, but since it's autogenerated, I think this is a bug. (I'm pretty new to R package development, so my apologies in advance if this is actually user error.)