Skip to content

Commit

Permalink
Force the compiler binary mtimes to a fixed value for `cmake-androi…
Browse files Browse the repository at this point in the history
…d-*` workflow builds.

Currently, `ccache` is not getting any hits because the `mtime` of the compiler binaries changes every time `sttld/setup-ndk` is called (it copies the binaries to the `tool-cache`, which sets their `mtime`s to the current time, see discussion [here](hendrikmuhs/ccache-action#94)).

PiperOrigin-RevId: 662517571
  • Loading branch information
gonnet authored and xnnpack-bot committed Aug 13, 2024
1 parent 6c7f069 commit 68831bc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,15 @@ jobs:
key: ${{ github.job }}-${{ matrix.arch }}
max-size: "1G"
save: ${{ inputs.update-caches }}
- name: Force compiler binary mtime
# The nttld/setup-ndk action downloads the compiler binaries and copies them to the
# tools-cache, where their mtimes are set to the current time. This is bad since ccache
# uses the compiler binary mtime to determine whether two compilations match. We solve
# this problem by coercing the mtime of the compiler binaries to a fixed value. Note that
# if the compiler does indeed change, this will also cause the path to change as it would
# imply using a different NDK version.
run: |
find ${{ steps.setup-ndk.outputs.ndk-path }} -wholename '*/bin/clang*' -executable -type f,l -exec touch -h -t 202408130000 {} +
- name: Configure and build
run: scripts/build-android-${{ matrix.arch }}.sh
working-directory: ${{ github.workspace }}
Expand Down

0 comments on commit 68831bc

Please sign in to comment.