thisisnic commented on a change in pull request #10930: URL: https://github.com/apache/arrow/pull/10930#discussion_r696074580
########## File path: r/vignettes/developing.Rmd ########## @@ -483,60 +434,156 @@ variables or other settings: * All tests are skipped on Linux if the package builds without the C++ libarrow. To make the build fail if libarrow is not available (as in, to test that the C++ build was successful), set `TEST_R_WITH_ARROW=true` + * Some tests are disabled unless `ARROW_R_DEV=true` + * Tests that require allocating >2GB of memory to test Large types are disabled unless `ARROW_LARGE_MEMORY_TESTS=true` + * Integration tests against a real S3 bucket are disabled unless credentials are set in `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`; these are available on request + * S3 tests using [MinIO](https://min.io/) locally are enabled if the `minio server` process is found running. If you're running MinIO with custom settings, you can set `MINIO_ACCESS_KEY`, `MINIO_SECRET_KEY`, and `MINIO_PORT` to override the defaults. -## Github workflows +## Running checks + +You can run package checks by using `devtools::check()` and check test coverage with `covr::package_coverage()`. + +```r +# All package checks +devtools::check() + +# See test coverage statistics +covr::report() +covr::package_coverage() + +``` + +For full package validation, you can run the following commands from a terminal. + +``` +R CMD build . +R CMD check arrow_*.tar.gz --as-cran +``` + + +## Running additional CI checks On a pull request, there are some actions you can trigger by commenting on the PR. We have additional CI checks that run nightly and can be requested on demand using an internal tool called [crosssbow](https://arrow.apache.org/docs/developers/crossbow.html). A few important GitHub comment commands include: -* `@github-actions crossbow submit -g r` for all extended R CI tests -* `@github-actions crossbow submit {task-name}` for running a specific task. See the `r:` group definition near the beginning of the [crossbow configuration](https://github.com/apache/arrow/blob/master/dev/tasks/tasks.yml) for a list of glob expression patterns that match names of items in the `tasks:` list below it. -* `@github-actions autotune` will run and fix lint c++ linting errors + run R documentation (among other cleanup tasks) and commit them to the branch +#### Run all extended R CI tasks +`@github-actions crossbow submit -g r` +This runs each of the R-related CI tasks. -## Useful functions for Arrow developers +#### Run a specific task +`@github-actions crossbow submit {task-name}` -Within an R session, these can help with package development: +See the `r:` group definition near the beginning of the [crossbow configuration](https://github.com/apache/arrow/blob/master/dev/tasks/tasks.yml) for a list of glob expression patterns that match names of items in the `tasks:` list below it. -``` r -# Load the dev package -devtools::load_all() +#### Run linting and documentation building tasks -# Run the test suite, optionally filtering file names -devtools::test(filter="^regexp$") -# or the Makefile alternative from the arrow/r directory in a shell: -make test file=regexp +`@github-actions autotune` -# Update roxygen documentation -devtools::document() +This will run and fix lint C++ linting errors, run R documentation (among other cleanup tasks), and commit the resulting updates to the branch. -# To preview the documentation website -pkgdown::build_site() +# Troubleshooting -# All package checks; see also below -devtools::check() +Note that after any change to the C++ library, you must reinstall it and +run `make clean` or `git clean -fdx .` to remove any cached object code +in the `r/src/` directory before reinstalling the R package. This is +only necessary if you make changes to the C++ library source; you do not +need to manually purge object files if you are only editing R or C++ +code inside `r/`. -# See test coverage statistics -covr::report() -covr::package_coverage() +## Arrow library-R package mismatches + +If the Arrow library and the R package have diverged, you will see errors like: + +``` +Error: package or namespace load failed for ‘arrow' in dyn.load(file, DLLpath = DLLpath, ...): + unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so': + dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so, 6): Symbol not found: __ZN5arrow2io16RandomAccessFile9ReadAsyncERKNS0_9IOContextExx + Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so + Expected in: flat namespace + in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-r/00new/arrow/libs/arrow.so +Error: loading failed +Execution halted +ERROR: loading failed ``` -Any of those can be run from the command line by wrapping them in `R -e -'$COMMAND'`. There’s also a `Makefile` to help with some common tasks -from the command line (`make test`, `make doc`, `make clean`, etc.) +To resolve this, try rebuilding the Arrow library from [Building Arrow above](#step-3-building-arrow). -### Full package validation +## Multiple versions of Arrow library -``` shell -R CMD build . -R CMD check arrow_*.tar.gz --as-cran +If rebuilding the Arrow library doesn't work and you are [installing from a user-level directory](#configure-for-installing-to-a-user-directory) and you already have a previous installation of libarrow in a system directory or you get you may get errors like the following when you install the R package: Review comment: Have now rephrased this section a little. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
