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
{{ message }}
Repository navigation
Did something change with void return of Modules functions? #1328
Fresh CRAN email reports that my RcppCNPy package now differs between the saveAndLoad.Rout it creates and the saveAndLoad.Rout.save I have in the package, in particular calls to npySave() now return a NULL but did not before. This is a standard Rcpp Modules binding of a void function (see here).
Did we change anything in how this is generated within Rcpp? I cannot think of anything. Am I missing something?
I don't think we changed anything, and it works fine here with v4.4.1. All NOTEs you got are from r-devel machines, so I'd say something changed there. Of course void functions always return NULL at the R side, but something was invisible() and now it is not anymore in r-devel, apparently.
Mmmh... wait a sec... I had a problem with the package versions and I can reproduce it now with r-release. This is strange. Maybe we did change something, but didn't appear until this?
@andrjohns Quick ping :) Not the most burning of fires, but I have to do a minor maintenance release because void functions in Modules now return NULL whereas they used to be silent. You wouldn't have a quick guess as to whether this slipped in when you overhauled this so nicely for variadic arguments?
The logic that creates such a call is here, and depends on the detection of whether the RESULT_TYPE is void here. I checked and is_void is FALSE when RcppCNPy is built. This means that the RESULT_TYPE is incorrect with variadic arguments.
Off the top of my head, I think this is because the call function (invoked by the module definition) is returning R_NilValue for void-returning functions here
@andrjohns You may want to start your debugging from the module-regression branch, where I added a few tests that check that void module functions correctly return invisibly (3 are failing now, which are functions exposed via Modules).
@andrjohns Just a kind reminder here. A rough estimate of your time availability for this would be appreciated, even if that's a null value, in order to plan our own efforts over here. Thanks! :)
Activity
Enchufa2 commentedon Sep 3, 2024
I don't think we changed anything, and it works fine here with v4.4.1. All NOTEs you got are from r-devel machines, so I'd say something changed there. Of course void functions always return NULL at the R side, but something was
invisible()and now it is not anymore in r-devel, apparently.Enchufa2 commentedon Sep 3, 2024
Mmmh... wait a sec... I had a problem with the package versions and I can reproduce it now with r-release. This is strange. Maybe we did change something, but didn't appear until this?
eddelbuettel commentedon Sep 3, 2024
We could ask @kurthornik if he recalls when this started to appear.
Enchufa2 commentedon Sep 3, 2024
Ok. Meanwhile, bisecting...
Enchufa2 commentedon Sep 3, 2024
Ok, so 4075b5c introduced the change.
Before the commit:
After the commit:
eddelbuettel commentedon Sep 3, 2024
That's what I suspected when I glanced at our changelog. We may have dropped an invisible there somewhere.
eddelbuettel commentedon Sep 3, 2024
@andrjohns Quick ping :) Not the most burning of fires, but I have to do a minor maintenance release because
voidfunctions in Modules now returnNULLwhereas they used to be silent. You wouldn't have a quick guess as to whether this slipped in when you overhauled this so nicely for variadic arguments?Enchufa2 commentedon Sep 3, 2024
The logic that creates such a call is here, and depends on the detection of whether the
RESULT_TYPEis void here. I checked andis_voidisFALSEwhen RcppCNPy is built. This means that theRESULT_TYPEis incorrect with variadic arguments.andrjohns commentedon Sep 3, 2024
Off the top of my head, I think this is because the
callfunction (invoked by the module definition) is returningR_NilValuefor void-returning functions hereI'll have a proper look/debug tomorrow though
Enchufa2 commentedon Sep 3, 2024
Also, the generated file has a specific specialization for
voidthat usesvoid_typehere, and this is what returns"void"here.Enchufa2 commentedon Sep 4, 2024
@andrjohns You may want to start your debugging from the module-regression branch, where I added a few tests that check that void module functions correctly return invisibly (3 are failing now, which are functions exposed via Modules).
Enchufa2 commentedon Oct 1, 2024
@andrjohns Just a kind reminder here. A rough estimate of your time availability for this would be appreciated, even if that's a null value, in order to plan our own efforts over here. Thanks! :)