This is an automated email from the ASF dual-hosted git repository.
raulcd 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 802102addbb GH-55380: [C++][CI] Fix Emscripten nightly jobs after
Protobuf/Abseil bump (#55381)
802102addbb is described below
commit 802102addbbbc386ef24e4c46d90644efe46a17d
Author: tadeja <[email protected]>
AuthorDate: Thu Nov 5 12:33:21 2026 +0100
GH-55380: [C++][CI] Fix Emscripten nightly jobs after Protobuf/Abseil bump
(#55381)
### Rationale for this change
Fix #55380 - recently #54927 bumped Protobuf from 31.1 to 36.2 which fails
applying of `protobuf-emscripten.patch`.
Then the job `test-ubuntu-22.04-cpp-emscripten` has two more failures:
- `arrow-utility-test` (`TimestampParser.StrptimeParser`) failing since
#54657,
- and `arrow-substrait-substrait-test` after Abseil bump in #54927
### What changes are included in this PR?
- Remove protobuf Emscripten patch, Protobuf 36.2 no longer needs it
- Skip the impossible date and leap second cases on Emscripten for
`TimestampParser.StrptimeParser` in `arrow-utility-test`
- Link Emscipten test executables with `-sUSE_OFFSET_CONVERTER=1` when <
4.0.14 (setting removed with Emscripten 4.0.14) for
`arrow-substrait-substrait-test` to pass
### Are these changes tested?
Yes, both emscripten jobs pass.
### Are there any user-facing changes?
No.
### Was AI used for this PR?
**PR code and description written by:**
- [X] Human
- [X] AI
**Reviewed before submission by:**
- [X] Human
- [x] AI
- [ ] Not reviewed
* GitHub Issue: #55380
Lead-authored-by: Tadeja Kadunc <[email protected]>
Co-authored-by: tadeja <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
cpp/cmake_modules/SetupCxxFlags.cmake | 5 ++++
cpp/cmake_modules/ThirdpartyToolchain.cmake | 17 -------------
cpp/cmake_modules/protobuf-emscripten.patch | 39 -----------------------------
cpp/src/arrow/util/value_parsing_test.cc | 4 +++
4 files changed, 9 insertions(+), 56 deletions(-)
diff --git a/cpp/cmake_modules/SetupCxxFlags.cmake
b/cpp/cmake_modules/SetupCxxFlags.cmake
index 750e3bef29c..350eda322e1 100644
--- a/cpp/cmake_modules/SetupCxxFlags.cmake
+++ b/cpp/cmake_modules/SetupCxxFlags.cmake
@@ -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")
+ 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()
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 40343415b36..123def5b66c 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -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}")
diff --git a/cpp/cmake_modules/protobuf-emscripten.patch
b/cpp/cmake_modules/protobuf-emscripten.patch
deleted file mode 100644
index 650af873ee1..00000000000
--- a/cpp/cmake_modules/protobuf-emscripten.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
---- a/src/google/protobuf/port_def.inc
-+++ b/src/google/protobuf/port_def.inc
-@@ -435,13 +435,15 @@
- # endif
- #else
--# if defined(__cpp_constinit) && !defined(__CYGWIN__)
-+// Emscripten's libc++ std::string is not constexpr-constructible (heap
alloc).
-+# if defined(__cpp_constinit) && !defined(__CYGWIN__) &&
!defined(__EMSCRIPTEN__)
- # define PROTOBUF_CONSTINIT constinit
- # define PROTOBUF_CONSTEXPR constexpr
- # define PROTOBUF_CONSTINIT_DEFAULT_INSTANCES
- // Some older Clang versions incorrectly raise an error about
- // constant-initializing weak default instance pointers. Versions 12.0 and
- // higher seem to work, except that XCode 12.5.1 shows the error even though
it
- // uses Clang 12.0.5.
--#elif !defined(__CYGWIN__) && !defined(__MINGW32__) && \
-+#elif !defined(__CYGWIN__) && !defined(__MINGW32__) && \
-+ !defined(__EMSCRIPTEN__) && \
- ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) && \
- ((defined(__APPLE__) && PROTOBUF_CLANG_MIN(13, 0)) || \
- (!defined(__APPLE__) && PROTOBUF_CLANG_MIN(12, 0)))
diff --git a/cpp/src/arrow/util/value_parsing_test.cc
b/cpp/src/arrow/util/value_parsing_test.cc
index 2a2d39777bf..d7e52880fa6 100644
--- a/cpp/src/arrow/util/value_parsing_test.cc
+++ b/cpp/src/arrow/util/value_parsing_test.cc
@@ -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));