This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new dd619adc4fd GH-51482: [R] allow building with shared snappy (#51490)
dd619adc4fd is described below

commit dd619adc4fd5fbaef71cc8e82c9a8e27c4b52b1b
Author: Nic Crane <[email protected]>
AuthorDate: Thu Nov 12 11:26:18 2026 -0500

    GH-51482: [R] allow building with shared snappy (#51490)
    
    ### Rationale for this change
    
    Couldn't build with shared snappy
    
    ### What changes are included in this PR?
    
    Allow it to be specified; default is `OFF`
    
    ### Are these changes tested?
    
    Will run CI
    
    ### Are there any user-facing changes?
    
    No
    
    ### Was AI used for this PR?
    
    In accordance to the [AI generation 
guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code),
 please disclose below whether and how AI was used in this PR.
    
    **PR code and description written by:**
    
    - [ ] Human
    - [x] AI
    
    **Reviewed before submission by:**
    
    - [x] Human
    - [x] AI
    - [ ] Not reviewed
    
    * GitHub Issue: #51482
    
    Authored-by: Nic Crane <[email protected]>
    Signed-off-by: Nic Crane <[email protected]>
---
 r/inst/build_arrow_static.sh | 2 +-
 r/tools/nixlibs.R            | 1 +
 r/vignettes/install.Rmd      | 5 +++++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh
index 34a607cfb6f..79010f98126 100755
--- a/r/inst/build_arrow_static.sh
+++ b/r/inst/build_arrow_static.sh
@@ -77,7 +77,7 @@ read -r -a ARROW_EXTRA_CMAKE_FLAGS <<< "${EXTRA_CMAKE_FLAGS}"
 mkdir -p "${BUILD_DIR}"
 pushd "${BUILD_DIR}"
 "${CMAKE_COMMAND[@]}" -DARROW_BOOST_USE_SHARED=OFF \
-    -DARROW_SNAPPY_USE_SHARED=OFF \
+    -DARROW_SNAPPY_USE_SHARED="${ARROW_SNAPPY_USE_SHARED:-OFF}" \
     -DARROW_BUILD_TESTS=OFF \
     -DARROW_BUILD_SHARED=OFF \
     -DARROW_BUILD_STATIC=ON \
diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R
index 226894372ec..a18fe43fb37 100644
--- a/r/tools/nixlibs.R
+++ b/r/tools/nixlibs.R
@@ -945,6 +945,7 @@ with_wasm_support <- function(env_var_list) {
     CMAKE_WRAPPER = "emcmake",
     ARROW_DEPENDENCY_SOURCE = "BUNDLED",
     ARROW_DEPENDENCY_USE_SHARED = "OFF",
+    ARROW_SNAPPY_USE_SHARED = "OFF",
     ARROW_ENABLE_THREADING = "OFF",
     ARROW_GCS = "OFF",
     ARROW_AZURE = "OFF",
diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd
index 099ed6d3580..77d39fd7af4 100644
--- a/r/vignettes/install.Rmd
+++ b/r/vignettes/install.Rmd
@@ -196,6 +196,11 @@ uses only system-installed dependencies (when set to 
`SYSTEM`) or checks
 system-installed dependencies first and only installs dependencies which aren't
 already present (when set to `AUTO`, the default).
 
+Snappy is an exception: by default it is always linked statically, even when
+`ARROW_DEPENDENCY_SOURCE` is `SYSTEM`. If your system only provides a shared
+`libsnappy`, set `ARROW_SNAPPY_USE_SHARED=ON` to link against it; the library
+must then be present at runtime.
+
 These dependencies vary by platform; however, if you wish to install these
 yourself prior to libarrow installation, we recommend that you take a look at
 the [docker file for whichever of our CI 
builds](https://github.com/apache/arrow/tree/main/ci/docker)

Reply via email to