# Very very slow osx builds

**URL:** <https://travis-ci.community/t/very-very-slow-osx-builds/12313>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [October 24, 2021, 8:23pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313 "2021-10-24T20:23:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![audetto](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/audetto/32/7341_2.png) [@audetto](https://travis-ci.community/u/audetto)\
**Post date:** [October 24, 2021, 8:23pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/1 "2021-10-24T20:23:56Z")

</div>

[https://app.travis-ci.com/github/audetto/AppleWin/builds/240458983](https://app.travis-ci.com/github/audetto/AppleWin/builds/240458983)

from

> <https://github.com/audetto/AppleWin/blob/macosx/.travis.yml>

I stopped the build after 12 minutes as it was still installing packages and spending a lot of time on packages I have not even requested.

Using the default image, I am forced to set `update: true`, but this takes forever too.

What is the best way to install packages on the osx image without spending all the credits?

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 24, 2021, 9:02pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/2 "2021-10-24T21:02:05Z")

</div>

> [@audetto](#):
>
> Using the default image, I am forced to set `update: true`

[Why not use the latest image then](https://docs.travis-ci.com/user/reference/osx/#macos-version)? [The default image has an EOL version of MacOS](https://travis-ci.community/t/the-default-osx-image-xcode9-4-is-now-unusable-because-macos-10-13-is-eol/10628), it’s going to give you trouble.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 24, 2021, 9:13pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/3 "2021-10-24T21:13:28Z")

</div>

You can cache Homebrew metadata, but it’s nontrivial.

> <https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci/53331571#53331571>

---

<div class="post-metadata">

**Author:** ![audetto](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/audetto/32/7341_2.png) [@audetto](https://travis-ci.community/u/audetto)\
**Post date:** [October 25, 2021, 11:54am UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/4 "2021-10-25T11:54:52Z")

</div>

> [@native-api](#):
>
> [Why not use the latest image then](https://docs.travis-ci.com/user/reference/osx/#macos-version)? [The default image has an EOL version of MacOS](https://travis-ci.community/t/the-default-osx-image-xcode9-4-is-now-unusable-because-macos-10-13-is-eol/10628), it’s going to give you trouble.

If you look at the travis file, I am using

osx\_image: xcode12.5

This is better than the default image, but after 12 minutes it is still doing some “home brew system maintenance”.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 25, 2021, 10:30pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/5 "2021-10-25T22:30:21Z")

</div>

I can improve the code in that SO answer into a turn-key solution if someone commissions me…

---

<div class="post-metadata">

**Author:** ![tanzislam](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tanzislam/32/2591_2.png) [@tanzislam](https://travis-ci.community/u/tanzislam)\
**Post date:** [October 29, 2021, 8:57pm UTC](https://travis-ci.community/t/very-very-slow-osx-builds/12313/6 "2021-10-29T20:57:19Z")

</div>

Consider adding `HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1` environment variable, like I mentioned [here](https://travis-ci.community/t/xcode-8-3-homebrew-outdated-error/3798/13). Also add `HOMEBREW_NO_AUTO_UPDATE=1` to be safe. Both are [documented](https://docs.brew.sh/Manpage#environment).
