Recently, I’ve noticed that OSX package checks that used to run in <10min have been taking 3-4 times as long. The biggest use of time is in the installation of homebrew dependencies. Among the packages installed are many that are not directly relevant or, it would seem, needed, for the package checking: gnupg, pinentry utilities, gdal/geos/postgis, postgresql utilties, and many others. An example is located here.
How can I configure the build so as to include only necessary packages?
Failing that, is it possible to set up caching so that they are not laboriously reinstalled unnecessarily?
Where (if anywhere) can I find documentation on this topic?
Try caching, brew update metadata, you only need to cache the .git folders within /usr/local/Homebrew. This should speed the build process up somewhat, see if this helps at all.
before_cache:
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then find /usr/local/Homebrew \! -regex ".+\.git.+" -delete; fi
@Montana: With these changes, I am able to reduce the build time from >50min to ~25min. However, I wonder whether it is in principle to get the macos build to run approximately as fast as the linux build (~7min). Here is the current .travis.yml:
You can see the results here. It seems that quite a bit of time (~400sec) is spent installing R, despite the fact that I have asked to cache $HOME/R. At least, that was my thought in including $HOME/R in the cache. Perhaps that needs to be done differently?