Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions (macOS): persist ccache's cache between runs #457

Merged
merged 5 commits into from Jan 21, 2022

Conversation

ulmus-scott
Copy link
Contributor

ccache does not appear to work on the macOS actions. I will attempt to enable and verify it on the macOS workflows.

@ulmus-scott
Copy link
Contributor Author

ulmus-scott commented Jan 11, 2022

on macOS:
(default) cache_dir = /Users/runner/Library/Caches/ccache

- name: Check ccache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ matrix.os }}-${{ matrix.cc }}-ccache-${{ github.sha }}
restore-keys: ${{ matrix.os }}-${{ matrix.cc }}-ccache

Line 34 is wrong for macOS.

Waiting for the second Action to complete.

The default is different from linux, so create a separate task for macOS.
The other debugging commands I added weren't really necessary.

ccache terminates with the -V option before executing subsequent options,
so put it last.  -p was unnecessary since -s shows the cache directory.
@ulmus-scott ulmus-scott changed the title GitHub Actions: debug ccache on macOS GitHub Actions: enable ccache on macOS Jan 11, 2022
@ulmus-scott ulmus-scott marked this pull request as ready for review January 11, 2022 07:36
@ctreleaven
Copy link

If a macOS user has installed ccache via MacPorts, your assumption will be invalid--the cache_dir will be ~/.ccache. I'm not sure where Homebrew or Fink place the cache. I think the correct thing to do is to ask ccache:

ccache --get-config cache_dir

Craig

@ulmus-scott
Copy link
Contributor Author

@ctreleaven This only effects the GitHub Actions builds, not anyone working on a checked out copy on their local machine.

The GitHub builders use Homebrew:

brew install pkg-config ccache qt5 nasm libsamplerate taglib lzo libcec libbluray fftw libass libhdhomerun dav1d x264 x265 libvpx openssl sound-touch

This was the easiest way I saw to enable ccache on the macOS GitHub Actions builders.

Force directory instead of using default install directory, which may differ
depending on the package used.

CCACHE_DIR=~/.ccache doesn't work.
by removing trailing whitespace
@ulmus-scott
Copy link
Contributor Author

I decided to force the use of CCACHE_DIR=$HOME/.ccache instead of relying on fragile packaging defaults.

@ulmus-scott ulmus-scott changed the title GitHub Actions: enable ccache on macOS GitHub Actions (macOS): persist ccache's cache between runs Jan 20, 2022
@linuxdude42 linuxdude42 merged commit 327d13e into MythTV:master Jan 21, 2022
@ulmus-scott ulmus-scott deleted the github_actions branch January 21, 2022 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants