Copilot commented on code in PR #47330:
URL: https://github.com/apache/arrow/pull/47330#discussion_r3789804175


##########
cpp/cmake_modules/SetupCxxFlags.cmake:
##########
@@ -719,26 +719,35 @@ if(MSVC)
 endif()
 
 if(CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
-  # flags are:
+  # For the Pyodide 2026_0 ABI, the flags are:
   # 1) We force *everything* to build as position independent
-  # 2) And with support for C++ exceptions
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fexceptions")
+  # 2) We support C++ WASM exceptions, using the native WebAssembly
+  #    exception handling proposal and WebAssembly-based setjmp/longjmp
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fwasm-exceptions 
-sSUPPORT_LONGJMP=wasm")
   # deprecated-literal-operator error is thrown in datetime (vendored lib in 
arrow)
   set(CMAKE_CXX_FLAGS
-      "${CMAKE_CXX_FLAGS} -fPIC -fexceptions 
-Wno-error=deprecated-literal-operator")
+      "${CMAKE_CXX_FLAGS} -fPIC -fwasm-exceptions -sSUPPORT_LONGJMP=wasm 
-Wno-error=deprecated-literal-operator"
+  )
 
   # flags for creating shared libraries (only used in pyarrow, because
   # Emscripten builds libarrow as static)
   # flags are:
   # 1) Tell it to use JavaScript / WebAssembly 64 bit number support.
-  # 2) Tell it to build with support for C++ exceptions
+  # 2) Tell it to build with support for C++ exceptions (see above)
   # 3) Skip linker flags error which happens with -soname parameter
-  set(ARROW_EMSCRIPTEN_LINKER_FLAGS "-sWASM_BIGINT=1 -fexceptions 
-Wno-error=linkflags")
-  set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS
-      "-sSIDE_MODULE=1 ${ARROW_EMSCRIPTEN_LINKER_FLAGS}")
-  set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS
-      "-sSIDE_MODULE=1 ${ARROW_EMSCRIPTEN_LINKER_FLAGS}")
-  set(CMAKE_SHARED_LINKER_FLAGS "-sSIDE_MODULE=1 
${ARROW_EMSCRIPTEN_LINKER_FLAGS}")
+  # 4) Record $ORIGIN as an RPATH, so that Pyodide can locate
+  #    libarrow_python.so next to the extension modules needing it
+  # Note: the CMAKE_SHARED_LIBRARY_CREATE_<LANG>_FLAGS and
+  # CMAKE_SHARED_MODULE_CREATE_<LANG>_FLAGS variables are not used by the
+  # Ninja generator, so the flags must go through the linker-flags
+  # variables, which apply to SHARED (libarrow_python) and MODULE (Cython
+  # extension) targets respectively.
+  set(ARROW_EMSCRIPTEN_LINKER_FLAGS
+      "-sWASM_BIGINT=1 -fwasm-exceptions -sSUPPORT_LONGJMP=wasm 
-Wno-error=linkflags")
+  set(ARROW_EMSCRIPTEN_DYLIB_CREATE_FLAGS
+      "-sSIDE_MODULE=1 ${ARROW_EMSCRIPTEN_LINKER_FLAGS} '-Wl,-rpath,$ORIGIN'")

Review Comment:
   The linker flag string includes single quotes around -Wl,-rpath,$ORIGIN. 
With the Ninja generator, single quotes are not treated as quoting characters 
and are passed through literally, which can break linking / produce an invalid 
rpath argument. Drop the single quotes and pass the flag as a normal argument; 
CMake will escape the $ for Ninja as needed.



##########
ci/docker/conda-python-emscripten.dockerfile:
##########
@@ -18,32 +18,37 @@
 ARG repo
 ARG arch
 ARG arch_short
-ARG python="3.12"
+ARG python="3.14"
 FROM --platform=linux/${arch} ${repo}:${arch_short}-conda-python-${python}
 
 ARG selenium_version="4.41.0"
-ARG pyodide_version="0.26.0"
+ARG pyodide_version="314.0.4"
 ARG chrome_version="latest"
-ARG required_python_min="(3,12)"
-# fail if python version < 3.12
+ARG required_python_min="(3,14)"
+# fail if python version < 3.14
 RUN echo "check PYTHON>=${required_python_min}" && python -c "import 
sys;sys.exit(0 if sys.version_info>=${required_python_min} else 1)"
 
-# install selenium and recent pyodide-build and recent python
+RUN apt-get update -y -q && \
+    apt-get install -y -q --no-install-recommends \
+        libatomic1 && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists/*
 
 # needs to be a login shell so ~/.profile is read
 SHELL ["/bin/bash", "--login", "-c", "-o", "pipefail"]
 
+# install selenium and recent pyodide-build and recent python
 RUN python -m pip install --no-cache-dir selenium==${selenium_version} && \
     python -m pip install --no-cache-dir --upgrade 
pyodide-build>=${pyodide_version}

Review Comment:
   pyodide_version is now 314.0.4, but this value is reused as the minimum 
version for the pyodide-build PyPI package. That makes the requirement 
effectively `pyodide-build>=314.0.4`, which is likely unsatisfiable because 
pyodide-build is versioned independently (0.x). Consider adding a separate 
pyodide_build_version ARG and using it for the pip install constraint.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to