You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2020/06/06 23:13:03 UTC

[arrow] branch master updated: ARROW-8781: [CI][MinGW] Enable ccache

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 f86ebfa  ARROW-8781: [CI][MinGW] Enable ccache
f86ebfa is described below

commit f86ebfa0212b80643d21ff74d585ac9142fbc2d7
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Sun Jun 7 08:12:25 2020 +0900

    ARROW-8781: [CI][MinGW] Enable ccache
    
    Closes #7366 from kou/mingw-ccache
    
    Authored-by: Sutou Kouhei <ko...@clear-code.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 .github/workflows/cpp.yml          |  8 +++++++-
 .github/workflows/ruby.yml         |  6 ++++++
 ci/scripts/msys2_bootstrap.ps1     |  8 +-------
 ci/scripts/msys2_setup.sh          | 20 ++++++++++++++++++--
 ci/scripts/msys2_system_upgrade.sh |  8 --------
 5 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index dca34ae..0664cbb 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -223,7 +223,7 @@ jobs:
       ARROW_DATASET: ON
       ARROW_FLIGHT: ON
       ARROW_HDFS: OFF
-      ARROW_HOME: /mingw{{ matrix.mingw-n-bits }}
+      ARROW_HOME: /mingw${{ matrix.mingw-n-bits }}
       ARROW_JEMALLOC: OFF
       ARROW_PARQUET: ON
       ARROW_PYTHON: ON
@@ -268,6 +268,12 @@ jobs:
           . ..\env.ps1
           bash ci\scripts\msys2_system_upgrade.sh
           bash ci\scripts\msys2_setup.sh cpp
+      - name: Cache ccache
+        uses: actions/cache@v1
+        with:
+          path: ccache
+          key: cpp-ccache-mingw${{ matrix.mingw-n-bits }}-${{ hashFiles('cpp/**') }}
+          restore-keys: cpp-ccache-mingw${{ matrix.mingw-n-bits }}-
       - name: Build
         run: |
           . ..\env.ps1
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 3988c4d..6c95dff 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -212,6 +212,12 @@ jobs:
         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
+        with:
+          path: ccache
+          key: ruby-ccache-mingw${{ matrix.mingw-n-bits }}-${{ hashFiles('cpp/**') }}
+          restore-keys: ruby-ccache-mingw${{ matrix.mingw-n-bits }}-
       - name: Build C++
         run: |
           $Env:CMAKE_BUILD_PARALLEL_LEVEL = $Env:NUMBER_OF_PROCESSORS
diff --git a/ci/scripts/msys2_bootstrap.ps1 b/ci/scripts/msys2_bootstrap.ps1
index e287620..13ee743 100755
--- a/ci/scripts/msys2_bootstrap.ps1
+++ b/ci/scripts/msys2_bootstrap.ps1
@@ -17,12 +17,6 @@
 
 Param([Parameter(Mandatory=$true)][int32]$n_bits)
 
-git clone `
-  --depth 1 `
-  --quiet `
-  https://github.com/msys2/msys2-ci-base.git `
-  ..\msys64
-
 echo "" > env.ps1
 
 If (${n_bits} -eq 32) {
@@ -45,7 +39,7 @@ echo "`$Env:MSYSTEM_PREFIX = `"/mingw${n_bits}`"" `
 echo "`$Env:MSYSTEM = `"MINGW${n_bits}`"" `
   >> ../env.ps1
 
-$MSYS_ROOT_WINDOWS = "$(Get-Location)\..\msys64"
+$MSYS_ROOT_WINDOWS = "C:\msys64"
 echo "`$Env:MSYS_ROOT_WINDOWS = `"${MSYS_ROOT_WINDOWS}`"" `
   >> ../env.ps1
 
diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh
index 923362e..e77b0f8 100755
--- a/ci/scripts/msys2_setup.sh
+++ b/ci/scripts/msys2_setup.sh
@@ -24,8 +24,7 @@ target=$1
 packages=()
 case "${target}" in
   cpp|c_glib|ruby)
-    # ccache may be broken on MinGW.
-    # packages+=(ccache)
+    packages+=(${MINGW_PACKAGE_PREFIX}-ccache)
     packages+=(${MINGW_PACKAGE_PREFIX}-boost)
     packages+=(${MINGW_PACKAGE_PREFIX}-brotli)
     packages+=(${MINGW_PACKAGE_PREFIX}-cmake)
@@ -52,7 +51,24 @@ 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 \
   --sync \
   "${packages[@]}"
+
+echo "::set-env name=ARROW_USE_CCACHE::ON"
+echo "::set-env name=CCACHE_COMPILERCHECK::content"
+echo "::set-env name=CCACHE_COMPRESS::1"
+echo "::set-env name=CCACHE_COMPRESSLEVEL::6"
+echo "::set-env name=CCACHE_MAXSIZE::500M"
+echo "::set-env name=CCACHE_DIR::$(cygpath --absolute --windows ccache)"
diff --git a/ci/scripts/msys2_system_upgrade.sh b/ci/scripts/msys2_system_upgrade.sh
index 8dab403..2d7b153 100755
--- a/ci/scripts/msys2_system_upgrade.sh
+++ b/ci/scripts/msys2_system_upgrade.sh
@@ -19,14 +19,6 @@
 
 set -eux
 
-# Update pacman manually from old MSYS2.
-# See also: https://github.com/msys2/MSYS2-packages/issues/1960
-pacman --noconfirm --refresh --sync zstd
-wget -q http://repo.msys2.org/msys/x86_64/pacman-5.2.1-7-x86_64.pkg.tar.zst
-zstd -d pacman-5.2.1-7-x86_64.pkg.tar.zst
-gzip pacman-5.2.1-7-x86_64.pkg.tar
-pacman --noconfirm --upgrade ./pacman-5.2.1-7-x86_64.pkg.tar.gz
-
 pacman \
   --noconfirm \
   --sync \