jonkeane commented on a change in pull request #9898: URL: https://github.com/apache/arrow/pull/9898#discussion_r610958713
########## File path: r/vignettes/dev-docs.Rmd ########## @@ -0,0 +1,349 @@ +--- +title: "Arrow R Package Developer Documentation" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Arrow R Package Developer Documentation} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r setup options, include=FALSE} +knitr::opts_chunk$set(error = TRUE, eval = FALSE) + +# Get environment variables describing what to evaluate +run <- tolower(Sys.getenv("RUN_DEVDOCS", "false")) == "true" +macos <- tolower(Sys.getenv("DEVDOCS_MACOS", "false")) == "true" +ubuntu <- tolower(Sys.getenv("DEVDOCS_UBUNTU", "false")) == "true" +sys_install <- tolower(Sys.getenv("DEVDOCS_SYSTEM_INSTALL", "false")) == "true" + +# Update the source knit_hook to save the chunk (if it is marked to be saved) +knit_hooks_source <- knitr::knit_hooks$get("source") +knitr::knit_hooks$set(source = function(lines, options) { + # Extra paranoia about when this will write the chunks to the script, we will + # only save when: + # * CI is true + # * RUN_DEVDOCS is true + # * options$save is TRUE (and a check that not NULL won't crash it) + if (as.logical(Sys.getenv("CI", FALSE)) && run && !is.null(options$save) && options$save) + cat(lines, file = "script.sh", append = TRUE, sep = "\n") + NULL +}) +``` + +```{bash, save=run} +# Stop on failure, echo input as we go +set -e +set -x +``` + +## R-only development + +Windows and macOS users who wish to contribute to the R package and +don’t need to alter the Arrow C++ library may be able to obtain a +recent version of the library without building from source. On macOS, +you may install the C++ library using [Homebrew](https://brew.sh/): + +``` shell +# For the released version: +brew install apache-arrow +# Or for a development version, you can try: +brew install apache-arrow --HEAD +``` + +On Windows, you can download a .zip file with the arrow dependencies from the +[nightly repository](https://arrow-r-nightly.s3.amazonaws.com/libarrow/bin/windows/), +and then set the `RWINLIB_LOCAL` environment variable to point to that +zip file before installing the `arrow` R package. Version numbers in that +repository correspond to dates, and you will likely want the most recent. + +## Developer envorinment setup + +If you need to alter both the Arrow C++ library and the R package code, or if you can’t get a binary version of the latest C++ library elsewhere, you’ll need to build it from source too. + +First, install the C++ library. See the [developer +guide](https://arrow.apache.org/docs/developers/cpp/building.html) for details. + +### Install dependencies {.tabset} Review comment: We might not want to take it on, but with https://github.com/apache/arrow/blob/84771514e05db8ef959f6cdfacb4aeb337a55bad/r/pkgdown/extra.js it will make the next heading down tabbed when the pkgdown site renders. To see it in action (without pulling this branch + compling pkgdown yourself), it'll be similar to how the different SQL dialects have tabs two code blocks down at https://dittodb.jonkeane.com/#a-quick-example -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org