RSQLite icon indicating copy to clipboard operation
RSQLite copied to clipboard

Replace Rcpp by cpp11

Open mgirlich opened this issue 3 years ago • 4 comments

I think it might be worth switching from Rcpp to cpp11. See Motivations for cpp11 for some reasons. Compilation is now much faster (~28s vs ~52s) and I think it is mostly easier to work with cpp11.

To Do

  • [ ] busy_callback_helper() -> how to catch eval error and interrupt?
  • [ ] result_release() -> make this work with cpp11::external_pointer
  • [ ] find replacement for Rcpp::warningcall(R_NilValue, std::string("Ignoring remaining part of query: ") + tail);
  • [ ] figure out why cpp11::warning() crashes
  • [ ] adapt astyle()
  • [ ] get_column_info() can probably directly use cpp11::dataframe
  • [ ] maybe remove some STRICT_R_HEADERS and R_NO_REMAP

mgirlich avatar Nov 09 '21 15:11 mgirlich

Thanks! Compilation on gcc fails, could you please take a look?

krlmlr avatar Dec 06 '21 04:12 krlmlr

I could not reproduce it locally so I just hope this works.

mgirlich avatar Dec 06 '21 07:12 mgirlich

Thanks, appreciated.

on.exit(after = ) requires recent-ish R, we can use withr::defer() instead to fix the oldrel-4 failures.

I've added a test for the interrupt behavior to https://github.com/r-dbi/RSQLite/pull/401. Is this problem solvable, do we need a change to cpp11? Are there any downsides to vendoring the cpp11 package?

pch.h helps speed up building locally, through precompiled headers. It's important that this is the first preprocessor statement in each module. You can edit this file instead of making the changes in all files. (I need to remember how this is used, though.)

I don't fully understand the other check items yet.

krlmlr avatar Jan 03 '22 04:01 krlmlr

I'll finish this, thanks!

krlmlr avatar Apr 12 '22 15:04 krlmlr