r-dbi / RPostgres

A DBI-compliant interface to PostgreSQL
https://rpostgres.r-dbi.org
Other
334 stars 78 forks source link

chore: Replace Rcpp by cpp11 #419

Closed Antonov548 closed 1 year ago

Antonov548 commented 1 year ago

Thanks. What does the C stack overflow on macOS mean?

It's seems known problem, I will take a look. The same problem on Mac was with cpp11.

pachadotdev commented 1 year ago

Thanks. What does the C stack overflow on macOS mean?

It's seems known problem, I will take a look. The same problem on Mac was with cpp11.

I've been testing this PR and it works well

also, it solves https://github.com/r-dbi/RPostgres/issues/400

krlmlr commented 1 year ago

Thanks. We need to fix the stack overflow on macOS.

pachadotdev commented 1 year ago

@Antonov548 I tested locally and it works. The CI shows a problem with CRAN links, I googled and I found this https://github.com/r-lib/actions/issues/697. Lmk how can I help to fix this.

pachadotdev commented 1 year ago

@Antonov548 it seems to be ok now https://github.com/r-lib/actions/issues/697#issuecomment-1420383340

all the checks here are passing

so far, I am using this PR wih my usual data analysis and it works

Antonov548 commented 1 year ago

@krlmlr Fixed πŸ‘

pachadotdev commented 1 year ago

@krlmlr @Antonov548 I pulled the last changes. It works well with Ubuntu 20.04.

Here's the full check

> check()
β„Ή Updating RPostgres documentation
β„Ή Loading RPostgres
β„Ή 26 functions decorated with [[cpp11::register]]
βœ” generated file cpp11.R
βœ” generated file cpp11.cpp
β„Ή Re-compiling RPostgres (debug build)
── R CMD INSTALL ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─  installing *source* package β€˜RPostgres’ ...
   ** using staged installation
   Found pkg-config cflags and libs (libpq 15.1)!
   Using PKG_CFLAGS=-I/usr/include/postgresql
   Using PKG_LIBS=-lpq
   Using PKG_PLOGR=
   ** libs
   g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/postgresql -Ivendor -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR  -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/plogr/include'   -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-a3XuZ5/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c connection.cpp -o connection.o
   g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/postgresql -Ivendor -DRCPP_DEFAULT_INCLUDE_CALL=false -DRCPP_USING_UTF8_ERROR_STRING -DBOOST_NO_AUTO_PTR  -I'/usr/lib/R/site-library/cpp11/include' -I'/usr/lib/R/site-library/plogr/include'   -fvisibility=hidden -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-a3XuZ5/r-base-4.2.2.20221110=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2  -UNDEBUG -Wall -pedantic -g -O0 -fdiagnostics-color=always -c cpp11.cpp -o cpp11.o
   g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RPostgres.so DbColumn.o DbColumnDataSource.o DbColumnDataSourceFactory.o DbColumnStorage.o DbConnection.o DbDataFrame.o DbResult.o PqColumnDataSource.o PqColumnDataSourceFactory.o PqDataFrame.o PqResult.o PqResultImpl.o PqResultSource.o PqUtils.o RPostgres-init.o connection.o cpp11.o encode.o encrypt.o logging.o result.o -lpq -L/usr/lib/R/lib -lR
   installing to /tmp/RtmpkE2Ned/devtools_install_1be4a5bff7354/00LOCK-RPostgres/00new/RPostgres/libs
   ** checking absolute paths in shared objects and dynamic libraries
─  DONE (RPostgres)
── Building ───────────────────────────────────────────────────────────────────────────────────────────────────────── RPostgres ──
Setting env vars:
β€’ CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
β€’ CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
β€’ CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
β€’ CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
── R CMD build ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
βœ”  checking for file β€˜/home/pacha/github/RPostgres/DESCRIPTION’ ...
─  preparing β€˜RPostgres’:
βœ”  checking DESCRIPTION meta-information ...
─  cleaning src
─  installing the package to build vignettes
βœ”  creating vignettes (19.6s)
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building β€˜RPostgres_1.4.5.9003.tar.gz’

── Checking ─────────────────────────────────────────────────────────────────────── RPostgres ──
Setting env vars:
β€’ _R_CHECK_CRAN_INCOMING_USE_ASPELL_: TRUE
β€’ _R_CHECK_CRAN_INCOMING_REMOTE_    : FALSE
β€’ _R_CHECK_CRAN_INCOMING_           : FALSE
β€’ _R_CHECK_FORCE_SUGGESTS_          : FALSE
β€’ NOT_CRAN                          : true
── R CMD check ─────────────────────────────────────────────────────────────────────────────────
─  using log directory β€˜/tmp/RtmpkE2Ned/RPostgres.Rcheck’
─  using R version 4.2.2 Patched (2022-11-10 r83330)
─  using platform: x86_64-pc-linux-gnu (64-bit)
─  using session charset: UTF-8
─  using options β€˜--no-manual --as-cran’ (842ms)
βœ”  checking for file β€˜RPostgres/DESCRIPTION’
─  this is package β€˜RPostgres’ version β€˜1.4.5.9003’
─  package encoding: UTF-8
βœ”  checking package namespace information
βœ”  checking package dependencies (989ms)
βœ”  checking if this is a source package ...
βœ”  checking if there is a namespace
βœ”  checking for executable files (1.5s)
βœ”  checking for hidden files and directories ...
βœ”  checking for portable file names ...
βœ”  checking for sufficient/correct file permissions ...
βœ”  checking serialization versions
─  checking whether package β€˜RPostgres’ can be installed ... [25s/25s] OK (25s)
N  checking installed package size ...
     installed size is  5.8Mb
     sub-directories of 1Mb or more:
       libs   5.3Mb
βœ”  checking package directory
βœ”  checking for future file timestamps ...
βœ”  checking β€˜build’ directory ...
βœ”  checking DESCRIPTION meta-information ...
N  checking top-level files ...
     possible bashism in configure line 21 ('command' with option other than -p):
     if [ `uname` = "Darwin" ] && [ `command -v pkg-config` ]; then
     possible bashism in configure line 38 ('command' with option other than -p):
     if [ -z "$FORCE_AUTOBREW" ] && [ `command -v pkg-config` ]; then
     possible bashism in configure line 58 ('command' with option other than -p):
     if [ -z "$FORCE_AUTOBREW" ] && [ `command -v pg_config` ]; then
βœ”  checking for left-over files ...
βœ”  checking index information ...
βœ”  checking package subdirectories ...
βœ”  checking R files for non-ASCII characters ...
βœ”  checking R files for syntax errors ...
βœ”  checking whether the package can be loaded (396ms)
βœ”  checking whether the package can be loaded with stated dependencies ...
βœ”  checking whether the package can be unloaded cleanly ...
βœ”  checking whether the namespace can be loaded with stated dependencies ...
βœ”  checking whether the namespace can be unloaded cleanly (413ms)
βœ”  checking loading without being on the library search path (405ms)
βœ”  checking dependencies in R code (588ms)
βœ”  checking S3 generic/method consistency (741ms)
βœ”  checking replacement functions (352ms)
βœ”  checking foreign function calls (422ms)
βœ”  checking R code for possible problems (3.9s)
βœ”  checking Rd files ...
βœ”  checking Rd metadata ...
βœ”  checking Rd line widths ...
βœ”  checking Rd cross-references ...
βœ”  checking for missing documentation entries (431ms)
βœ”  checking for code/documentation mismatches (1.2s)
βœ”  checking Rd \usage sections (893ms)
βœ”  checking Rd contents ...
βœ”  checking for unstated dependencies in examples ...
βœ”  checking line endings in shell scripts
βœ”  checking line endings in C/C++/Fortran sources/headers ...
βœ”  checking line endings in Makefiles
βœ”  checking compilation flags in Makevars ...
βœ”  checking for GNU extensions in Makefiles ...
βœ”  checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS)
βœ”  checking use of PKG_*FLAGS in Makefiles ...
βœ”  checking use of SHLIB_OPENMP_*FLAGS in Makefiles ...
βœ”  checking pragmas in C/C++ headers and code ...
βœ”  checking compilation flags used ...
βœ”  checking compiled code ...
βœ”  checking installed files from β€˜inst/doc’ ...
βœ”  checking files in β€˜vignettes’
βœ”  checking examples (991ms)
βœ”  checking for unstated dependencies in β€˜tests’ ...
─  checking tests ...
βœ”  Running β€˜testthat.R’ (1.2s)
βœ”  checking for unstated dependencies in vignettes ...
βœ”  checking package vignettes in β€˜inst/doc’ ...
βœ”  checking re-building of vignette outputs (1s)
βœ”  checking for non-standard things in the check directory ...
βœ”  checking for detritus in the temp directory

   See
     β€˜/tmp/RtmpkE2Ned/RPostgres.Rcheck/00check.log’
   for details.

── R CMD check results ───────────────────────────────────────────────────────────────────────────────── RPostgres 1.4.5.9003 ────
Duration: 46.5s

❯ checking installed package size ... NOTE
    installed size is  5.8Mb
    sub-directories of 1Mb or more:
      libs   5.3Mb

❯ checking top-level files ... NOTE
    possible bashism in configure line 21 ('command' with option other than -p):
    if [ `uname` = "Darwin" ] && [ `command -v pkg-config` ]; then
    possible bashism in configure line 38 ('command' with option other than -p):
    if [ -z "$FORCE_AUTOBREW" ] && [ `command -v pkg-config` ]; then
    possible bashism in configure line 58 ('command' with option other than -p):
    if [ -z "$FORCE_AUTOBREW" ] && [ `command -v pg_config` ]; then

0 errors βœ” | 0 warnings βœ” | 2 notes βœ–
pachadotdev commented 1 year ago

@krlmlr @Antonov548 I send a PR to fix the notes about bashisms

krlmlr commented 1 year ago

Thanks!