Skip to content

GH-55478: [R] Vendored dependencies to enable parquet (biggest change, smallest tarball) - #55492

Open
jonkeane wants to merge 2 commits into
apache:mainfrom
jonkeane:vendored_parquet2
Open

jonkeane wants to merge 2 commits into
apache:mainfrom
jonkeane:vendored_parquet2

Conversation

@jonkeane

@jonkeane jonkeane commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Rationale for this change

Vendor (and trim) C++ dependencies for offline builds that would allow us to build Parquet even when CMake cannot reach the internet. This one has larger reach (including changes to CMake), but results in a smaller tarball (~8.6 MB).

Resolves #55478

What changes are included in this PR?

Scripts for vendoring and trimming dependencies, tests

Are these changes tested?

Yes

Are there any user-facing changes?

More full-feature arrow builds

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

jonkeane and others added 2 commits November 10, 2026 19:14
…ecs, compute and JSON

Ship trimmed source tarballs of the thirdparty dependencies needed for
Parquet, the compression codecs, RE2/utf8proc, JSON and mimalloc in the R
package so that offline source builds (e.g. on CRAN) can include those
features instead of falling back to a minimal build.

* tools/vendor_dependencies.sh (run by `make sync-cpp`) downloads, trims
  and vendors the tarballs into tools/vendored, and records each one's
  upstream and trimmed checksums in tools/vendored/checksums.txt. A
  dependency can provide its own trim script at tools/trim/<name>.sh.
* When building the package's copy of the C++ source (tools/cpp),
  nixlibs.R uses the vendored tarballs that were trimmed from the
  versions that versions.txt pins, replacing their checksums in
  versions.txt with the trimmed ones. When offline, it only turns off the
  features whose dependencies aren't vendored.
* The offline CI job (now test-r-offline-vendored) checks that the
  expected features are available after the build.
* Add inst/COPYRIGHTS listing the vendored dependencies' licenses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R package

Vendoring all of the Boost libraries that the bundled Boost build uses
adds about 5 MB to the R package, even though Thrift (the only user of
Boost in a non-test build) only needs a handful of headers.

When Boost is only needed for Thrift (ARROW_BOOST_FOR_THRIFT_ONLY: no
tests, Gandiva or other Boost users, native 128-bit integers, threading,
not Windows), build_boost_headers_for_thrift() uses the Boost headers
without running Boost's CMake build, and add_thrift_minimal_library()
compiles only the Thrift sources that Parquet needs. Other builds use the
existing path unchanged.

This lets the R package vendor a Boost tarball of ~120 KB (the headers
reachable from Thrift) and a Thrift tarball of ~220 KB (only the C++
library sources), trimmed by tools/trim/boost.sh and tools/trim/thrift.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 01:39
@jonkeane

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-offline-vendored

@github-actions

Copy link
Copy Markdown

Revision: 1947743

Submitted crossbow builds: ursacomputing/crossbow @ actions-3e6fb863c3

Task Status
test-r-offline-vendored GitHub Actions

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Trimmed Boost/Thrift archives break configuration for threading-disabled builds, including webR, and persistent checksum changes can cause later installation retries with upstream archives to fail.

2 open issues
What changed in this PR

This PR expands vendored dependencies so offline R source builds can include Parquet and other non-cloud features, while trimming archives to limit package size.

Changes:

  • Adds dependency trimming, checksum tracking, and offline feature selection.
  • Introduces lightweight Boost and Thrift build paths in CMake.
  • Expands offline build checks and records third-party licensing.
File Description
r/​tools/​vendor_dependencies.sh Downloads, trims, and records checksums for expanded dependencies.
r/​tools/​trim/​thrift.sh Keeps Thrift sources needed by the minimal build.
r/​tools/​trim/​boost.sh Keeps Boost headers needed by Thrift.
r/​tools/​test-nixlibs.R Tests archive selection, checksum handling, and offline feature gating.
r/​tools/​nixlibs.R Selects vendored archives and preserves supported offline features.
r/​inst/​COPYRIGHTS Records vendored dependency licenses and copyrights.
r/​DESCRIPTION References the copyright inventory.
r/​.Rbuildignore Excludes download caches and trimming scripts from source packages.
r/​.gitignore Ignores cached upstream archives.
dev/​tasks/​tasks.yml Configures an offline build with expected vendored features.
dev/​release/​rat_exclude_files.txt Excludes the copyright inventory from license-header checks.
cpp/​cmake_modules/​ThirdpartyToolchain.cmake Adds header-only Boost and minimal Thrift build paths.
ci/​scripts/​r_test.sh Verifies expected capabilities and allocator backends.

Review effort: Balanced

Comment thread r/tools/nixlibs.R
# Point the build at the vendored sources of the thirdparty dependencies.
# Some of them are required even for a minimal build, so they can't be turned
# off like the ones above.
env_var_list <- with_vendored_dependencies(env_var_list, vendored)
Comment thread r/tools/nixlibs.R
# Some of them are required even for a minimal build, so they can't be turned
# off like the ones above.
env_var_list <- with_vendored_dependencies(env_var_list, vendored)
use_vendored_checksums(src_dir, env_var_list, vendored)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[R] Vendor trimmed thirdparty sources so offline (CRAN) source builds can include Parquet

2 participants