-
-
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
Make Rcpp::exception thread-safe #1043
Conversation
Well this falls short on
|
Also, I did point out to you on rcpp-devel that we had extensive discussions around that. Maybe take a moment and look at
which may be relevant. There is much more via a simple search for 'exception' among closed PRs. |
I'm happy to open an issue, but why not just have the discussion here?
Hm, I didn't see these because I searched issues instead of PRs. The only one that looks relevant is #868. It seems like this PR was incomplete because Basically, my approach here was to make |
What's an efficient way to demonstrate a lack of impact on reverse dependencies? There are a zillion packages that depend on Rcpp. |
This requires a reverse depends check, which does imply running |
I wrote a package for that (see prrd) which I use on a somewhat underpowered VM I have a courtesy account on, but that box is busy today rev.dep checking RcppArmadillo which I submitted. That takes ~ 6 hours, Doing Rcpp takes 18+ hours. And I have some work to do today so I cannot dedicated my Sunday for doing the work for PRs we have not deemed necessary yet, and which go fairly deep into inner Rcpp guts where we needed half-a-dozen PRs to get to where we are today. Also, how to do reverse dependency checks is otherwise not a secret, discussed on the R mailing lists, supported by base R and several add-on packages. |
"Beware of bugs in the above code; I have only proved it correct, not tried it.". -- Donald Knuth |
Wow. Okay, I kicked off the job. |
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.
Mostly LGTM, but I would prefer to keep the old stack_trace
routine registered. (It's okay if it's just a stub that returns R_NilValue
)
@lionel- I couldn't add you to 'request a code review' but it would be good if you could look at this too. If you have a few moments in the next few days it would be appreciated! |
If you are so tired of answering, you might add some hints in the |
The file, like everything else here, is based on volunteer effort and time, and in fact fairly recent. It appears to have helped as well because your PR, while clearly not ready yet or consensus-based, did in fact 'tick off' a couple of boxes I consider helpful. If you have a suggestion to make for the file, why not raise an issue ticket and suggest new wording? Lastly, I am sorry but as I recall you too have multiple CRAN uploads under your belt and state each time you do one that you checked reverse depends (if there any) for your package. In other words you were already supposed to know this, which is why I allowed myself to use short hand. |
I do indeed have a primitive script to check reverse depends, but nowhere near as polished as the scripts you suggested. It is one thing to check when there are less than 10 revdeps, and other thing entirely when there are more than 2000. Cheers! |
1857 as of today. We omit Suggests:. And I am aware that this is a lot of work. I have been doing this diligently for some time now: https://github.com/RcppCore/rcpp-logs It is to the benefit of everybody who depends on Rcpp, i.e. all of use here and of course you too. And if "stuff breaks" I have to deal with it which is why I lean towards the conservative side when it comes to unannounced PRs going deep into internals. And as a whole we could do better around CRAN and tooling but alas there is always so much to do and so little time. Again, if you think you can make the process better please do not hold back (and I of course do not speak for CRAN as nobody does). |
LGTM! |
I tried to run revdepcheck overnight and my laptop ran out of memory. Sorry but it seems that I don't have access to big enough hardware to run the check. I would appreciate it if somebody else can do it. No hurry; This can happen at your convenience. |
Now that RcppArmadillo is updated on CRAN, I can turn this on. Runs unattended in a (very remote to me) data center anyway once I launch. But what about comments / requests for changes Kevin made yesterday? (I didn't have time to look in detail, was busy shepherding RcppArmadillo and cranking out a paper draft...) |
I believe that I have addressed them. |
And just to be sure: you squashed/rebased your several commits back into one? It is a little hard to see what changed when in that case. Possibly nicer for merged history yet harder for PR assessment... |
Yeah, I wasn't sure which kind of history was preferred. That's another point to add to the Contributing.md file. |
Well I guess all we know now is that I just wasted the last few minutes preparing a test tarball. |
And I am in no position to assess what just changed. That goes against the entire spirit of the PR we all just spent 24 hours on. Why? |
I changed the authorship in the comment. That's it. From now on, I'll add commits instead of squashing. |
If you want, I can unsquash the commits. But that would require another force push. Let me know. |
I would appreciate that as it will no longer hide your work and make it inaccessible. It is also how the rest the world works. If and when we're done you can still squash, or I could squash-merge, ... |
+ Move NEWS.Rd entries to the bottom of the relevant section + Restore GET_STACKTRACE macro + Move open brace to conform to code style + Add copywrite comment block to Rcpp/exceptions_impl.h + Restore useless stack_trace API in Rcpp/routines.h + Restore RCPP_REGISTER(stack_trace)
Jeebus. Did you just push AGAIN? |
The 👎 was a discouragement. As in: "no, I would prefer if you not pushed again". |
What the heck? You are giving contradictory instructions within the span of 30 minutes. Yeah, I pushed again to unsquash the commits. Sorry, I didn't notice the thumbs down emoji until it was too late. |
I'll unsubscribe from this thread now. I actually have work to do. |
@kevinushey When you have a moment, can you take a look at the changes made in response to you code review comments? I have "unresolved" these; commonly the person who raises an issue gets to declare it resolved (rather than the person responding, but many things were a little unusual here...) I had started one full reverse-depends which was promptly partially invalidated by forced pushes, but maybe that won't happen again either. In any, results from the rev.dep runs are in RcppCore/rcpp-logs@dc22889 and RcppCore/rcpp-logs@6811463. Result are pretty stunning -- essentially only three fails on the last run all of which seem internal to the affected packages (but as usual I do skip a few for various reasons). So in sum no issue from here: looks good. Shout-out also to @lionel- for taking a look, appreciate it, |
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.
LGTM; just two minor nitpicks.
ChangeLog
Outdated
* inst/include/Rcpp/exceptions.h: Make thread-safe | ||
* inst/include/Rcpp/exceptions_impl.h: New home for code moved | ||
from inst/include/Rcpp/routines.h and src/api.cpp | ||
* src/rcpp_init.cpp: stack_trace no longer exported as an R API |
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.
nit: this is no longer true I think?
inst/include/Rcpp/exceptions_impl.h
Outdated
@@ -0,0 +1,88 @@ | |||
// exceptions_impl.h: Rcpp R/C++ interface class library -- exceptions | |||
// | |||
// Copyright (C) 2020 Joshua N. Pritikin |
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.
We should preserve the old author names as well (adding yourself is okay since you've also made changes)
I can take care of the cleanup on the header and ChangeLog and NEWS entries. |
Thanks all! Sorry again for the force pushes. |
It's ok, I think we're all coming closer to the same page regarding process now. Do you want to do another commit with touch-ups? Or do you want me to? |
Pull Request Template for Rcpp
See the discussion thread on rcpp-devel.
I don't think new tests are a great idea. It would be tricky to reliably fail by throwing the old thread-unsafe version of
Rcpp::exception
.Checklist
R CMD check
still passes all tests