Repository navigation
Conversation
Bundle nanoarrow 0.9.0 in `src/vendor/nanoarrow/` and link it into the package, with no code calling it yet. The symbols carry the `RPostgres` namespace prefix, and `-DNANOARROW_DLL=` keeps them out of the shared object's exports. `inst/COPYRIGHTS` and `inst/licenses/` install the Apache-2.0 terms, and DESCRIPTION lists the ASF as copyright holder. `src/vendor/nanoarrow/README.md` describes how to update the copy. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
Question: add
|
Question: one copy of the nanoarrow licence and NOTICE, or two?
Generated by Claude Code |
`R CMD INSTALL --preclean` runs `make shlib-clean`, which removes only `$(OBJECTS)`, so both Makevars files now hook a step into it that removes `vendor/nanoarrow/nanoarrow.o`. `src/custom.cmake`, which the generated `CMakeLists.txt` includes, adds the vendored sources and `NANOARROW_DLL=` for IDE builds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
The implicit rule took `-fvisibility=hidden` from `PKG_CFLAGS`, so dropping that variable from `src/Makevars.in` would export the library's symbols. The recipe now passes `$(C_VISIBILITY)` and `-DNANOARROW_DLL=` itself. `src/Makevars.win` needs no change, because the Windows export list is built from `$(OBJECTS)` only and the object is linked via `PKG_LIBS`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
Resolves the conflict in `.Rbuildignore` by keeping the entries from both sides. The explicit recipe for `nanoarrow.o` keeps its symbols hidden now that `main` no longer sets `PKG_CFLAGS` (#647). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
|
I merged #647 has since removed
Generated by Claude Code |
This PR bundles the nanoarrow 0.9.0 C library in
src/vendor/nanoarrow/and compiles and links it into the package. No code calls it yet, so the PR changes no behavior. It is the groundwork for native Arrow support, coordinated in #631: the next steps can then build Arrow arrays and streams in C without a runtime dependency on the nanoarrow R package's C API.What changes:
src/vendor/nanoarrow/holdsnanoarrow.c,nanoarrow.handnanoarrow.hppfrom the CRAN sources of nanoarrow 0.9.0, plusLICENSE.txtandNOTICE.txtfrom the release tagapache-arrow-nanoarrow-0.9.0and aREADME.md. The only delta against upstream is the line#define NANOARROW_NAMESPACE RPostgresinnanoarrow.h(upstream:RPkg), so the symbols carry anRPostgresprefix and cannot collide with the copies in nanoarrow, arrow, or RSQLite.src/Makevars.inandsrc/Makevars.winbuildvendor/nanoarrow/nanoarrow.o, link it into the shared object, and pass-DNANOARROW_DLL=so that the library's symbols stay hidden. Insrc/Makevars.inthe object has an explicit recipe that passes$(C_VISIBILITY)and-DNANOARROW_DLL=itself, so its symbols stay hidden even withoutPKG_CFLAGS, which #647 drops;src/Makevars.winneeds no such recipe because the Windows export list comes from$(OBJECTS)alone. The object goes throughPKG_LIBSrather thanOBJECTS, which keeps it out of the symbol scan that builds the Windows export list. Both Makevars files hook a step intoshlib-cleanthat removes the object, becauseR CMD INSTALL --precleanremoves only$(OBJECTS).src/custom.cmakeadds the vendored sources andNANOARROW_DLL=for IDE builds, since the generatedCMakeLists.txtlists only the top-level sources..Rbuildignorekeeps the object out of the tarball, and.covrignorekeeps the vendored code out of coverage.inst/COPYRIGHTSandinst/licenses/install the Apache-2.0 terms and NOTICE with the package.inst/COPYRIGHTSalso records the bundled Boost subset, which had no record so far. DESCRIPTION getsCopyright: See file COPYRIGHTS.and lists the Apache Software Foundation ascph. The fetch path (src/PqResultImpl.*,PqColumn*,DbColumn*) is untouched.This mirrors r-dbi/RSQLite#857, with the same layout, namespace patch, licence files and update procedure. Its review findings are applied up front: the licence and NOTICE are installed with the package, the object depends on the header in Makevars, and the README gives a verifiable update procedure. RSQLite's LGPL-2.1 compatibility question does not arise here, because RPostgres is MIT-licensed, which can be combined with Apache-2.0 code. As in RSQLite#857,
LinkingTo: nanoarrowis left out for now (see the question comment below).To update the vendored copy, follow
src/vendor/nanoarrow/README.md: copy the three sources from the new nanoarrow CRAN tarball, restore the namespace line, copy the licence files to both places, then check that the diff against upstream is just the namespace line and thatnm -D --defined-only src/RPostgres.so | grep -i arrowprints nothing.Tested locally on Ubuntu 24.04 with gcc 13.3 and R 4.5.3.
R CMD buildandR CMD check --no-manualagainst a local PostgreSQL 16 gave[ FAIL 0 | WARN 0 | SKIP 11 | PASS 9182 ]and one NOTE about a hidden.git, which is the.gitfile of the git worktree the check ran from, not something the package ships. The tarball contains no.ofile.nm -D --defined-onlyshows no exported symbol containing "arrow"; the 75 nanoarrow functions are present as localRPostgresArrow*symbols. The shared object grows by about 210 KB.R CMD INSTALL --precleanin the checkout recompilesnanoarrow.o, and CMake configures and compilesnanoarrow.conce the stalelogging.cppentry, which is already onmain, is left out. A local merge with #647's branch also exports no arrow symbol, andR CMD check --no-manual --no-testson it reports noPKG_*FLAGSNOTE. CI on Windows and macOS has not run yet.Coordinated in #631. Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
Generated by Claude Code