-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
force 'finalize' method to be materialized on Modules #1231
force 'finalize' method to be materialized on Modules #1231
Conversation
ChangeLog
Outdated
@@ -1,3 +1,7 @@ | |||
2022-09-23 Kevin Ushey <kevinushey@gmail.com> | |||
|
|||
* R/Module.R: Force 'finalize' method to be materialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old Emacs roots here: 1 tab or eight spaces, please.
(Not sure editorconfig has a mode for ChangeLog...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, will fix that up! RStudio wasn't smart enough to infer the indentation here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If only we knew someone working on the IDE 😹
@@ -131,6 +131,8 @@ new_dummyObject <- function(...) # #nocov | |||
|
|||
# class method for $initialize | |||
cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){ | |||
# force finalize method to be materialized | |||
invisible(.self$finalize) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. A one-liner to fix a woe. I presume you played with some Rprintf or REprintf here to see it hits?
I'll turn the rev.dep machine on. It'll take a few moments as usual. |
Right -- just to confirm, this is the script I was running to exercise the issue.
The tracer indeed fires, and the above code reliably prints some errors with the CRAN release of Rcpp, but not with the bandaid from this PR. Also emphasizing; it's not clear whether this is an issue in Rcpp Modules or something else but this is still the simplest way for us to paper over the issue -- evidently it's been reported in a number of places... sneumann/xcms#288 |
Yes. I encountered similar mysterious issues with XPtr once and in one use case ensure I always explicitly set one. It's weird because it generally works. But corner cases exist, so I think this goes the right way. The rev.dep tests being CI we may not see real side effects. But it being September maybe we can get some user segments (geospatial, rstan, ...) to pretty-please try a rc release from the drat before 1.0.10 gets cases in January (under normal timelines). |
So big thank you to you for digging in here! |
Ran the (slow, long) battery of reverse depends checks (resuls as usual in the rcpp-logs sibbling repo) and "no change to worse" so merging this now. |
I also marked it as 1.0.9.3 and pushed a build into the rcpp-drat so we could reach out to the affected packages and suggest they try this version. |
Thanks! I'll send a ping on Twitter and see if there's anyone interested in testing. |
Halleluja. I can confirm that this fixes the issue in "terra" --- at least for the cases that I could reproduce this with |
Closes #1230.
Checklist
R CMD check
still passes all tests