This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new f40adb5  ARROW-9568: [CI][C++] Use msys2/setup-msys2
f40adb5 is described below

commit f40adb51b4612ee178d426c5fdc81ac1579c4fbf
Author: Sutou Kouhei <[email protected]>
AuthorDate: Tue Jul 28 16:43:08 2020 +0900

    ARROW-9568: [CI][C++] Use msys2/setup-msys2
    
    Closes #7849 from kou/ci-use-setup-msys2
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 .github/workflows/cpp.yml                          | 39 +++++++---------
 .github/workflows/ruby.yml                         |  9 +++-
 ci/scripts/msys2_bootstrap.ps1                     | 53 ----------------------
 ci/scripts/msys2_setup.sh                          | 10 +---
 ...m_upgrade.sh => msys2_system_upgrade_phase1.sh} | 23 +++++++++-
 ...m_upgrade.sh => msys2_system_upgrade_phase2.sh} |  4 +-
 6 files changed, 49 insertions(+), 89 deletions(-)

diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index d8eab59..0937079 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -354,14 +354,14 @@ jobs:
       - name: Fetch Submodules and Tags
         shell: bash
         run: ci/scripts/util_checkout.sh
-      - name: Bootstrap MSYS2
-        run: |
-          ci\scripts\msys2_bootstrap.ps1 ${{ matrix.mingw-n-bits }}
+      - uses: msys2/setup-msys2@v2
+        with:
+          msystem: MINGW${{ matrix.mingw-n-bits }}
+          update: true
       - name: Setup MSYS2
+        shell: msys2 {0}
         run: |
-          . ..\env.ps1
-          bash ci\scripts\msys2_system_upgrade.sh
-          bash ci\scripts\msys2_setup.sh cpp
+          ci/scripts/msys2_setup.sh cpp
       - name: Cache ccache
         uses: actions/cache@v1
         with:
@@ -369,22 +369,17 @@ jobs:
           key: cpp-ccache-mingw${{ matrix.mingw-n-bits }}-${{ 
hashFiles('cpp/**') }}
           restore-keys: cpp-ccache-mingw${{ matrix.mingw-n-bits }}-
       - name: Build
+        shell: msys2 {0}
         run: |
-          . ..\env.ps1
-          $Env:CMAKE_BUILD_PARALLEL_LEVEL = $Env:NUMBER_OF_PROCESSORS
-          $source_dir = "$(cygpath --unix "$(Get-Location)")"
-          $build_dir = "$(cygpath --unix "$(Get-Location)\build")"
-          $ErrorActionPreference = "Continue"
-          bash ci\scripts\cpp_build.sh "${source_dir}" "${build_dir}"
+          export CMAKE_BUILD_PARALLEL_LEVEL=$NUMBER_OF_PROCESSORS
+          ci/scripts/cpp_build.sh "$(pwd)" "$(pwd)/build"
       - name: Test
+        shell: msys2 {0}
         run: |
-          . ..\env.ps1
-          $python_version = $(python -c "import sys; print('.'.join(map(str, 
sys.version_info[0:2])))")
-          $Env:PYTHONHOME = 
"${Env:MINGW_PREFIX_WINDOWS}\lib\python${python_version}"
-          $Env:PYTHONPATH = "${Env:PYTHONHOME}"
-          $Env:PYTHONPATH += ";${Env:PYTHONHOME}\lib-dynload"
-          $Env:PYTHONPATH += ";${Env:PYTHONHOME}\site-packages"
-          $source_dir = "$(cygpath --unix "$(Get-Location)")"
-          $build_dir = "$(cygpath --unix "$(Get-Location)\build")"
-          $ErrorActionPreference = "Continue"
-          bash ci\scripts\cpp_test.sh "${source_dir}" "${build_dir}"
+          python_version=$(python -c "import sys; print('.'.join(map(str, 
sys.version_info[0:2])))")
+          export PYTHONHOME="$(cygpath --windows 
${MINGW_PREFIX})\lib\python${python_version}"
+          PYTHONPATH="${PYTHONHOME}"
+          PYTHONPATH="${PYTHONPATH};${PYTHONHOME}\lib-dynload"
+          PYTHONPATH="${PYTHONPATH};${PYTHONHOME}\site-packages"
+          export PYTHONPATH
+          ci/scripts/cpp_test.sh "$(pwd)" "$(pwd)/build"
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 2481f96..46455f3 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -209,9 +209,16 @@ jobs:
         uses: actions/setup-ruby@v1
         with:
           ruby-version: ${{ matrix.ruby-version }}
+      - name: Upgrade MSYS2 (phase1)
+        run: |
+          ridk exec bash ci\scripts\msys2_system_upgrade_phase1.sh
+          taskkill /F /FI "MODULES eq msys-2.0.dll"
+      - name: Upgrade MSYS2 (phase2)
+        run: |
+          ridk exec bash ci\scripts\msys2_system_upgrade_phase2.sh
+          taskkill /F /FI "MODULES eq msys-2.0.dll"
       - name: Setup MSYS2
         run: |
-          ridk exec bash ci\scripts\msys2_system_upgrade.sh
           ridk exec bash ci\scripts\msys2_setup.sh ruby
       - name: Cache ccache
         uses: actions/cache@v1
diff --git a/ci/scripts/msys2_bootstrap.ps1 b/ci/scripts/msys2_bootstrap.ps1
deleted file mode 100755
index 13ee743..0000000
--- a/ci/scripts/msys2_bootstrap.ps1
+++ /dev/null
@@ -1,53 +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.
-
-Param([Parameter(Mandatory=$true)][int32]$n_bits)
-
-echo "" > env.ps1
-
-If (${n_bits} -eq 32) {
-    $carch = "i686"
-} Else {
-    $carch = "x86_64"
-}
-echo "`$Env:MINGW_CHOST = `"${carch}-w64-mingw32`"" `
-  >> ../env.ps1
-echo "`$Env:MINGW_PACKAGE_PREFIX = `"mingw-w64-${carch}`"" `
-  >> ../env.ps1
-echo "`$Env:MINGW_PREFIX = `"/mingw${n_bits}`"" `
-  >> ../env.ps1
-echo "`$Env:MSYSTEM_CARCH = `"${carch}`"" `
-  >> ../env.ps1
-echo "`$Env:MSYSTEM_CHOST = `"${carch}-w64-mingw32`"" `
-  >> ../env.ps1
-echo "`$Env:MSYSTEM_PREFIX = `"/mingw${n_bits}`"" `
-  >> ../env.ps1
-echo "`$Env:MSYSTEM = `"MINGW${n_bits}`"" `
-  >> ../env.ps1
-
-$MSYS_ROOT_WINDOWS = "C:\msys64"
-echo "`$Env:MSYS_ROOT_WINDOWS = `"${MSYS_ROOT_WINDOWS}`"" `
-  >> ../env.ps1
-
-$MINGW_PREFIX_WINDOWS = "${MSYS_ROOT_WINDOWS}\mingw${n_bits}"
-echo "`$Env:MINGW_PREFIX_WINDOWS = `"${MINGW_PREFIX_WINDOWS}`"" `
-  >> ../env.ps1
-
-echo "`$Env:PATH = `"${MSYS_ROOT_WINDOWS}\usr\bin;`${Env:PATH}`"" `
-  >> ../env.ps1
-echo "`$Env:PATH = `"${MINGW_PREFIX_WINDOWS}\bin;`${Env:PATH}`"" `
-  >> ../env.ps1
diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh
index 585a143..a2845d1 100755
--- a/ci/scripts/msys2_setup.sh
+++ b/ci/scripts/msys2_setup.sh
@@ -24,6 +24,7 @@ target=$1
 packages=()
 case "${target}" in
   cpp|c_glib|ruby)
+    packages+=(make)
     packages+=(${MINGW_PACKAGE_PREFIX}-ccache)
     packages+=(${MINGW_PACKAGE_PREFIX}-boost)
     packages+=(${MINGW_PACKAGE_PREFIX}-brotli)
@@ -55,15 +56,6 @@ case "${target}" in
     ;;
 esac
 
-# Ensure removing unused gcc related sub packages
-pacman \
-  --noconfirm \
-  --remove \
-  "${MINGW_PACKAGE_PREFIX}-gcc-ada" \
-  "${MINGW_PACKAGE_PREFIX}-gcc-fortran" \
-  "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran" \
-  "${MINGW_PACKAGE_PREFIX}-gcc-objc" || :
-
 pacman \
   --needed \
   --noconfirm \
diff --git a/ci/scripts/msys2_system_upgrade.sh 
b/ci/scripts/msys2_system_upgrade_phase1.sh
similarity index 64%
copy from ci/scripts/msys2_system_upgrade.sh
copy to ci/scripts/msys2_system_upgrade_phase1.sh
index 2d7b153..0839228 100755
--- a/ci/scripts/msys2_system_upgrade.sh
+++ b/ci/scripts/msys2_system_upgrade_phase1.sh
@@ -19,8 +19,27 @@
 
 set -eux
 
+# https://www.msys2.org/news/#2020-06-29-new-packagers
+msys2_keyring_pkg=msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz
+for suffix in "" ".sig"; do
+  curl \
+    --location \
+    --remote-name \
+    --show-error \
+    --silent \
+    https://repo.msys2.org/msys/x86_64/${msys2_keyring_pkg}${suffix}
+done
+pacman-key --verify ${msys2_keyring_pkg}.sig
 pacman \
   --noconfirm \
+  --upgrade \
+  ${msys2_keyring_pkg}
+
+
+pacman \
+  --noconfirm \
+  --refresh \
+  --refresh \
   --sync \
-  -uu \
-  -yy
+  --sysupgrade \
+  --sysupgrade
diff --git a/ci/scripts/msys2_system_upgrade.sh 
b/ci/scripts/msys2_system_upgrade_phase2.sh
similarity index 96%
rename from ci/scripts/msys2_system_upgrade.sh
rename to ci/scripts/msys2_system_upgrade_phase2.sh
index 2d7b153..aa38cc6 100755
--- a/ci/scripts/msys2_system_upgrade.sh
+++ b/ci/scripts/msys2_system_upgrade_phase2.sh
@@ -22,5 +22,5 @@ set -eux
 pacman \
   --noconfirm \
   --sync \
-  -uu \
-  -yy
+  --sysupgrade \
+  --sysupgrade

Reply via email to