-
Notifications
You must be signed in to change notification settings - Fork 29
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
C++ exception getting lost on OSX R 3.4 #37
Comments
It's almost certainly a toolchain issue. I was able to fix the exception by manually hacking the standard library used by V8. Here's my repro -- first, set up your Makevars as so:
Then, from a clean R session, reinstall both Rcpp and V8 from sources: devtools::install_github("RcppCore/Rcpp", force = TRUE)
devtools::install_github("jeroen/V8", force = TRUE) Try running your snippet: ctx <- V8::v8()
ctx$eval('var foo = {bla}') you'll see
Now, try forcing
Restart R, and try your snippet again -- it works as expected.
My best guess as to what's going on -- the actual |
Some possible ways forward:
I'm not very optimistic that R Core would make any change to fix this issue at this point. :-/ |
This case is not a blocker for me, most other exceptions seem to work fine for some reason. There is some special thing about the syntax exception that triggers this. But it's probably good to be aware that the toolchain mixing is not 100% waterproof. |
Yes, we are between a rock and a hard place - Apple clang is outdated and doesn't support OMP, so we're using clang4 to have a modern compiler with C++ support, but I guess even within stdc++ there are API incompatibilities wrt exceptions which is unfortunate. Just for the fun of it - did you try forcing |
Ah, it looks like this version of
However, the newer versions use
I'm not yet sure how to convince older versions of |
I wouldn't be surprised. If you test the newer one, does that also have the exception problem? Do they behave that same way? |
Unfortunately the V8 R package is not compatible with the newer |
@kevinushey unfortunately Google doesn't care about non-google users and they change the libv8 API for each minor release. Therefore the only somewhat-stable version of Bundling Perhaps we can suggest a patch for the v8@3.15 homebrew formula to build against |
The upstream homebrew formula has been modified to build against libcxx so hopefully the problem will disappear the next time the V8 binary package for OSX is updated. |
Unfortunately I can still reproduce the issue above even with V8 linking to |
Hmm it seems to have solved at least part of the problem for me. But I haven't tested yet with the cran compiler... |
@kevinushey is right. Even after rebuilding |
@mingwandroid does this issue appear with the anaconda compilers as well? |
I'll take a look now. I'll need to add a V8 package first. |
When built with the
I spotted a number of bugs in
|
The following bash script should reproduce my result (it writes only to
|
@mingwandroid the stdc++/libc++ thing is an issue with libv8 and fixed here: Homebrew/homebrew-core@ddfe5c7 |
What about #37 (comment) though? You said it was still an issue? |
If not, what are you asking me to try to reproduce? |
So which stdlib is now used at runtime? The one that ships with MacOS or one that you bundle with Anaconda? |
Anaconda's own build of libc++ is used exclusively in all of our modern packages. I fixed our clang and ld64 packages to make sure the system one is not used ever. |
Hopefully this problem will disappear once we switch to a more recent libv8: #48 |
This should result in a SyntaxError however it gives unknown reason with the new OSX toolchain.
This might be due to the libcxx mixing. The problem has appeared in the wild in lawn pkg.
The text was updated successfully, but these errors were encountered: