Skip to content

Commit

Permalink
ARROW-8781: [CI][MinGW] Enable ccache
Browse files Browse the repository at this point in the history
Closes apache#7366 from kou/mingw-ccache

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou committed Jun 6, 2020
1 parent 2bff613 commit f86ebfa
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions ci/scripts/msys2_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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

Expand Down
20 changes: 18 additions & 2 deletions ci/scripts/msys2_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)"
8 changes: 0 additions & 8 deletions ci/scripts/msys2_system_upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit f86ebfa

Please sign in to comment.