Skip to content

Apache DataFusion SQL Query Engine

ARROW-11449: [CI][R][Windows] Use ccache

Sutou Kouhei8f651541568b
diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml
index 3b200c10b8..066c274446 100644
--- a/.github/workflows/r.yml
+++ b/.github/workflows/r.yml
@@ -168,6 +168,22 @@ jobs:
cd r/tests
sed -i.bak -E -e 's/"arrow"/"arrow", reporter = "location"/' testthat.R
rm -f testthat.R.bak
+ - name: Setup ccache
+ shell: bash
+ run: |
+ ci/scripts/ccache_setup.sh
+ echo "CCACHE_DIR=$(cygpath --absolute --windows ccache)" >> $GITHUB_ENV
+ # We must enable actions/cache before r-lib/actions/setup-r to ensure
+ # using system tar instead of tar provided by Rtools.
+ # We can use tar provided by Rtools when we drop support for Rtools 3.5.
+ # Because Rtools 4.0 or later has zstd. actions/cache requires zstd
+ # when tar is GNU tar.
+ - name: Cache ccache
+ uses: actions/cache@v2
+ with:
+ path: ccache
+ key: r-${{ matrix.rtools }}-ccache-mingw-${{ hashFiles('cpp/**') }}
+ restore-keys: r-${{ matrix.rtools }}-ccache-mingw-
# We use the makepkg-mingw setup that is included in rtools40 even when
# we use the rtools35 compilers, so we always install R 4.0/Rtools40
- uses: r-lib/actions/setup-r@master
@@ -213,3 +229,8 @@ jobs:
shell: cmd
run: cat check/arrow.Rcheck/00install.out
if: always()
+ # We can remove this when we drop support for Rtools 3.5.
+ - name: Ensure using system tar in actions/cache
+ run: |
+ Write-Output "${Env:windir}\System32" | `
+ Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
diff --git a/ci/scripts/PKGBUILD b/ci/scripts/PKGBUILD
index 756d5f7e57..8b1141fe93 100644
--- a/ci/scripts/PKGBUILD
+++ b/ci/scripts/PKGBUILD
@@ -30,7 +30,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-aws-sdk-cpp"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-lz4"
"${MINGW_PACKAGE_PREFIX}-zstd")
-makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
+makedepends=("${MINGW_PACKAGE_PREFIX}-ccache"
+ "${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-gcc")
options=("staticlibs" "strip" "!buildflags")