kou commented on code in PR #47811:
URL: https://github.com/apache/arrow/pull/47811#discussion_r2434295639


##########
ci/scripts/install_cmake.sh:
##########
@@ -49,6 +49,9 @@ case ${platform} in
     ;;
   MSYS_NT*|MINGW64_NT*)
     platform=windows
+    if [[ "$(uname)" == *-ARM64 ]]; then
+      arch=arm64
+    fi

Review Comment:
   Can we improve our CMake binary architecture detection instead of using 
ad-hoc approach?
   
   Something like:
   
   ```diff
   diff --git a/ci/scripts/install_cmake.sh b/ci/scripts/install_cmake.sh
   index a6916b255e..5393eeb270 100755
   --- a/ci/scripts/install_cmake.sh
   +++ b/ci/scripts/install_cmake.sh
   @@ -24,17 +24,13 @@ if [ "$#" -ne 2 ]; then
      exit 1
    fi
    
   -declare -A archs
   -archs=([x86_64]=x86_64
   -       [arm64]=aarch64
   -       [aarch64]=aarch64)
   -
   -arch=$(uname -m)
   -if [ -z "${archs[$arch]}" ]; then
   -  echo "Unsupported architecture: ${arch}"
   -  exit 0
   -fi
   -arch=${archs[$arch]}
   +declare -A linux_archs
   +linux_archs=([x86_64]=x86_64
   +             [arm64]=aarch64
   +             [aarch64]=aarch64)
   +declare -A windows_archs
   +windows_archs=([x86_64]=x86_64
   +               [arm64]=arm64)
    
    version=$1
    prefix=$2
   @@ -43,12 +39,25 @@ platform=$(uname)
    case ${platform} in
      Linux)
        platform=linux
   +    arch=$(uname -m)
   +    if [ -z "${linux_archs[$arch]}" ]; then
   +      echo "Unsupported architecture on Linux: ${arch}"
   +      exit 0
   +    fi
   +    arch=${linux_archs[$arch]}
        ;;
      Darwin)
        platform=macos
   +    arch=universal
        ;;
      MSYS_NT*|MINGW64_NT*)
        platform=windows
   +    arch=$(uname -m)
   +    if [ -z "${windows_archs[$arch]}" ]; then
   +      echo "Unsupported architecture on Windows ${arch}"
   +      exit 0
   +    fi
   +    arch=${windows_archs[$arch]}
        ;;
      *)
        echo "Unsupported platform: ${platform}"
   @@ -60,7 +69,7 @@ mkdir -p "${prefix}"
    
url="https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-${platform}-";
    case ${platform} in
      macos)
   -    url+="universal.tar.gz"
   +    url+="${arch}.tar.gz"
        curl -L "${url}" | tar -xzf - --directory "${prefix}" 
--strip-components=1
        ln -s CMake.app/Contents/bin "${prefix}/bin"
        ;;
   ```



##########
cpp/cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -1118,6 +1118,11 @@ function(build_boost)
     # This is for https://github.com/boostorg/container/issues/305
     string(APPEND CMAKE_C_FLAGS " -Wno-strict-prototypes")
   endif()
+  if(MSVC AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
+    set(BOOST_CONTEXT_IMPLEMENTATION
+        winfib
+        CACHE STRING "" FORCE)

Review Comment:
   Do we need to use `CACHE` variable here?



-- 
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