Apache DataFusion SQL Query Engine
ARROW-9568: [CI][C++] Use msys2/setup-msys2
Sutou Kouhei32ce0e356a94
diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.ymlindex d8eab59590..0937079a8f 100644--- a/.github/workflows/cpp.yml+++ b/.github/workflows/cpp.yml@@ -354,14 +354,14 @@ jobs:- name: Fetch Submodules and Tagsshell: bashrun: 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 ccacheuses: actions/cache@v1with:@@ -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.ymlindex 2481f96db7..46455f338e 100644--- a/.github/workflows/ruby.yml+++ b/.github/workflows/ruby.yml@@ -209,9 +209,16 @@ jobs:uses: actions/setup-ruby@v1with: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 MSYS2run: |- ridk exec bash ci\scripts\msys2_system_upgrade.shridk exec bash ci\scripts\msys2_setup.sh ruby- name: Cache ccacheuses: actions/cache@v1diff --git a/ci/scripts/msys2_bootstrap.ps1 b/ci/scripts/msys2_bootstrap.ps1deleted file mode 100755index 13ee743944..0000000000--- 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.ps1diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.shindex 585a143677..a2845d1473 100755--- a/ci/scripts/msys2_setup.sh+++ b/ci/scripts/msys2_setup.sh@@ -24,6 +24,7 @@ target=$1packages=()case "${target}" incpp|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_phase1.sh b/ci/scripts/msys2_system_upgrade_phase1.shnew file mode 100755index 0000000000..0839228f41--- /dev/null+++ b/ci/scripts/msys2_system_upgrade_phase1.sh@@ -0,0 +1,45 @@+#!/usr/bin/env bash+#+# 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.++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 \+ --sysupgrade \+ --sysupgradediff --git a/ci/scripts/msys2_system_upgrade.sh b/ci/scripts/msys2_system_upgrade_phase2.shsimilarity index 96%rename from ci/scripts/msys2_system_upgrade.shrename to ci/scripts/msys2_system_upgrade_phase2.shindex 2d7b1538b5..aa38cc61b7 100755--- a/ci/scripts/msys2_system_upgrade.sh+++ b/ci/scripts/msys2_system_upgrade_phase2.sh@@ -22,5 +22,5 @@ set -euxpacman \--noconfirm \--sync \- -uu \- -yy+ --sysupgrade \+ --sysupgrade