Skip to contentSkip to conversation

travis-ci: enable ccache for osx and mingw builds

PATCH In review Ilya Shipitsin 2 participants 3 messages Nov 21, 2017 – Dec 31, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 travis-ci: enable ccache for osx and mingw builds

--
ccache was now tested by me and works for osx
and mingw builds as well

---
 .travis.yml           |  2 +-
 .travis/build-deps.sh | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)
.travis.yml +1 -1
index 366e6599..8efb1cbd 100644
@@ -88,7 +88,7 @@ cache:
 
 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 install lzo ccache; fi
 
 install:
   - if [ ! -z "${CHOST}" ]; then unset CC; fi
.travis/build-deps.sh +6 -8
index e787abab..001565f3 100755
@@ -130,15 +130,13 @@ 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
-    mkdir -p "${HOME}/bin"
-    ln -s "$(which ccache)" "${HOME}/bin/${CC}"
-    PATH="${HOME}/bin:${PATH}"
+mkdir -p "${HOME}/bin"
+if [ -z ${CHOST+x} ]; then
+        ln -s "$(which ccache)" "${HOME}/bin/${CC}"
+else
+        ln -s "$(which ccache)" "${HOME}/bin/${CHOST}-cc"
 fi
+PATH="${HOME}/bin:${PATH}"
 
 if [ ! -z ${CHOST+x} ]; then
       #
Signature · 1 line
2.13.3
#1 lore raw

Hi,

Sorry for taking so long to respond.

Quoted 3 lines · Ilya Shipitsin

--
ccache was now tested by me and works for osx
and mingw builds as well

By how much does this improve build times? I'm asking, because I recently noticed that brew on the osx slaves takes a serious amount of time. So I was wondering if we shouldn't try to avoid any brew operations for the osx builds.

Quoted 10 lines
---
 .travis.yml           |  2 +-
 .travis/build-deps.sh | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)
.travis.yml +0 -0
index 366e6599..8efb1cbd 100644

.travis.yml cache: · line 91

Quoted 5 lines
.travis.yml +1 -1
@@ -88,7 +88,7 @@ cache:
 
 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 install lzo ccache; fi

Before adding ccache here, we could reduce the build time by three minutes using --disable-lzo.

Quoted 20 lines
.travis.yml +0 -0
 install:
   - if [ ! -z "${CHOST}" ]; then unset CC; fi
.travis/build-deps.sh +0 -8
index e787abab..001565f3 100755
@@ -130,15 +130,13 @@ 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
-    mkdir -p "${HOME}/bin"
-    ln -s "$(which ccache)" "${HOME}/bin/${CC}"
-    PATH="${HOME}/bin:${PATH}"

.travis/build-deps.sh build_openssl () { · line 142

Quoted 10 lines
.travis/build-deps.sh +6 -0
+mkdir -p "${HOME}/bin"
+if [ -z ${CHOST+x} ]; then
+        ln -s "$(which ccache)" "${HOME}/bin/${CC}"
+else
+        ln -s "$(which ccache)" "${HOME}/bin/${CHOST}-cc"
 fi
+PATH="${HOME}/bin:${PATH}"
 
 if [ ! -z ${CHOST+x} ]; then
       #

Code-wise the patch looks good. But curious about your thought on the above.

-Steffan

#2 lore raw

2017-12-30 16:19 GMT+05:00 Steffan Karger <[email protected]...>:

Quoted 11 lines

Hi,

Sorry for taking so long to respond.

Quoted 3 lines · Ilya Shipitsin

--
ccache was now tested by me and works for osx
and mingw builds as well

By how much does this improve build times? I'm asking, because I

I noticed 1-2 minutes speedup on osx builds. however, it might be due to brew slowness

Quoted 4 lines

recently noticed that brew on the osx slaves takes a serious amount of time. So I was wondering if we shouldn't try to avoid any brew operations for the osx builds.

I will add brew to travis-ci cache in "v2"

ccache itself seem to add about zero speedup (and definetly no speedup on mingw builds)

Quoted 65 lines
Quoted 11 lines
---
 .travis.yml           |  2 +-
 .travis/build-deps.sh | 14 ++++++--------
 2 files changed, 7 insertions(+), 9 deletions(-)
.travis.yml +0 -0
index 366e6599..8efb1cbd 100644

.travis.yml cache: · line 91

Quoted 5 lines
.travis.yml +1 -1
@@ -88,7 +88,7 @@ cache:
 
 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 install lzo ccache; fi

Before adding ccache here, we could reduce the build time by three minutes using --disable-lzo.

Quoted 20 lines
.travis.yml +0 -0
 install:
   - if [ ! -z "${CHOST}" ]; then unset CC; fi
.travis/build-deps.sh +0 -8
index e787abab..001565f3 100755
@@ -130,15 +130,13 @@ 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
-    mkdir -p "${HOME}/bin"
-    ln -s "$(which ccache)" "${HOME}/bin/${CC}"
-    PATH="${HOME}/bin:${PATH}"

.travis/build-deps.sh build_openssl () { · line 142

Quoted 10 lines
.travis/build-deps.sh +6 -0
+mkdir -p "${HOME}/bin"
+if [ -z ${CHOST+x} ]; then
+        ln -s "$(which ccache)" "${HOME}/bin/${CC}"
+else
+        ln -s "$(which ccache)" "${HOME}/bin/${CHOST}-cc"
 fi
+PATH="${HOME}/bin:${PATH}"
 
 if [ ! -z ${CHOST+x} ]; then
       #

Code-wise the patch looks good. But curious about your thought on the above.

-Steffan

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openvpn-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel