Skip to content

GH-49981: [R][Packaging] Support building R package under r-universe/r-wasm#49982

Open
amoeba wants to merge 5 commits into
apache:mainfrom
amoeba:r-wasm-r-universe
Open

GH-49981: [R][Packaging] Support building R package under r-universe/r-wasm#49982
amoeba wants to merge 5 commits into
apache:mainfrom
amoeba:r-wasm-r-universe

Conversation

@amoeba
Copy link
Copy Markdown
Member

@amoeba amoeba commented May 18, 2026

Rationale for this change

Arrow C++ already supports Emscripten but the R package can't be built by either the r-wasm or r-universe projects in its current state. We just need to make the bundled build Emscripten aware we're in an Emscripten environment for this to work.

What changes are included in this PR?

  • Adds Wasm detection to nixlibs.R
  • Makes build_arrow_static.sh Emscripten-aware by adding support for being called with a wrapper program
  • Adds a new crossbow job to test building the R package with r-wasm in the r-universe container

Are these changes tested?

Yes. The R package builds in a local docker r-wasm-based container as well as in Crossbow

Are there any user-facing changes?

No.

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 18, 2026

@github-actions crossbow submit test-r-r-universe-wasm

@github-actions
Copy link
Copy Markdown

Revision: 18fe759

Submitted crossbow builds: ursacomputing/crossbow @ actions-8ee2d3b170

Task Status
test-r-r-universe-wasm GitHub Actions

@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 18, 2026

@github-actions crossbow submit test-r-r-universe-wasm

@github-actions
Copy link
Copy Markdown

Revision: a2fa12a

Submitted crossbow builds: ursacomputing/crossbow @ actions-4178688350

Task Status
test-r-r-universe-wasm GitHub Actions

@amoeba amoeba force-pushed the r-wasm-r-universe branch from a2fa12a to 5ee8457 Compare May 18, 2026 01:08
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 18, 2026

@github-actions crossbow submit test-r-r-universe-wasm

@github-actions
Copy link
Copy Markdown

Revision: 5ee8457

Submitted crossbow builds: ursacomputing/crossbow @ actions-3963128ccf

Task Status
test-r-r-universe-wasm GitHub Actions

@amoeba amoeba changed the title GH-49981: [R][Packaging] Support building R package under Emscripten GH-49981: [R][Packaging] Support building R package under r-universe/r-wasm May 18, 2026
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 18, 2026

@github-actions crossbow submit test-r-r-universe-wasm

@github-actions
Copy link
Copy Markdown

Revision: 5ee8457

Submitted crossbow builds: ursacomputing/crossbow @ actions-8c87567db5

Task Status
test-r-r-universe-wasm GitHub Actions

@amoeba amoeba marked this pull request as ready for review May 18, 2026 02:18
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 18, 2026

@github-actions crossbow submit test-r-r-universe-wasm

@github-actions
Copy link
Copy Markdown

Revision: b37e9d0

Submitted crossbow builds: ursacomputing/crossbow @ actions-0aa60bce30

Task Status
test-r-r-universe-wasm GitHub Actions

Copy link
Copy Markdown
Member

@jonkeane jonkeane left a comment

Choose a reason for hiding this comment

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

Thanks for this! One comment about naming and then mostly questions for my understanding. This is exciting to see working!

Comment thread dev/tasks/tasks.yml Outdated
env:
CMAKE_BUILD_TYPE: MinSizeRel

test-r-r-universe-wasm:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
test-r-r-universe-wasm:
test-r-universe-wasm:

I know how we got here, but the -r-r- seemed a little silly. We could also call this test-r-wasm yeah? I know we are using r-universe's build machinery to accomplish this, but it's really the only r + wasm test right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

:) test-r-wasm sounds good.

Comment thread r/inst/build_arrow_static.sh Outdated
Comment on lines +80 to +82
-DARROW_DEPENDENCY_USE_SHARED=${ARROW_DEPENDENCY_USE_SHARED:-ON} \
-DARROW_ENABLE_THREADING=${ARROW_ENABLE_THREADING:-ON} \
-DARROW_FLIGHT=${ARROW_FLIGHT:-OFF} \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Were these defaults we were getting already via the cmake? Or are these actually enabling / disabling things?

OH, I see for ARROW_ENABLE_THREADING that would have defaulted to on, but we need to set it to off for wasm in nixlibs.r and same with ARROW_DEPENDENCY_USE_SHARED. But what about ARROW_FLIGHT ? It doesn't look like that is (over)ridden down below? I'm fine with it being here (I think it would default to off), but that's slightly separate from this PR, yeah? Or am I missing something?

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting review Awaiting review labels May 19, 2026
@amoeba
Copy link
Copy Markdown
Member Author

amoeba commented May 19, 2026

@github-actions crossbow submit test-r-wasm

@github-actions github-actions Bot removed the awaiting changes Awaiting changes label May 19, 2026
@github-actions github-actions Bot added the awaiting change review Awaiting change review label May 19, 2026
@github-actions
Copy link
Copy Markdown

Revision: 7eb72ac

Submitted crossbow builds: ursacomputing/crossbow @ actions-df03aafab4

Task Status
test-r-wasm GitHub Actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants