Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cpp/cmake_modules/SetupCxxFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
"${ARROW_EMSCRIPTEN_LINKER_FLAGS} -sERROR_ON_WASM_CHANGES_AFTER_LINK=1 -sSTACK_SIZE=${ARROW_EMSCRIPTEN_TEST_STACK_SIZE} -sALLOW_MEMORY_GROWTH -lnodefs.js -lnoderawfs.js --pre-js ${BUILD_SUPPORT_DIR}/emscripten-test-init.js"
)
endif()
# Abseil stack trace via emscripten_stack_snapshot() abort on Emscripten<4.0.14
# if offset converter isn't enabled. Emscripten 4.0.14 removed the offset converter
if(EMSCRIPTEN_VERSION VERSION_LESS "4.0.14")

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.

4.0.14 seems to be more than 1 year old. Should we care about older versions?
https://github.com/emscripten-core/emscripten/releases/tag/4.0.14
Was this caught failing on our CI?

@tadeja tadeja Nov 5, 2026 •

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.

You can see the failure there #55381 (comment)
= after committing 014f1de StrptimeParser fix for preexisting arrow-utility-test failure
https://github.com/ursacomputing/crossbow/actions/runs/41708868200/job/126171352370#step:7:4835

Details

[ RUN      ] FunctionMapping.ValidCases
Aborted(Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER)
/build/cpp/debug/arrow-substrait-substrait-test.js:138
      throw ex;
      ^

RuntimeError: Aborted(Cannot use convertFrameToPC (needed by __builtin_return_address) without -sUSE_OFFSET_CONVERTER). Build with -sASSERTIONS for more info.
    at abort (/build/cpp/debug/arrow-substrait-substrait-test.js:491:11)
    at convertFrameToPC (/build/cpp/debug/arrow-substrait-substrait-test.js:4582:7)
    at /build/cpp/debug/arrow-substrait-substrait-test.js:4593:18
    at Array.forEach (<anonymous>)
    at saveInUnwindCache (/build/cpp/debug/arrow-substrait-substrait-test.js:4592:17)
    at _emscripten_stack_snapshot (/build/cpp/debug/arrow-substrait-substrait-test.js:4621:7)
    at arrow-substrait-substrait-test.wasm.absl::lts_20260817::GetStackTrace(void**, int, int) (wasm://wasm/arrow-substrait-substrait-test.wasm-1625979a:wasm-function[53487]:0x3040e7a)
    at arrow-substrait-substrait-test.wasm.absl::lts_20260817::(anonymous namespace)::GetStack(void**, int) (wasm://wasm/arrow-substrait-substrait-test.wasm-1625979a:wasm-function[53468]:0x303da31)
    at arrow-substrait-substrait-test.wasm.absl::lts_20260817::synchronization_internal::GraphCycles::UpdateStackTrace(absl::lts_20260817::synchronization_internal::GraphId, int, int (*)(void**, int)) (wasm://wasm/arrow-substrait-substrait-test.wasm-1625979a:wasm-function[53499]:0x30443c0)
    at invoke_vijii (/build/cpp/debug/arrow-substrait-substrait-test.js:6194:29)

Node.js v24.19.0

      Start 85: arrow-substrait-substrait-test
    Test #85: arrow-substrait-substrait-test ............***Failed    0.46 sec

And no, the failing arrow-substrait-substrait-test couldn't be seen on CI because it started with #54927 (Abseil bump),
so exactly at the same time as Protobuf CMake configure failure due to the same PR #54927 (Protobuf bumpf)

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.

@raulcd Shall we try changing Emscripten pin from 3.1.45 to 4.0.14 (or newer)?

ARG emscripten_version="3.1.45"

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.

Thanks @tadeja. I think we should certainly bump that to latest (it has not changed in 3 years). What about:

  • we open a new issue tracking the bump on a separate issue/PR.
  • we merge this as is, maybe add a comment on this line pointing to the new issue to bump se we remove this if check afterwards.

@tadeja tadeja Nov 5, 2026 •

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.

Yup, we could merge this PR as is!
I'm already testing Emscripten 4.0.14 + if check removed separately in #55414 (and later perhaps 5.0.3 too. I'll open a new PR + issue depending on results).

string(APPEND CMAKE_EXE_LINKER_FLAGS " -sUSE_OFFSET_CONVERTER=1")
endif()
else()
set(CMAKE_EXE_LINKER_FLAGS "${ARROW_EMSCRIPTEN_LINKER_FLAGS} -sALLOW_MEMORY_GROWTH")
endif()
Expand Down
17 changes: 0 additions & 17 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2060,25 +2060,8 @@ function(build_protobuf)
"${PROTOBUF_INCLUDE_DIR}"
PARENT_SCOPE)

set(PROTOBUF_PATCH_COMMAND)
if(EMSCRIPTEN)
find_program(PATCH patch)
if(PATCH)
set(PROTOBUF_PATCH_COMMAND ${PATCH} -p1 -i)
else()
find_program(GIT git)
if(GIT)
set(PROTOBUF_PATCH_COMMAND ${GIT} apply)
endif()
endif()
if(PROTOBUF_PATCH_COMMAND)
list(APPEND PROTOBUF_PATCH_COMMAND
${CMAKE_CURRENT_LIST_DIR}/protobuf-emscripten.patch)
endif()
endif()
fetchcontent_declare(protobuf
${FC_DECLARE_COMMON_OPTIONS} OVERRIDE_FIND_PACKAGE
PATCH_COMMAND ${PROTOBUF_PATCH_COMMAND}
URL ${PROTOBUF_SOURCE_URL}
URL_HASH "SHA256=${ARROW_PROTOBUF_BUILD_SHA256_CHECKSUM}")

Expand Down
39 changes: 0 additions & 39 deletions cpp/cmake_modules/protobuf-emscripten.patch

This file was deleted.

4 changes: 4 additions & 0 deletions cpp/src/arrow/util/value_parsing_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,10 @@ TEST(TimestampParser, StrptimeParser) {
// Leap seconds are rejected, as by the
// ISO-8601 parser
"5/31/2000 12:30:60", "5/31/2000 23:59:60", "5/31/2000 23:59:61"};
#ifdef __EMSCRIPTEN__
// Emscripten's strptime() normalizes invalid dates/times. See GH-55397
unparseables = {"foo", "5/1/2000", "5/1/2000 12:34:56:6"};
#endif
for (auto& value : unparseables) {
int64_t dummy;
ASSERT_FALSE((*parser)(value.c_str(), value.size(), TimeUnit::SECOND, &dummy));
Expand Down
Loading