[Openvpn-devel] travis-ci: speedup osx build by enabling brew cache

Message ID 20180104121956.13358-1-chipitsine@gmail.com
State Superseded
Headers show
Series
  • [Openvpn-devel] travis-ci: speedup osx build by enabling brew cache
Related show

Commit Message

Илья Шипицин Jan. 4, 2018, 12:19 p.m.
1-2 minutes speedup by using brew cache, also ccache
is no more disabled for osx build (even it does not
speedup significantly, it simplifies the overall script)

---
this is a "v2" of previously issued "enable ccache for osx and mingw builds"
patch. I decided not to enable ccache for mingw builds as it does not
speedup them

 .travis.yml           | 5 +++--
 .travis/build-deps.sh | 7 ++-----
 2 files changed, 5 insertions(+), 7 deletions(-)

Comments

Илья Шипицин Jan. 4, 2018, 1:44 p.m. | #1
wait a bit,

we might need to remove ccache (it became broken after travis-ci upgraded
to clang-5)

https://travis-ci.org/chipitsine/openvpn/jobs/325002858

2018-01-04 17:19 GMT+05:00 Ilya Shipitsin <chipitsine@gmail.com>:

> 1-2 minutes speedup by using brew cache, also ccache
> is no more disabled for osx build (even it does not
> speedup significantly, it simplifies the overall script)
>
> ---
> this is a "v2" of previously issued "enable ccache for osx and mingw
> builds"
> patch. I decided not to enable ccache for mingw builds as it does not
> speedup them
>
>  .travis.yml           | 5 +++--
>  .travis/build-deps.sh | 7 ++-----
>  2 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/.travis.yml b/.travis.yml
> index 1f669b30..34e0ac04 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -82,10 +82,11 @@ cache:
>    directories:
>    - download-cache
>    - ${HOME}/opt
> +  - ${HOME}/Library/Caches/Homebrew
>
>  before_install:
> -  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update     ; fi
> -  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo; fi
> +  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update            ; fi
> +  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo ccache; fi
>
>  install:
>    - if [ ! -z "${CHOST}" ]; then unset CC; fi
> diff --git a/.travis/build-deps.sh b/.travis/build-deps.sh
> index e787abab..e7036b6b 100755
> --- a/.travis/build-deps.sh
> +++ b/.travis/build-deps.sh
> @@ -130,11 +130,8 @@ build_openssl () {
>      fi
>  }
>
> -# Enable ccache
> -if [ "${TRAVIS_OS_NAME}" != "osx" ] && [ -z ${CHOST+x} ]; then
> -    # ccache not available on osx, see:
> -    # https://github.com/travis-ci/travis-ci/issues/5567
> -    # also ccache not enabled for cross builds
> +# Enable ccache except cross builds
> +if [ -z ${CHOST+x} ]; then
>      mkdir -p "${HOME}/bin"
>      ln -s "$(which ccache)" "${HOME}/bin/${CC}"
>      PATH="${HOME}/bin:${PATH}"
> --
> 2.14.3
>
>
<div dir="ltr"><div>wait a bit,<br><br></div>we might need to remove ccache (it became broken after travis-ci upgraded to clang-5)<br><br><a href="https://travis-ci.org/chipitsine/openvpn/jobs/325002858">https://travis-ci.org/chipitsine/openvpn/jobs/325002858</a><br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-04 17:19 GMT+05:00 Ilya Shipitsin <span dir="ltr">&lt;<a href="mailto:chipitsine@gmail.com" target="_blank">chipitsine@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1-2 minutes speedup by using brew cache, also ccache<br>
is no more disabled for osx build (even it does not<br>
speedup significantly, it simplifies the overall script)<br>
<br>
---<br>
this is a &quot;v2&quot; of previously issued &quot;enable ccache for osx and mingw builds&quot;<br>
patch. I decided not to enable ccache for mingw builds as it does not<br>
speedup them<br>
<br>
 .travis.yml           | 5 +++--<br>
 .travis/build-deps.sh | 7 ++-----<br>
 2 files changed, 5 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/.travis.yml b/.travis.yml<br>
index 1f669b30..34e0ac04 100644<br>
--- a/.travis.yml<br>
+++ b/.travis.yml<br>
@@ -82,10 +82,11 @@ cache:<br>
   directories:<br>
   - download-cache<br>
   - ${HOME}/opt<br>
+  - ${HOME}/Library/Caches/<wbr>Homebrew<br>
<br>
 before_install:<br>
-  - if [ &quot;${TRAVIS_OS_NAME}&quot; = &quot;osx&quot; ]; then brew update     ; fi<br>
-  - if [ &quot;${TRAVIS_OS_NAME}&quot; = &quot;osx&quot; ]; then brew install lzo; fi<br>
+  - if [ &quot;${TRAVIS_OS_NAME}&quot; = &quot;osx&quot; ]; then brew update            ; fi<br>
+  - if [ &quot;${TRAVIS_OS_NAME}&quot; = &quot;osx&quot; ]; then brew install lzo ccache; fi<br>
<br>
 install:<br>
   - if [ ! -z &quot;${CHOST}&quot; ]; then unset CC; fi<br>
diff --git a/.travis/build-deps.sh b/.travis/build-deps.sh<br>
index e787abab..e7036b6b 100755<br>
--- a/.travis/build-deps.sh<br>
+++ b/.travis/build-deps.sh<br>
@@ -130,11 +130,8 @@ build_openssl () {<br>
     fi<br>
 }<br>
<br>
-# Enable ccache<br>
-if [ &quot;${TRAVIS_OS_NAME}&quot; != &quot;osx&quot; ] &amp;&amp; [ -z ${CHOST+x} ]; then<br>
-    # ccache not available on osx, see:<br>
-    # <a href="https://github.com/travis-ci/travis-ci/issues/5567" rel="noreferrer" target="_blank">https://github.com/travis-ci/<wbr>travis-ci/issues/5567</a><br>
-    # also ccache not enabled for cross builds<br>
+# Enable ccache except cross builds<br>
+if [ -z ${CHOST+x} ]; then<br>
     mkdir -p &quot;${HOME}/bin&quot;<br>
     ln -s &quot;$(which ccache)&quot; &quot;${HOME}/bin/${CC}&quot;<br>
     PATH=&quot;${HOME}/bin:${PATH}&quot;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<br>
<br>
</font></span></blockquote></div><br></div>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/.travis.yml b/.travis.yml
index 1f669b30..34e0ac04 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,10 +82,11 @@  cache:
   directories:
   - download-cache
   - ${HOME}/opt
+  - ${HOME}/Library/Caches/Homebrew
 
 before_install:
-  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update     ; fi
-  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo; fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew update            ; fi
+  - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew install lzo ccache; fi
 
 install:
   - if [ ! -z "${CHOST}" ]; then unset CC; fi
diff --git a/.travis/build-deps.sh b/.travis/build-deps.sh
index e787abab..e7036b6b 100755
--- a/.travis/build-deps.sh
+++ b/.travis/build-deps.sh
@@ -130,11 +130,8 @@  build_openssl () {
     fi
 }
 
-# Enable ccache
-if [ "${TRAVIS_OS_NAME}" != "osx" ] && [ -z ${CHOST+x} ]; then
-    # ccache not available on osx, see:
-    # https://github.com/travis-ci/travis-ci/issues/5567
-    # also ccache not enabled for cross builds
+# Enable ccache except cross builds
+if [ -z ${CHOST+x} ]; then
     mkdir -p "${HOME}/bin"
     ln -s "$(which ccache)" "${HOME}/bin/${CC}"
     PATH="${HOME}/bin:${PATH}"